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#23871: 25.1.50; Undo unexpectedly leads to blank buffer Date: Tue, 05 Jul 2016 23:17:38 +0100 Message-ID: <87bn2bd919.fsf@russet.org.uk> References: <83h9cavdgj.fsf@gnu.org> <87poqyy2tc.fsf@metalevel.at> <87vb0qqrkz.fsf@russet.org.uk> <87h9c9zx75.fsf@metalevel.at> <834m89vmyv.fsf@gnu.org> <878txlsbdb.fsf@russet.org.uk> <87furtccdv.fsf@metalevel.at> <877fd5q9te.fsf@russet.org.uk> <83bn2gtruk.fsf@gnu.org> <87k2h37pvb.fsf@russet.org.uk> <87vb0lta67.fsf@russet.org.uk> <87d1mscw58.fsf@russet.org.uk> <87h9c3g70o.fsf@metalevel.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1467757217 6755 80.91.229.3 (5 Jul 2016 22:20:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2016 22:20:17 +0000 (UTC) Cc: 23871@debbugs.gnu.org, Markus Triska To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 06 00:19:59 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 1bKYhD-0003AX-Dj for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jul 2016 00:19:59 +0200 Original-Received: from localhost ([::1]:58350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYhC-0006na-R9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jul 2016 18:19:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYfO-0005oJ-3v for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKYfK-0003RD-1D for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYfJ-0003R8-Tp for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bKYfJ-0001SH-Jd for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:18:01 -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: Tue, 05 Jul 2016 22:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23871 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23871-submit@debbugs.gnu.org id=B23871.14677570675571 (code B ref 23871); Tue, 05 Jul 2016 22:18:01 +0000 Original-Received: (at 23871) by debbugs.gnu.org; 5 Jul 2016 22:17:47 +0000 Original-Received: from localhost ([127.0.0.1]:38679 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKYf4-0001Rn-U0 for submit@debbugs.gnu.org; Tue, 05 Jul 2016 18:17:47 -0400 Original-Received: from cloud103.planethippo.com ([31.216.48.48]:55556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKYf3-0001Ra-4k for 23871@debbugs.gnu.org; Tue, 05 Jul 2016 18:17:45 -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=IZuWQGRzaUP4dfPlc/XlvHNLx8PfzBsBwhwIkQmQHIY=; b=Cc1ijl2OzLPZ+fjvYcHiAT+nRg ezio1Frgjqz3loyGusDyV7qsmsmmGpfm8N7ZU6kLGQC/U/gG7WkND5AmFFzf0ybZxlGTKYKgNP1Wr GTh7QoYe343wT5njkGj0P8AT/dL5HCNVQBQ+HxdIjYrYsmc0B4a3cCcVk0ebbuPxutVe2dVP9GOv6 FL+mzEHlar9QzIM2muzA3vAjPwIByQxJNrxgx9uz1U/ApYnP8r+ywul+9F+0fef8AvPvs0NOsNoLS R8vi+n0f5hY0LY2iExernIg/7YNH7iPUoex+vpT5ajfwvGt67EcTI9OcWlLkyzCR6TfTwVJ+w0HFA 9CmF50Gg==; Original-Received: from cpc1-benw10-2-0-cust373.gate.cable.virginm.net ([77.98.219.118]:53275 helo=russet.org.uk) by cloud103.planethippo.com with esmtpsa (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.86_1) (envelope-from ) id 1bKYex-0023uE-49; Tue, 05 Jul 2016 23:17:39 +0100 In-Reply-To: (Stefan Monnier's message of "Tue, 05 Jul 2016 18:00:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (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:120470 Archived-At: Stefan Monnier writes: >> One issue I noticed with the current undo system is that it behaves >> differently if the command that inserts text is invoked via a keyboard >> shortcut instead of via M-x ... RET. > > This is probably because of the > > buffer_before_last_command_or_undo == current_buffer > > test, which is a naive/conservative test that just punts if there's > a buffer switch (in which case point_before_last_command_or_undo is > simply meaningless). And in this case there is, since the last command > was in another buffer (the last command was the RET you executed in the > minibuffer). It's going to be the buffer switch for sure, and yes, I'd guess it's this part. Bit surprised this is a regression though. This check is different from before, but the old system also used a global buffer which should have been affected by the minibuffer changes. > We could probably make it work by saving&restoring > buffer_before_last_command_or_undo and > point_before_last_command_or_undo around the minibuffer thingy. Or just not set buffer_before_last_command_or_undo to the minibuffer. > Or, making point_before_last_command_or_undo into a buffer-local > variable and get rid of buffer_before_last_command_or_undo. This seems the nicest to me. It should also cope with command completion frameworks for like helm which use buffers as well as the minibuffer. Phil