emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master aaa734ac6e8: Add suffixes individually and use minor mode directl


From: Michael Mauger
Subject: master aaa734ac6e8: Add suffixes individually and use minor mode directly
Date: Wed, 16 Oct 2024 18:23:56 -0400 (EDT)

branch: master
commit aaa734ac6e80e3375bcf32cad9c2b484c1217b57
Author: Michael R. Mauger <michael@mauger.com>
Commit: Michael R. Mauger <michael@mauger.com>

    Add suffixes individually and use minor mode directly
    
      * lisp/jka-cmpr-hook.el (jka-compr-install): Add jka-compr
      suffixes individually with add-to-list rather than append.
      * (with-auto-compression-mode): Use auto-compression-mode minor mode.
---
 lisp/jka-cmpr-hook.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/jka-cmpr-hook.el b/lisp/jka-cmpr-hook.el
index ced998fafb6..7e502f02b3c 100644
--- a/lisp/jka-cmpr-hook.el
+++ b/lisp/jka-cmpr-hook.el
@@ -160,8 +160,8 @@ and `inhibit-local-variables-suffixes'."
        (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)))
+  (dolist (suff jka-compr-load-suffixes load-file-rep-suffixes)
+    (add-to-list 'load-file-rep-suffixes suff t)))
 
 (defun jka-compr-installed-p ()
   "Return non-nil if jka-compr is installed.
@@ -379,14 +379,14 @@ compressed when writing."
   "Evaluate BODY with automatic file compression and uncompression enabled."
   (declare (indent 0))
   (let ((already-installed (make-symbol "already-installed")))
-    `(let ((,already-installed (jka-compr-installed-p)))
+    `(let ((,already-installed auto-compression-mode))
        (unwind-protect
           (progn
             (unless ,already-installed
-              (jka-compr-install))
+              (auto-compression-mode 1))
             ,@body)
         (unless ,already-installed
-          (jka-compr-uninstall))))))
+          (auto-compression-mode -1))))))
 
 ;; This is what we need to know about jka-compr-handler
 ;; in order to decide when to call it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]