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: Thu, 02 Jun 2016 21:08:46 +0100
Stefan Monnier <monnier <at> 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




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.