]> git.eshelyaron.com Git - emacs.git/commitdiff
(auto-compression-mode): Move to the end of the file, because
authorMiles Bader <miles@gnu.org>
Sun, 8 Oct 2000 02:58:24 +0000 (02:58 +0000)
committerMiles Bader <miles@gnu.org>
Sun, 8 Oct 2000 02:58:24 +0000 (02:58 +0000)
`define-minor-mode' actually calls the mode-function if the associated
variable is non-nil, which requires that all needed functions be already
defined.
(with-auto-compression-mode): Add autoload cookie.

lisp/ChangeLog
lisp/jka-compr.el

index f905f48b45c1511d6f20143d01837651ee03e6b9..66866f15bc559ff61c7d4441424b4cc999372b75 100644 (file)
@@ -1,3 +1,11 @@
+2000-10-08  Miles Bader  <miles@gnu.org>
+
+       * jka-compr.el (auto-compression-mode): Move to 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.
+       (with-auto-compression-mode): Add autoload cookie.
+
 2000-10-07  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * files.el (find-backup-file-name) [ms-dos]: If support for long
index 3938590cabc013a44f24fbe29c7c9b5c882837d7..9adeddfefa7bdf4d01d4154a93fb5c1e5ad142a8 100644 (file)
@@ -755,34 +755,6 @@ It is not recommended to set this variable permanently to anything but nil.")
        (inhibit-file-name-operation operation))
     (apply operation args)))
 
-;;;###autoload
-(define-minor-mode auto-compression-mode
-  "Toggle automatic file compression and uncompression.
-With prefix argument ARG, turn auto compression on if positive, else off.
-Returns the new status of auto compression (non-nil means on)."
-  nil nil nil :global t :group 'jka-compr
-  (let* ((installed (jka-compr-installed-p))
-        (flag auto-compression-mode))
-    (cond
-     ((and flag installed) t)          ; already installed
-     ((and (not flag) (not installed)) nil) ; already not installed
-     (flag (jka-compr-install))
-     (t (jka-compr-uninstall)))))
-
-
-(defmacro with-auto-compression-mode (&rest body)
-  "Evalutes BODY with automatic file compression and uncompression enabled."
-  (let ((already-installed (make-symbol "already-installed")))
-    `(let ((,already-installed (jka-compr-installed-p)))
-       (unwind-protect
-          (progn
-            (unless ,already-installed
-              (jka-compr-install))
-            ,@body)
-        (unless ,already-installed
-          (jka-compr-uninstall))))))
-(put 'with-auto-compression-mode 'lisp-indent-function 0)
-
 
 (defun jka-compr-build-file-regexp ()
   (mapconcat
@@ -901,6 +873,36 @@ The return value is the entry in `file-name-handler-alist' for jka-compr."
     installed))
 
 
+;;;###autoload
+(define-minor-mode auto-compression-mode
+  "Toggle automatic file compression and uncompression.
+With prefix argument ARG, turn auto compression on if positive, else off.
+Returns the new status of auto compression (non-nil means on)."
+  nil nil nil :global t :group 'jka-compr
+  (let* ((installed (jka-compr-installed-p))
+        (flag auto-compression-mode))
+    (cond
+     ((and flag installed) t)          ; already installed
+     ((and (not flag) (not installed)) nil) ; already not installed
+     (flag (jka-compr-install))
+     (t (jka-compr-uninstall)))))
+
+
+;;;###autoload
+(defmacro with-auto-compression-mode (&rest body)
+  "Evalutes BODY with automatic file compression and uncompression enabled."
+  (let ((already-installed (make-symbol "already-installed")))
+    `(let ((,already-installed (jka-compr-installed-p)))
+       (unwind-protect
+          (progn
+            (unless ,already-installed
+              (jka-compr-install))
+            ,@body)
+        (unless ,already-installed
+          (jka-compr-uninstall))))))
+(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.