From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#23785: Emacs 25: 'Undo' overdoes things. Date: Tue, 21 Jun 2016 17:25:29 -0400 Message-ID: References: <20160617150245.GB3316@acm.fritz.box> <83r3bvbuu1.fsf@gnu.org> <20160617174535.GD3316@acm.fritz.box> <83oa6zbmvd.fsf@gnu.org> <87ziqjwkrb.fsf@russet.org.uk> <83eg7vaq3z.fsf@gnu.org> <83bn2y9v80.fsf@gnu.org> <87vb13ewc8.fsf@russet.org.uk> <83wplj7u2t.fsf@gnu.org> <8737o7aio2.fsf@russet.org.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466544400 23219 80.91.229.3 (21 Jun 2016 21:26:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2016 21:26:40 +0000 (UTC) Cc: acm@muc.de, 23785@debbugs.gnu.org To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 21 23:26:30 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 1bFTBZ-0007up-Uo for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jun 2016 23:26:18 +0200 Original-Received: from localhost ([::1]:54352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTBT-00024i-UB for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Jun 2016 17:26:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTBO-00024d-3D for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 17:26:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFTBK-0005DO-Qx for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 17:26:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFTBK-0005DK-NT for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 17:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bFTBK-00009C-GV for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2016 17:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2016 21:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23785-submit@debbugs.gnu.org id=B23785.1466544316498 (code B ref 23785); Tue, 21 Jun 2016 21:26:02 +0000 Original-Received: (at 23785) by debbugs.gnu.org; 21 Jun 2016 21:25:16 +0000 Original-Received: from localhost ([127.0.0.1]:50121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFTAZ-00007y-PY for submit@debbugs.gnu.org; Tue, 21 Jun 2016 17:25:15 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFTAW-00007p-PI for 23785@debbugs.gnu.org; Tue, 21 Jun 2016 17:25:13 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id u5LLP9kN024043; Tue, 21 Jun 2016 17:25:10 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id ACD9C60053; Tue, 21 Jun 2016 17:25:29 -0400 (EDT) In-Reply-To: <8737o7aio2.fsf@russet.org.uk> (Phillip Lord's message of "Mon, 20 Jun 2016 18:12:29 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5713=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5713> : inlines <4942> : streams <1655768> : uri <2235465> 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:119903 Archived-At: > + /* > + Temporarily enable the undo-buffer to ensure that the change > + is marked as an undoable one. Bug #23785. > + */ > + bset_undo_list(current_buffer,Qnil); Additionally to Eli's remark about the shape of your comments, please also put spaces before open parens and after commas. > insert_from_buffer (XBUFFER (conversion_buffer), > same_at_start_charpos, inserted_chars, 0); > + bset_undo_list(current_buffer,Qt); Instead of two bset_undo_list, you could use a single specbind since the above code is almost immediately followed by unbind_to. But more seriously, I'm wondering: where is undo-list set to t (and hence causing the problem we're seeing)? Searching for "undo" in that function gives m the impression that undo-0list won't be set to t during the call to insert_from_buffer. What am I missing? Stefan