]> git.eshelyaron.com Git - emacs.git/commitdiff
; Use an uninterned symbol in the inhibit-auto-revert expansion.
authorTassilo Horn <tsdh@gnu.org>
Thu, 6 Feb 2025 19:07:09 +0000 (20:07 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Feb 2025 08:43:02 +0000 (09:43 +0100)
(cherry picked from commit be316dc1c74fc547fe83c0426fdec3ffd4e5fb1f)

lisp/autorevert.el

index 787e69599ca13adc125405c7773e3f8281c5c1d3..1ac1f2b09853608fa0352cb94a44e166a8a16486 100644 (file)
@@ -781,22 +781,23 @@ If the buffer needs to be reverted, do it now."
     "Deactivate auto-reverting of current buffer temporarily.
 Run BODY."
     (declare (indent 0) (debug (body)))
-    `(progn
-       ;; Cleanup.
-       (dolist (buf inhibit-auto-revert-buffers)
-         (unless (buffer-live-p buf)
-           (setq inhibit-auto-revert-buffers
-                 (delq buf inhibit-auto-revert-buffers))))
-       (let ((iar-buf
-              (and (not (memq (current-buffer) inhibit-auto-revert-buffers))
-                   (current-buffer))))
-         (unwind-protect
-             (progn
-               (when iar-buf (add-to-list 'inhibit-auto-revert-buffers iar-buf))
-               ,@body)
-           (when iar-buf
+    (let ((buf (make-symbol "buf")))
+      `(progn
+         ;; Cleanup.
+         (dolist (,buf inhibit-auto-revert-buffers)
+           (unless (buffer-live-p ,buf)
              (setq inhibit-auto-revert-buffers
-                   (delq iar-buf inhibit-auto-revert-buffers))))))))
+                   (delq ,buf inhibit-auto-revert-buffers))))
+         (let ((,buf
+                (and (not (memq (current-buffer) inhibit-auto-revert-buffers))
+                     (current-buffer))))
+           (unwind-protect
+               (progn
+                 (when ,buf (add-to-list 'inhibit-auto-revert-buffers ,buf))
+                 ,@body)
+             (when ,buf
+               (setq inhibit-auto-revert-buffers
+                     (delq ,buf inhibit-auto-revert-buffers)))))))))
 
 (defun auto-revert-active-p ()
   "Check if auto-revert is active in current buffer."