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: Wed, 31 Oct 2018 23:20:13 +0200 Organization: LINKOV.NET Message-ID: <87h8h195ki.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <87woqgw9a7.fsf@mail.linkov.net> <5BC83EC9.1090808@gmx.at> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541021715 30768 195.159.176.226 (31 Oct 2018 21:35:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2018 21:35:15 +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 Wed Oct 31 22:35:11 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 1gHy8s-0007s7-QK for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2018 22:35:11 +0100 Original-Received: from localhost ([::1]:33606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHyAy-0003pZ-Ks for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2018 17:37:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHyAl-0003nm-SD for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2018 17:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHyAh-0008IE-9W for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2018 17:37:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHyAh-0008I7-4z for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2018 17:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gHyAh-0007TO-1Y for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2018 17:37:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Oct 2018 21:37: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.154102179728660 (code B ref 32790); Wed, 31 Oct 2018 21:37:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 31 Oct 2018 21:36:37 +0000 Original-Received: from localhost ([127.0.0.1]:57509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHyAG-0007SB-NC for submit@debbugs.gnu.org; Wed, 31 Oct 2018 17:36:36 -0400 Original-Received: from coral.maple.relay.mailchannels.net ([23.83.214.39]:10014) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHyAB-0007Rs-W2 for 32790@debbugs.gnu.org; Wed, 31 Oct 2018 17:36:32 -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 3F0155C38A5; Wed, 31 Oct 2018 21:36:30 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a37.g.dreamhost.com (unknown [100.96.33.121]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EB2945C3EE2; Wed, 31 Oct 2018 21:36:29 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a37.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); Wed, 31 Oct 2018 21:36:30 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Belong-Left: 03292a301638cd9d_1541021790097_2739480210 X-MC-Loop-Signature: 1541021790097:1618976781 X-MC-Ingress-Time: 1541021790096 Original-Received: from pdx1-sub0-mail-a37.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a37.g.dreamhost.com (Postfix) with ESMTP id 9E81B7FE57; Wed, 31 Oct 2018 14:36:29 -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=r+3BqYkSJs3iqBu5+1r4tTHDKa8=; b= 1WLJrvhmRr5nkpsMwkc9OV84XVPrmHE+8OEC7dv/WnymnJZ+OcRoIXTDDVSOBcm0 MzUuWYUli7NnhCIXuU0hCBXTNtN2erQ0clei65IrEgTGaIIUyMvevcW/rGI0wco7 W78JsMksxZU1eleoqg/KJnYCiS6Ex4pepeFFGD00pNA= 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-a37.g.dreamhost.com (Postfix) with ESMTPSA id 5A8427FE49; Wed, 31 Oct 2018 14:36:27 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a37 In-Reply-To: <5BD963C8.9090905@gmx.at> (martin rudalics's message of "Wed, 31 Oct 2018 09:11:52 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutddurdduheejnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtuddrudehjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd 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:151869 Archived-At: >> Ok, after a small change it handles also C-g: > > I forgot (or never learned) how to use it. Can you please include an > example so people can try it. An example is this: (let ((modifiers '(shift meta))) (dolist (key '(left right up down ?0)) (define-key global-map (vector (append modifiers (list key))) 'display-buffer-directionally))) >> ;; But don't remove immediately after >> ;; adding the hook by the same command. >> (eq this-command ',this-command)) > > Can you give the rationale for the latter? I don't grok it. 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). >> (setq display-buffer-overriding-action >> ',display-buffer-overriding-action) >> (remove-hook 'post-command-hook ',hook)))) >> (add-hook 'post-command-hook hook)) >> (setq display-buffer-overriding-action >> `((lambda (buffer alist) >> (unless (> (minibuffer-depth) 0) >> (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. Another observation is that switch-to-buffer is unaffected by this command.