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#23871: 25.1.50; Undo unexpectedly leads to blank buffer Date: Tue, 05 Jul 2016 18:00:26 -0400 Message-ID: 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 1467756088 20362 80.91.229.3 (5 Jul 2016 22:01:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Jul 2016 22:01:28 +0000 (UTC) Cc: 23871@debbugs.gnu.org, Phillip Lord To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 06 00:01:15 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 1bKYP3-0000bx-FZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jul 2016 00:01:13 +0200 Original-Received: from localhost ([::1]:58304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYP2-0004gA-OJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 05 Jul 2016 18:01:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYOw-0004e0-Sx for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:01:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKYOs-00069Z-QZ for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:01:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKYOs-00069R-NL for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bKYOs-00013b-HP for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2016 18:01: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, 05 Jul 2016 22:01:02 +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.14677560364024 (code B ref 23871); Tue, 05 Jul 2016 22:01:02 +0000 Original-Received: (at 23871) by debbugs.gnu.org; 5 Jul 2016 22:00:36 +0000 Original-Received: from localhost ([127.0.0.1]:38663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKYOR-00012p-Sr for submit@debbugs.gnu.org; Tue, 05 Jul 2016 18:00:36 -0400 Original-Received: from smtp-as-01-06.vtxnet.net ([194.38.175.135]:49935 helo=smtp-as-01.vtxnet.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKYOQ-00012f-E0 for 23871@debbugs.gnu.org; Tue, 05 Jul 2016 18:00:35 -0400 Original-Received: from smtp-as-01.vtxnet.net (smtp-as-01-04.vtxnet.net [194.38.175.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-as-01.vtxnet.net (Postfix) with ESMTPS id D0F7C43F68; Wed, 6 Jul 2016 00:00:32 +0200 (CEST) Original-Received: from smtp-pri-01.vtxnet.net (smtp-pri-01.vtxnet.net [212.147.62.135]) by smtp-as-01.vtxnet.net (Postfix) with ESMTP id D392C43F41; Wed, 6 Jul 2016 00:00:29 +0200 (CEST) Original-Received: from fmsmemgm.homelinux.net (dyn.144-85-234-142.dsl.vtx.ch [144.85.234.142]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-pri-01.vtxnet.net (VTX Services SA) with ESMTP id C2387CFCEC; Wed, 6 Jul 2016 00:00:29 +0200 (CEST) Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id CC290AE0BC; Tue, 5 Jul 2016 18:00:26 -0400 (EDT) In-Reply-To: <87h9c3g70o.fsf@metalevel.at> (Markus Triska's message of "Tue, 05 Jul 2016 22:32:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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:120467 Archived-At: > 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). 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, making point_before_last_command_or_undo into a buffer-local variable and get rid of buffer_before_last_command_or_undo. Stefan