GNU bug report logs -
#75626
31.0.50; Dired misses or double-processes files when auto-revert-mode is enabled
Previous Next
Reported by: Tassilo Horn <tsdh <at> gnu.org>
Date: Fri, 17 Jan 2025 07:43:01 UTC
Severity: normal
Found in version 31.0.50
Done: Tassilo Horn <tsdh <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #352 received at 75626 <at> debbugs.gnu.org (full text, mbox):
Michael Albinus <michael.albinus <at> gmx.de> writes:
>> Have you ever read (info "(elisp) Surprising Local Vars") - and the
>> whole (info "(elisp) Problems with Macros") chapter? (If not, you
>> should do...)
>
> I did. But I've never thought about consequences for macro
> expansion. Finally, I've decided for "a more obscure name".
Why not go the full way and do it correctly like with this patch:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index 315100885be..b3079658ece 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -781,22 +781,24 @@ auto-revert--end-lockout
"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"))
+ (buf2 (make-symbol "buf2")))
+ `(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 ((,buf2
+ (and (not (memq (current-buffer) inhibit-auto-revert-buffers))
+ (current-buffer))))
+ (unwind-protect
+ (progn
+ (when ,buf2 (add-to-list 'inhibit-auto-revert-buffers ,buf2))
+ ,@body)
+ (when ,buf2
+ (setq inhibit-auto-revert-buffers
+ (delq ,buf2 inhibit-auto-revert-buffers)))))))))
(defun auto-revert-active-p ()
"Check if auto-revert is active in current buffer."
--8<---------------cut here---------------end--------------->8---
BTW, Clojure has a very nice feature. When you write a macro like
(defmacro quux []
`(let [x# (foo)
y# (baz x#)]
(+ x# y#)))
every occurrence of x# (and y#) expands into the same
gensymed/uninterned symbol. So you don't need to manually create and
let-bind uninterned symbols in order to splice them in the expansion.
That would be nice to have in Elisp.
Bye,
Tassilo
This bug report was last modified 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.