diff options
author | Miles Bader <miles@gnu.org> | 2000-09-20 04:44:35 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2000-09-20 04:44:35 +0000 |
commit | 523b128cff09d99187a026ccf4bbd6d075b8602f (patch) | |
tree | 980dd747597a347ebbbab109a073abac9fcdf03d /lisp/jka-compr.el | |
parent | c3b27206597f8366b900e84d9a20509b4c565d6e (diff) | |
download | emacs-523b128cff09d99187a026ccf4bbd6d075b8602f.tar.gz |
(with-auto-compression-mode): New macro.
Diffstat (limited to 'lisp/jka-compr.el')
-rw-r--r-- | lisp/jka-compr.el | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el index 7539ef9999c..1d67272008e 100644 --- a/lisp/jka-compr.el +++ b/lisp/jka-compr.el @@ -1,6 +1,6 @@ ;;; jka-compr.el --- reading/writing/loading compressed files -;; Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 Free Software Foundation, Inc. ;; Author: jka@ece.cmu.edu (Jay K. Adams) ;; Maintainer: FSF @@ -812,6 +812,21 @@ saying whether the mode is now on or off." flag)) + +(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 () (concat "\\(" |