GNU bug report logs - #23632
25.1.50; Gratuitous undo boundary in latex-insert-block

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: phillip.lord <at> russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Chong Yidong <cyd <at> gnu.org>, 23632 <at> debbugs.gnu.org
Subject: bug#23632: 25.1.50; Gratuitous undo boundary in latex-insert-block
Date: Fri, 03 Jun 2016 23:18:56 +0100
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

>> 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.

I *think* so -- I'm not entirely sure. It might make no difference.


> 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)))

I use this variable in several different places in two different places
though -- once when we capture the undoable changes (which happens
often) and once on at the end of each command. I'd have to do this let
binding in the command loop?

My current solution seems simpler, even if it does feel like I have
created "recursion-level" local variables.

Or am I totally mis-understanding what you are suggesting? I'd be
happier with a simpler implementation if possible.

Phil






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.