# HG changeset patch # User Miles Bader # Date 971048032 0 # Node ID ffc41362f67e3403715549e3824055f0563ea754 # Parent b930d561cd531121e8ae115daea7255bd02e0656 Don't call `jka-compr-install' when loading (it will be done by the definition of `auto-compression-mode' if necessary). Move code to uninstall existing file-name handler before definition of `auto-compression-mode'. diff -r b930d561cd53 -r ffc41362f67e lisp/jka-compr.el --- a/lisp/jka-compr.el Sun Oct 08 23:23:55 2000 +0000 +++ b/lisp/jka-compr.el Sun Oct 08 23:33:52 2000 +0000 @@ -873,6 +873,17 @@ installed)) +;;; Add the file I/O hook if it does not already exist. +;;; Make sure that jka-compr-file-name-handler-entry is eq to the +;;; entry for jka-compr in file-name-handler-alist. +(and (jka-compr-installed-p) + (jka-compr-uninstall)) + + +;;; Note this definition must be at the end of the file, because +;;; `define-minor-mode' actually calls the mode-function if the +;;; associated variable is non-nil, which requires that all needed +;;; functions be already defined. [This is arguably a bug in d-m-m] ;;;###autoload (define-minor-mode auto-compression-mode "Toggle automatic file compression and uncompression. @@ -890,7 +901,7 @@ ;;;###autoload (defmacro with-auto-compression-mode (&rest body) - "Evalutes BODY with automatic file compression and uncompression enabled." + "Evalute BODY with automatic file compression and uncompression enabled." (let ((already-installed (make-symbol "already-installed"))) `(let ((,already-installed (jka-compr-installed-p))) (unwind-protect @@ -903,15 +914,6 @@ (put 'with-auto-compression-mode 'lisp-indent-function 0) -;;; Add the file I/O hook if it does not already exist. -;;; Make sure that jka-compr-file-name-handler-entry is eq to the -;;; entry for jka-compr in file-name-handler-alist. -(and (jka-compr-installed-p) - (jka-compr-uninstall)) - -(jka-compr-install) - - (provide 'jka-compr) ;; jka-compr.el ends here.