From 523b128cff09d99187a026ccf4bbd6d075b8602f Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 20 Sep 2000 04:44:35 +0000 Subject: [PATCH] (with-auto-compression-mode): New macro. --- lisp/ChangeLog | 2 ++ lisp/jka-compr.el | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 66845d062ac..8b5a92b0d56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2000-09-20 Miles Bader + * jka-compr.el (with-auto-compression-mode): New macro. + * cus-edit.el (custom-face-tag-face, custom-group-tag-face-1) (custom-group-tag-face, custom-variable-tag-face): Use relative :height and inherit from `variable-pitch' face instead of 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 "\\(" -- 2.39.2