From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window Date: Fri, 02 Nov 2018 00:42:57 +0200 Organization: LINKOV.NET Message-ID: <87muqsh11q.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <877eiena58.fsf@mail.linkov.net> <5BC98A26.1030901@gmx.at> <87woqcnwas.fsf@mail.linkov.net> <5BCC3757.9020204@gmx.at> <87bm7njk2f.fsf@mail.linkov.net> <5BCD934D.4070906@gmx.at> <878t2owo8i.fsf@mail.linkov.net> <5BD03F4D.1000900@gmx.at> <87in1phhx2.fsf@mail.linkov.net> <5BD2C52E.2060607@gmx.at> <87ftwrgwp2.fsf@mail.linkov.net> <5BD57A8D.8080408@gmx.at> <875zxmx95h.fsf@mail.linkov.net> <5BD70F14.8080509@gmx.at> <87lg6g750v.fsf@mail.linkov.net> <5BD81D97.2000000@gmx.at> <87bm7bru1c.fsf@mail.linkov.net> <5BD963C8.9090905@gmx.at> <87h8h195ki.fsf@mail.linkov.net> <5BDAC159.1060008@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541112824 32079 195.159.176.226 (1 Nov 2018 22:53:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Nov 2018 22:53:44 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32790@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 01 23:53:40 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gILqN-0008E8-90 for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 23:53:39 +0100 Original-Received: from localhost ([::1]:47000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gILsT-00032D-Lp for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Nov 2018 18:55:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gILrX-00024p-Dn for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 18:54:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gILjy-0006iw-Px for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 18:47:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gILjy-0006il-L0 for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 18:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gILjy-0006T2-Hh for bug-gnu-emacs@gnu.org; Thu, 01 Nov 2018 18:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Nov 2018 22:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32790 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32790-submit@debbugs.gnu.org id=B32790.154111240224815 (code B ref 32790); Thu, 01 Nov 2018 22:47:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 1 Nov 2018 22:46:42 +0000 Original-Received: from localhost ([127.0.0.1]:59012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gILje-0006SA-Eb for submit@debbugs.gnu.org; Thu, 01 Nov 2018 18:46:42 -0400 Original-Received: from glass.birch.relay.mailchannels.net ([23.83.209.70]:33086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gILjb-0006Ry-Sm for 32790@debbugs.gnu.org; Thu, 01 Nov 2018 18:46:40 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 90619501D5B; Thu, 1 Nov 2018 22:46:38 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4E80E502965; Thu, 1 Nov 2018 22:46:38 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 01 Nov 2018 22:46:38 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Minister-Eyes: 2bbe1b262be9d479_1541112398415_3180785655 X-MC-Loop-Signature: 1541112398415:3409762107 X-MC-Ingress-Time: 1541112398415 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 1823D7F4DE; Thu, 1 Nov 2018 15:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=8/XQKV3bcQQjhzF1jh5KJUzzObA=; b= CdDKjkuGWsSrxThhT57G+qFK4drIESpHRdY/dxd8MDmV4tXXWReMwY4kcBXawECw iCQEMVwSq4ueR5OaaM+p5HGP5BMvWQrdp3lToBCXwg1Nn/k8aX+5d14+EAX4sr0a 8hJqTn6Y26Or1FOq67XnFjgibTMqeVA3K9OGZqePNZU= Original-Received: from mail.jurta.org (m91-129-101-157.cust.tele2.ee [91.129.101.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTPSA id D56047F4DB; Thu, 1 Nov 2018 15:46:35 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: <5BDAC159.1060008@gmx.at> (martin rudalics's message of "Thu, 01 Nov 2018 10:03:21 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrieeigdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtuddrudehjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutddurdduheejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedu 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:151924 Archived-At: >>> I forgot (or never learned) how to use it. Can you please include an >>> example so people can try it. >> >> An example is this: > [...] > > Yes. But when I now try your earlier example > > S-M-up M-x ffap RET RET > > with emacs -Q, after the S-M-up the *scratch* window is just split. > What am I missing? This is intended behavior - the window is split, so you can see the window where a new buffer will be displayed after you invoke the next command (e.g. 'ffap'). >> When display-buffer-directionally is called, it adds the hook >> to post-command-hook, and when display-buffer-directionally finishes, >> post-command-hook is called, and immediately removes itself from >> post-command-hook. This condition ensures that the hook is removed >> only when post-command-hook is called after a next command finishes >> (while the minibuffer is inactive). > > Can you give an example of a sequence of events how this should work > in practice and which scenario it is supposed to avoid? The term > "next command" is not clear to me here. An example of "next command" is 'ffap' in the earlier example. > And wouldn't it be more intuitive to check the minibuffer depth > instead? That is, let the lambda succeed to do its job iff the > current value of 'minibuffer-depth' equals the value of > 'minibuffer-depth' at the time 'display-buffer-overriding-action' was > set to the lambda. Yes, this will allow using S-M-up from the active minibuffer. >>>> (window--display-buffer buffer ,win 'reuse alist))))))) >>> >>> 'reuse' holds only for the ?0 case. When we split, the third argument >>> should be 'window'. >> >> I noticed that when replaced with >> >> (window--display-buffer buffer ,win ',(if (eq dir ?0) 'reuse 'window) alist) >> >> then 'window means that killing the buffer will delete its window. > > What's bad about that? What else do you want the window to show? If > the window got reused, it's natural to show the buffer it showed > previously. If the window was created anew, it's the most natural > thing to delete it when its buffer gets killed. If we want to change > that, we can add an option. But the way you do it, you completely > mess up the semantics of the 'quit-restore' mechanism by faking its > history. Yes, killing the buffer without deleting its window will display some random buffer in its place - this is bad. >> Another observation is that switch-to-buffer is unaffected by this command. > > As long as it does not end up calling 'display-buffer', yes. I'm not sure if switch-to-buffer should use pop-to-buffer-same-window, probably not.