From: phillip.lord@russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Chong Yidong <cyd@gnu.org>, 23632@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 [thread overview]
Message-ID: <87porxrk4v.fsf@russet.org.uk> (raw)
In-Reply-To: <jwveg8eb4es.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Fri, 03 Jun 2016 13:00:03 -0400")
Stefan Monnier <monnier@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
next prev parent reply other threads:[~2016-06-03 22:18 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 15:11 bug#23632: 25.1.50; Gratuitous undo boundary in latex-insert-block Chong Yidong
2016-05-28 8:22 ` Chong Yidong
2016-05-29 21:51 ` Phillip Lord
2016-05-31 21:42 ` Phillip Lord
2016-06-01 13:15 ` Stefan Monnier
2016-06-02 20:08 ` Phillip Lord
2016-06-03 13:00 ` Stefan Monnier
2016-06-03 16:13 ` Phillip Lord
2016-06-03 17:00 ` Stefan Monnier
2016-06-03 22:18 ` Phillip Lord [this message]
2016-06-04 3:05 ` Stefan Monnier
2016-06-04 8:51 ` Phillip Lord
2016-06-04 16:49 ` Stefan Monnier
2016-06-04 17:17 ` Phillip Lord
2016-06-04 18:41 ` Stefan Monnier
2016-06-06 14:33 ` Phillip Lord
2016-06-06 15:02 ` Stefan Monnier
2016-06-06 15:36 ` Phillip Lord
2016-06-06 15:26 ` Eli Zaretskii
2016-06-06 15:38 ` Phillip Lord
2016-06-06 16:22 ` Eli Zaretskii
2016-06-07 11:20 ` Phillip Lord
2016-06-07 15:09 ` Eli Zaretskii
2016-06-03 2:58 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87porxrk4v.fsf@russet.org.uk \
--to=phillip.lord@russet.org.uk \
--cc=23632@debbugs.gnu.org \
--cc=cyd@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.