unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
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: Mon, 06 Jun 2016 15:33:12 +0100	[thread overview]
Message-ID: <87r3cacrpz.fsf@russet.org.uk> (raw)
In-Reply-To: <jwvd1nwiytw.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Sat, 04 Jun 2016 14:41:36 -0400")

[-- Attachment #1: Type: text/plain, Size: 1182 bytes --]



Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I guess "recursive-edit" is the only way to enter a recursive edit?
>
> AFAICT, `recursive_edit_1' is the C function that's used by both
> `recursive-edit' and `read-from-minibuffer', so it should catch all cases.


So, tried it, and AFAICT, you are correct. The attached patch seems to
fix. And it is significantly simpler than the last fix.

It currently does not deal with the case where there "left over" after a
command which changes a recursive edit level. The lists of buffers in
undo-auto-undoably-changed-buffer will be lost as we come out of the
specbind.

I do not know whether this is a problem or not. Potential solutions:

1) before we exit recursive_edit_1, append the value of
undo-auto-undoably-changed-buffer on a new variable
("undoably-changed-buffer-recursive"). Then, when undo-auto-boundary
runs append and nil this. Seems like a lot of effort for an occasional
issue.

2) Call undo-auto--add-boundary before exiting recursive_edit_1. This
should nil undoably-changed-buffer and add boundaries.

3) Just not worry about it.

Assuming we go for 3, is everyone happy to patch the Emacs-25 branch?

Phil



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-regression-for-recursive-editing-in-undo.patch --]
[-- Type: text/x-diff, Size: 1284 bytes --]

From 92ec383f9c732af76f6ba18c87a6989a4b6f16e8 Mon Sep 17 00:00:00 2001
From: Phillip Lord <phillip.lord@russet.org.uk>
Date: Mon, 6 Jun 2016 09:35:17 +0100
Subject: [PATCH] Fix regression for recursive editing in undo

---
 src/keyboard.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/keyboard.c b/src/keyboard.c
index e3858a5..b5b603c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -679,6 +679,8 @@ recursive_edit_1 (void)
      recursive edit, the original redisplay leading to the recursive
      edit will be unwound.  The outcome should therefore be safe.  */
   specbind (Qinhibit_redisplay, Qnil);
+
+  specbind (Qundo_auto__undoably_changed_buffers, Qnil);
   redisplaying_p = 0;
 
   val = command_loop ();
@@ -689,6 +691,7 @@ recursive_edit_1 (void)
   if (STRINGP (val))
     xsignal1 (Qerror, val);
 
+
   return unbind_to (count, Qnil);
 }
 
@@ -10956,6 +10959,8 @@ syms_of_keyboard (void)
   DEFSYM (Qpost_command_hook, "post-command-hook");
 
   DEFSYM (Qundo_auto__add_boundary, "undo-auto--add-boundary");
+  DEFSYM (Qundo_auto__undoably_changed_buffers,
+          "undo-auto--undoably-changed-buffers");
 
   DEFSYM (Qdeferred_action_function, "deferred-action-function");
   DEFSYM (Qdelayed_warnings_hook, "delayed-warnings-hook");
-- 
2.8.3


  reply	other threads:[~2016-06-06 14:33 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
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 [this message]
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=87r3cacrpz.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).