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: Thu, 02 Jun 2016 21:08:46 +0100 [thread overview]
Message-ID: <87vb1rbbg1.fsf@russet.org.uk> (raw)
In-Reply-To: <jwvshwxktit.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Wed, 01 Jun 2016 09:15:37 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> What worries me is that it just deals with the minibuffer. I wonder
>> whether there are other circumstances where a recursive edit is going to
>> break things.
>
> I guess we could introduce a new var (call it
> `undo-auto-current-buffer-only' or `undo-auto-ignore-other-buffers' or
> what have you) which packages could let-bind around recursive edits.
> We could also change the minibuf.c code to bind this var, so you could
> check the var instead of hard-coding (minibufferp) in your patch.
>
> The main use-case I can think of would be debug/edebug.
>
> This said, if the changes in other buffers are due to process-filters,
> then they still should get an undo-boundary during
> minibuffer/recursive edits. So maybe instead of "only push
> undo-boundaries in current-buffer", we should have a variable holding
> a list of buffers where we shouldn't push undo-boundaries (unless
> they're the current-buffer).
>
> Or an alternative would be to do what Viper does (well, did): keep
> pushing boundaries as before, but when we return from the minibuffer,
> remove any boundaries that were inserted into the current-buffer's
> undo-list during the recursive edit.
What I dislike about this is that other packages are responsible for
getting things right.
What about this
1) undo-auto--undoably-changed-buffers becomes an alist
((0 . (buffers*))
(1 . (buffers*))
(2 . (buffers*)))
where the key is the return of (recursion-depth)
2) undo-auto--boundaries operates only on buffers at the
current-recursion-depth. Or, probably, at the current of greater
recursion depth, to ensure that undo-buffers happens when a recursive
edit exits.
This way, process buffers will still get an undo-boundary if they change
during the recursive edit.
>> Incidentally, this is a nightmare to debug. Emacs needs to be able to
>> write to standard out, so I could log without changing any buffers!
>
> What I do is to push to a variable, and then observe the var from M-x
> ielm or some such.
That's a good idea -- I've been doing the former, then using C-hv.
Phil
next prev parent reply other threads:[~2016-06-02 20:08 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 [this message]
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
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vb1rbbg1.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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).