GNU bug report logs -
#23632
25.1.50; Gratuitous undo boundary in latex-insert-block
Previous Next
Reported by: Chong Yidong <cyd <at> gnu.org>
Date: Fri, 27 May 2016 15:12:02 UTC
Severity: minor
Tags: patch
Found in version 25.1.50
Fixed in version 25.1
Done: phillip.lord <at> russet.org.uk (Phillip Lord)
Bug is archived. No further changes may be made.
Full log
Message #32 received at 23632 <at> debbugs.gnu.org (full text, mbox):
> Simple let binding would not give quite the same functionality, because
> of the last part -- I also add a boundary to buffers with a greater
> recursive depth; with a let binding, I think these would be unbound for
> commands that lower the recursion depth.
Ah, you mean that the value of undo-auto--undoably-changed-buffers needs
to be propagated "out" when we leave the let-binding. You're right.
So instead of a simple `let', it needs to be something like:
(let ((tmp ()))
(unwind-protect
(let ((undo-auto--undoably-changed-buffers nil))
(unwind-protect
<do-it-all>
(setq tmp undo-auto--undoably-changed-buffers)))
(setq undo-auto--undoably-changed-buffers
(append tmp undo-auto--undoably-changed-buffers))))
Or
(let ((tmp undo-auto--undoably-changed-buffers))
(unwind-protect
(progn
(setq undo-auto--undoably-changed-buffers nil)
<do-it-all>)
(setq undo-auto--undoably-changed-buffers
(append undo-auto--undoably-changed-buffers tmp))))
Maybe a simple alternative would be to do
(let ((undo-auto--undoably-changed-buffers nil))
(unwind-protect
<do-it-all>
(undo-auto--ensure-boundary undo-auto--undoably-changed-buffers)))
-- Stefan
This bug report was last modified 8 years and 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.