;ELC ;;; compiled by kwzh@hal.gnu.ai.mit.edu on Mon May 1 15:31:57 1995 ;;; from file /gd/gnu/emacs/19.0/lisp/jka-compr.el ;;; emacs version 19.28.90.55. ;;; bytecomp version FSF 2.10 ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "`/gd/gnu/emacs/19.0/lisp/jka-compr.el' was compiled for Emacs 19")) #@229 *Shell to be used for calling compression programs. The value of this variable only matters if you want to discard the stderr of a compression/decompression program (see the documentation for `jka-compr-compression-info-list'). (defvar jka-compr-shell "sh" (#$ . -488)) (byte-code "! B" [boundp jka-compr-use-shell t current-load-list] 2) #@1390 List of vectors that describe available compression techniques. Each element, which describes a compression technique, is a vector of the form [REGEXP COMPRESS-MSG COMPRESS-PROGRAM COMPRESS-ARGS UNCOMPRESS-MSG UNCOMPRESS-PROGRAM UNCOMPRESS-ARGS APPEND-FLAG EXTENSION], where: regexp is a regexp that matches filenames that are compressed with this format compress-msg is the message to issue to the user when doing this type of compression (nil means no message) compress-program is a program that performs this compression compress-args is a list of args to pass to the compress program uncompress-msg is the message to issue to the user when doing this type of uncompression (nil means no message) uncompress-program is a program that performs this compression uncompress-args is a list of args to pass to the uncompress program append-flag is non-nil if this compression technique can be appended auto-mode flag non-nil means strip the regexp from file names before attempting to set the mode. Because of the way `call-process' is defined, discarding the stderr output of a program adds the overhead of starting a shell each time the program is invoked. (defvar jka-compr-compression-info-list (quote (["\\.Z\\(~\\|\\.~[0-9]+~\\)?\\'" "compressing" "compress" ("-c") "uncompressing" "uncompress" ("-c") nil t] ["\\.tgz\\'" "zipping" "gzip" ("-c" "-q") "unzipping" "gzip" ("-c" "-q" "-d") t nil] ["\\.gz\\(~\\|\\.~[0-9]+~\\)?\\'" "zipping" "gzip" ("-c" "-q") "unzipping" "gzip" ("-c" "-q" "-d") t t])) (#$ . 846)) #@72 A list of pairs to add to auto-mode-alist when jka-compr is installed. (defvar jka-compr-mode-alist-additions (byte-code "BC" ["\\.tgz\\'" tar-mode] 2) (#$ . 2600)) #@77 The entry in `file-name-handler-alist' used by the jka-compr I/O functions. (defvar jka-compr-file-name-handler-entry nil (#$ . 2774)) (defalias 'jka-compr-info-regexp #[(info) "H" [info 0] 2]) (defalias 'jka-compr-info-compress-message #[(info) "H" [info 1] 2]) (defalias 'jka-compr-info-compress-program #[(info) "H" [info 2] 2]) (defalias 'jka-compr-info-compress-args #[(info) "H" [info 3] 2]) (defalias 'jka-compr-info-uncompress-message #[(info) "H" [info 4] 2]) (defalias 'jka-compr-info-uncompress-program #[(info) "H" [info 5] 2]) (defalias 'jka-compr-info-uncompress-args #[(info) "H" [info 6] 2]) (defalias 'jka-compr-info-can-append #[(info) "H" [info 7] 2]) (defalias 'jka-compr-info-strip-extension #[(info) "H" [info 8] 2]) #@198 Return information about the compression scheme of FILENAME. The determination as to which compression scheme, if any, to use is based on the filename itself and `jka-compr-compression-info-list'. (defalias 'jka-compr-get-compression-info #[(filename) "" [compression-info (byte-code "\f\")" [nil case-fold-search mapcar #[(x) "\n! \" \n\"" [string-match jka-compr-info-regexp x filename throw compression-info] 3] jka-compr-compression-info-list] 3)] 2 (#$ . 3547)]) (byte-code "#!B" [put compression-error error-conditions (compression-error file-error error) boundp jka-compr-acceptable-retval-list (0 2 141) current-load-list] 4) (defalias 'jka-compr-error #[(prog args infile message &optional errfile) "!pq~ \n#\f$c ' !\nq !*\"\fE\"" [get-buffer-create " *jka-compr-error*" curbuf errbuf erase-buffer format "Error while executing \"%s %s < %s\"\n\n" prog mapconcat identity args " " infile errfile insert-file-contents display-buffer signal compression-error "Opening input file" "error %s" message] 8]) (byte-code "! B! B" [boundp jka-compr-dd-program "/bin/dd" current-load-list jka-compr-dd-blocksize 256] 2) #@187 Call program PROG with ARGS args taking input from INFILE. Fourth and fifth args, BEG and LEN, specify which part of the output to keep: LEN chars starting BEG chars from the beginning. (defalias 'jka-compr-partial-uncompress #[(prog message args infile beg len) " \n _Z\f\f \\ T`  # \n 7 TP8&Ԏ&>] %)\fv \f\\\\`Wv \f\\\\`| \\|." [beg jka-compr-dd-blocksize skip prefix len count start jka-compr-make-temp-name err-file format "%s %s 2> %s | %s bs=%d skip=%d %s 2> /dev/null" prog mapconcat identity args " " jka-compr-dd-program "count=" "" run-string ((jka-compr-delete-temp-file err-file)) call-process jka-compr-shell infile t nil "-c" jka-compr-acceptable-retval-list jka-compr-error message] 10 (#$ . 4767)]) (defalias 'jka-compr-call-process #[(prog message infile output temp args) "G Î ;?\f#\n;0P1%&>E\f\n%*\f;Y[&!o\f$;pqed# q)" [jka-compr-use-shell jka-compr-make-temp-name err-file ((jka-compr-delete-temp-file err-file)) call-process jka-compr-shell infile output nil "-c" format "%s %s 2> %s %s" prog mapconcat identity args " " "> " "" jka-compr-acceptable-retval-list jka-compr-error message zerop apply temp cbuf write-region erase-buffer] 13]) #@120 Prefix added to all temp files created by jka-compr. There should be no more than seven characters after the final `/' (defvar jka-compr-temp-name-template "/tmp/jka-com" (#$ . 6111)) (byte-code "! \" Bć" [boundp jka-compr-temp-name-table make-vector 31 nil current-load-list] 3) #@50 This routine will return the name of a new file. (defalias 'jka-compr-make-temp-name #[(&optional local-copy) " PGS\n r  I !P\n\n\" N=\n!b TV\nT\nVX! S\nI ?#ɉ\n." [97 lastchar prevchar jka-compr-temp-name-template "aa" template lastpos t not-done nil file entry make-temp-name "#" intern jka-compr-temp-name-table active file-exists-p 122 error "Can't allocate temp file." put local-copy] 5 (#$ . 6408)]) (defalias 'jka-compr-delete-temp-file #[(temp) "\n \"#Ǐ" [put intern temp jka-compr-temp-name-table active nil (delete-file temp) ((error))] 4]) (defalias 'jka-compr-write-region #[(start end file &optional append visit) " ! ; !\n\f!#!!!!!!!\f!ωp!q~ q\n!\n!!\n\"* #()\"Q&qed\n\" q!# =\n0  ; 0\n0 ) = = ;\f\". ς0()\n \"+" [expand-file-name file filename visit visit-file jka-compr-get-compression-info info jka-compr-info-can-append jka-compr-info-compress-program jka-compr-info-compress-message jka-compr-info-uncompress-program jka-compr-info-uncompress-message jka-compr-info-compress-args jka-compr-info-uncompress-args file-name-nondirectory nil temp-buffer cbuf temp-file base-name uncompress-args compress-args uncompress-message uncompress-program compress-message compress-program can-append get-buffer-create " *jka-compr-wr-temp*" erase-buffer append file-exists-p file-local-copy local-copy local-file jka-compr-make-temp-name message "%s %s..." jka-compr-run-real-handler write-region start end t dont jka-compr-call-process " " jka-compr-delete-temp-file "%s %s...done" buffer-file-name set-visited-file-modtime "Wrote %s"] 12]) (defalias 'jka-compr-insert-file-contents #[(file &optional visit beg end replace) " \n !!!\n\n!\n!\n!!C\"ωV `܎o#Ꮘ)  # 8B\")*++@!***D\"*+A+*. D \n/\"*" [barf-if-buffer-read-only beg end visit error "Attempt to visit less than an entire file" expand-file-name file filename jka-compr-get-compression-info info jka-compr-info-uncompress-message jka-compr-info-uncompress-program jka-compr-info-uncompress-args file-name-nondirectory nil jka-compr-run-real-handler file-local-copy start size local-file local-copy notfound base-name uncompress-args uncompress-program uncompress-message buffer-file-name ((byte-code "!!" [local-copy file-exists-p delete-file] 2)) message "%s %s..." error-code (byte-code "eb`\n 7 Q \n\n\"\n0 0 \nZ1 &S\f??  Q\n &)` Zn`\\d^|* b" [replace start beg end jka-compr-partial-uncompress uncompress-program uncompress-message " " base-name uncompress-args local-file 0 visit buffer-file-name jka-compr-call-process t nil size del-beg del-end] 9) ((error (byte-code "@=$8 =$\f+AAB\"+@A\"" [error-code file-error 3 local-file visit notfound signal "Opening input file"] 4))) unlock-buffer set-visited-file-modtime "%s %s...done" signal file-error "Opening input file" 2 after-insert-file-functions insval p wrong-type-argument integerp insert-file-contents replace] 10]) (defalias 'jka-compr-file-local-copy #[(file) " !\n!\f!\f!\f!\n!\nC\"!!p@\nڎQ#qQ&t#ed%).\n\nC\"*" [expand-file-name file filename jka-compr-get-compression-info info jka-compr-info-uncompress-message jka-compr-info-uncompress-program jka-compr-info-uncompress-args file-name-nondirectory jka-compr-run-real-handler file-local-copy jka-compr-make-temp-name t get-buffer-create " *jka-compr-flc-temp*" nil local-file cbuf notfound temp-buffer temp-file local-copy base-name uncompress-args uncompress-program uncompress-message ((byte-code "!! q !" [local-copy file-exists-p delete-file cbuf kill-buffer temp-buffer] 2)) message "%s %s..." jka-compr-call-process " " "%s %s...done" write-region dont] 11]) #@25 Documented as original. (defalias 'jka-compr-load #[(file &optional noerror nomessage nosuffix) " ! Ďʼn \" \f͉$. \"-͇" [jka-compr-file-local-copy file local-copy load-file ((jka-compr-delete-temp-file local-copy)) nil inhibit-file-name-handlers inhibit-file-name-operation nomessage message "Loading %s..." load noerror t "Loading %s...done."] 6 (#$ . 10680)]) (byte-code "####" [put write-region jka-compr jka-compr-write-region insert-file-contents jka-compr-insert-file-contents file-local-copy jka-compr-file-local-copy load jka-compr-load] 4) (defalias 'jka-compr-handler #[(operation &rest args) " Ž N \" \"+" [match-data match-data ((store-match-data match-data)) operation jka-compr jka-op apply args jka-compr-run-real-handler] 4]) (defalias 'jka-compr-run-real-handler #[(operation args) " \n= B\n\n \"*" [jka-compr-handler inhibit-file-name-operation operation inhibit-file-name-handlers apply args] 3]) #@191 Toggle automatic file compression and decompression. With prefix argument ARG, turn auto compression on if positive, else off. Returns the new status of auto compression (non-nil means on). (defalias 'toggle-auto-compression #[(arg) " \n\f ?\n=\n<\n\nV( = 0 = : = tP L!P! *" [jka-compr-installed-p installed arg t 0 flag jka-compr-install jka-compr-uninstall message "Automatic file (de)compression is now ON." "Automatic file (de)compression is now OFF."] 3 (#$ . 11681) "P"]) (defalias 'jka-compr-build-file-regexp #[nil " #Q" ["\\(" mapconcat jka-compr-info-regexp jka-compr-compression-info-list "\\)\\|\\(" "\\)"] 5]) #@130 Install jka-compr. This adds entries to `file-name-handler-alist' and `auto-mode-alist' and `inhibit-first-line-modes-suffixes'. (defalias 'jka-compr-install #[nil " B B\" \"" [jka-compr-build-file-regexp jka-compr-handler jka-compr-file-name-handler-entry file-name-handler-alist mapcar #[(x) " ! !E B !B" [jka-compr-info-strip-extension x jka-compr-info-regexp nil jka-compr auto-mode-alist inhibit-first-line-modes-suffixes] 3] jka-compr-compression-info-list append auto-mode-alist jka-compr-mode-alist-additions] 4 (#$ . 12367)]) #@180 Uninstall jka-compr. This removes the entries in `file-name-handler-alist' and `auto-mode-alist' and `inhibit-first-line-modes-suffixes' that were added by `jka-compr-installed'. (defalias 'jka-compr-uninstall #[nil "\n\"\fBA/A@A=&AA\fA A*B \nAuA@\n b\nA:l\n8=lAA?AA A+" [mapcar #[(x) " ! !\f\"" [jka-compr-info-strip-extension x delete jka-compr-info-regexp inhibit-first-line-modes-suffixes] 3] jka-compr-compression-info-list nil file-name-handler-alist fnha last jka-compr-handler auto-mode-alist ama entry jka-compr-mode-alist-additions 2 jka-compr] 4 (#$ . 12946)]) #@117 Return non-nil if jka-compr is installed. The return value is the entry in `file-name-handler-alist' for jka-compr. (defalias 'jka-compr-installed-p #[nil "\n @A= @ A\n*" [file-name-handler-alist nil installed fnha jka-compr-handler] 3 (#$ . 13615)]) (byte-code "  !" [jka-compr-installed-p jka-compr-uninstall jka-compr-install provide jka-compr] 2)