1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-24 06:20:43 -08:00

; Use an uninterned symbol in the inhibit-auto-revert expansion.

This commit is contained in:
Tassilo Horn 2025-02-06 20:07:09 +01:00
parent 811d575336
commit be316dc1c7

View file

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