From bd0c0abb15b1fbdc2e502efe51c100c1f7b5ac87 Mon Sep 17 00:00:00 2001 From: "Michael R. Mauger" Date: Wed, 16 Oct 2024 17:59:58 -0400 Subject: [PATCH] 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. (cherry picked from commit aaa734ac6e80e3375bcf32cad9c2b484c1217b57) --- 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. -- 2.39.5