Function: jka-compr-install

jka-compr-install is a byte-compiled function defined in jka-cmpr-hook.el.gz.

Signature

(jka-compr-install)

Documentation

Install jka-compr.

This adds entries to file-name-handler-alist and auto-mode-alist and inhibit-local-variables-suffixes.

Source Code

;; Defined in /usr/src/emacs/lisp/jka-cmpr-hook.el.gz
(defun jka-compr-install ()
  "Install jka-compr.
This adds entries to `file-name-handler-alist' and `auto-mode-alist'
and `inhibit-local-variables-suffixes'."

  (setq jka-compr-file-name-handler-entry
	(cons (jka-compr-build-file-regexp) 'jka-compr-handler))

  (push jka-compr-file-name-handler-entry file-name-handler-alist)

  (setq jka-compr-compression-info-list--internal
	jka-compr-compression-info-list
	jka-compr-mode-alist-additions--internal
	jka-compr-mode-alist-additions
	jka-compr-load-suffixes--internal
	jka-compr-load-suffixes)

  (dolist (x jka-compr-compression-info-list)
    ;; Don't do multibyte encoding on the compressed files.
    (let ((elt (cons (jka-compr-info-regexp x)
                     '(no-conversion . no-conversion))))
      (push elt file-coding-system-alist)
      (push elt jka-compr-added-to-file-coding-system-alist))

    (and (jka-compr-info-strip-extension x)
         ;; Make entries in auto-mode-alist so that modes
         ;; are chosen right according to the file names
         ;; sans `.gz'.
         (push (list (jka-compr-info-regexp x) nil 'jka-compr) auto-mode-alist)
         ;; Also add these regexps to inhibit-local-variables-suffixes,
         ;; so that a -*- line in the first file of a compressed tar file,
         ;; or a Local Variables section in a member file at the end of
         ;; the tar file don't override tar-mode.
         (push (jka-compr-info-regexp x)
               inhibit-local-variables-suffixes)))
  (setq auto-mode-alist
	(append auto-mode-alist jka-compr-mode-alist-additions))

  ;; Make sure that (load "foo") will find /bla/foo.el.gz.
  (setq load-file-rep-suffixes
	(append load-file-rep-suffixes jka-compr-load-suffixes nil)))