From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.bugs Subject: bug#23632: 25.1.50; Gratuitous undo boundary in latex-insert-block Date: Mon, 06 Jun 2016 15:33:12 +0100 Message-ID: <87r3cacrpz.fsf@russet.org.uk> References: <87lh2vo7s6.fsf@gmail.com> <87shx23830.fsf@gmail.com> <87wpmcwn13.fsf@russet.org.uk> <87wpm9q4z7.fsf@russet.org.uk> <87vb1rbbg1.fsf@russet.org.uk> <87shwutfmo.fsf@russet.org.uk> <87porxrk4v.fsf@russet.org.uk> <8b9b4630b1282ed76fe26452b4a8fbb6.squirrel@cloud103.planethippo.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1465223672 22161 80.91.229.3 (6 Jun 2016 14:34:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jun 2016 14:34:32 +0000 (UTC) Cc: Chong Yidong , 23632@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 06 16:34:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b9vbg-0002lu-G8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2016 16:34:20 +0200 Original-Received: from localhost ([::1]:42821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vbf-0005UK-NY for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jun 2016 10:34:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vbU-0005Qr-Nm for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2016 10:34:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b9vbO-0005K2-Kh for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2016 10:34:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b9vbO-0005Jx-H3 for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2016 10:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b9vbO-0007oQ-6J for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2016 10:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: phillip.lord@russet.org.uk (Phillip Lord) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jun 2016 14:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23632 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 23632-submit@debbugs.gnu.org id=B23632.146522360329985 (code B ref 23632); Mon, 06 Jun 2016 14:34:02 +0000 Original-Received: (at 23632) by debbugs.gnu.org; 6 Jun 2016 14:33:23 +0000 Original-Received: from localhost ([127.0.0.1]:56873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9vak-0007nZ-O4 for submit@debbugs.gnu.org; Mon, 06 Jun 2016 10:33:22 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:58266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b9vah-0007nL-FX for 23632@debbugs.gnu.org; Mon, 06 Jun 2016 10:33:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russet.org.uk; s=default; h=Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From; bh=aqRDrB5NqfmhntjENy/g2CAXygoW9OUgHUj+2Y6BFT4=; b=vDcJlZbIm/y1hPfyy52M2m1KCD kGVRWWs9CCoGurdKbSrvdYgy1wEMSuh2J6bRgmYbl782GIa12MK9tT5jbFsnFXu8H3CHIYj4Mtngz 6d/eSP+jqbmsfgCq3bHrfuQdxFYsIwp8j/wZBJQvD4MjTMrEmyfqGtaSz4wVolNiab86p6CzOgg01 FLExFl/M8ZhVMqDrI/J6kqw5kTgBu9IsX+gKlnQSaCwAAP5OJdT6CVw2mJNp/7965Eh6dLzvqGPPH HkbKnPbrGnEUkoPvqzJfScJSiI8r+ZAdPz0DburNtCPBflfzPWNYyI0+ElJL9kv2llPE3NTy9QthR AS3WWl8w==; Original-Received: from janus-nat-128-240-225-60.ncl.ac.uk ([128.240.225.60]:33176 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1b9vab-0035ET-3t; Mon, 06 Jun 2016 15:33:13 +0100 In-Reply-To: (Stefan Monnier's message of "Sat, 04 Jun 2016 14:41:36 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud103.planethippo.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - russet.org.uk X-Get-Message-Sender-Via: cloud103.planethippo.com: authenticated_id: phillip.lord@russet.org.uk X-Authenticated-Sender: cloud103.planethippo.com: phillip.lord@russet.org.uk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119146 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-regression-for-recursive-editing-in-undo.patch >From 92ec383f9c732af76f6ba18c87a6989a4b6f16e8 Mon Sep 17 00:00:00 2001 From: Phillip Lord 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 --=-=-=--