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: Tue, 30 Oct 2018 23:42:07 +0200 Organization: LINKOV.NET Message-ID: <87bm7bru1c.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <87zhvd7mg9.fsf@mail.linkov.net> <5BC6E52F.2070209@gmx.at> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540938486 20278 195.159.176.226 (30 Oct 2018 22:28:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 22:28:06 +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 Tue Oct 30 23:28:02 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 1gHcUT-00058S-Ql for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2018 23:28:02 +0100 Original-Received: from localhost ([::1]:55869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHcWZ-0002WW-VR for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Oct 2018 18:30:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHcVQ-0001wl-2R for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 18:29:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHcVK-0000oZ-9x for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 18:28:59 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHbxa-0002xG-84 for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 17:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gHbxZ-0000zK-U4 for bug-gnu-emacs@gnu.org; Tue, 30 Oct 2018 17:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Oct 2018 21:54:01 +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.15409364113758 (code B ref 32790); Tue, 30 Oct 2018 21:54:01 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 30 Oct 2018 21:53:31 +0000 Original-Received: from localhost ([127.0.0.1]:55974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHbx5-0000yY-EF for submit@debbugs.gnu.org; Tue, 30 Oct 2018 17:53:31 -0400 Original-Received: from glow.birch.relay.mailchannels.net ([23.83.209.71]:52782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHbx2-0000yM-0U for 32790@debbugs.gnu.org; Tue, 30 Oct 2018 17:53:29 -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 8459C5C3D60; Tue, 30 Oct 2018 21:53:26 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a74.g.dreamhost.com (unknown [100.96.33.121]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B91CB5C3EFA; Tue, 30 Oct 2018 21:53:24 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a74.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); Tue, 30 Oct 2018 21:53:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Squirrel-Power: 693a2aee015d0d36_1540936404980_3742752086 X-MC-Loop-Signature: 1540936404979:2201527062 X-MC-Ingress-Time: 1540936404979 Original-Received: from pdx1-sub0-mail-a74.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a74.g.dreamhost.com (Postfix) with ESMTP id 284FF80AD7; Tue, 30 Oct 2018 14:53:23 -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=8nTTtmMW/yFLSNfBmL0l06xUiVQ=; b= fyWXa4R1nPdyxAAwfeC3TBRXREVNT1ewNyqX2URBJYdOtcqKJjl2W4AfG6i3HpUg sNUbYM43Bu815qsmfUrk/yDih5opRjx4PTnfc7Badb28NnjTWF7KyfZ5afNPv7K6 OI2LzosuNvLVCxZIDDo8gXYYRoqKHwP8BY7uxTb9Q4k= 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-a74.g.dreamhost.com (Postfix) with ESMTPSA id B14227F273; Tue, 30 Oct 2018 14:53:21 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a74 In-Reply-To: <5BD81D97.2000000@gmx.at> (martin rudalics's message of "Tue, 30 Oct 2018 10:00:07 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedriedtgdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutddurdduheejnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtuddrudehjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgepvd 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:151847 Archived-At: >>> Moreover, using 'post-command-hook' would automatically fix any >>> problems when quitting an S-M-up action. I see no way to catch >>> quitting via a state change of windows. >> >> What do you mean by quitting an S-M-up action? minibuffer-exit? > > Let's say anything C-g does. I'm not sure whether we can catch that > always via 'minibuffer-exit-hook' though. But it should not harm to > remove the overriding action in that case as well. Ok, after a small change it handles also C-g: (defun display-buffer-directionally () "Specify in which direction the buffer should be displayed. Arrows show the direction. Mod-0 forces to display in the same window." (interactive) (let* ((dir (event-basic-type (aref (this-command-keys) 0))) (win (if (eq dir ?0) (selected-window) (or (window-in-direction dir) (split-window nil nil dir))))) (let ((hook (list 'lambda))) (setcdr hook `(() (unless (or ;; Remove the hook immediately ;; after exiting the minibuffer. (> (minibuffer-depth) 0) ;; But don't remove immediately after ;; adding the hook by the same command. (eq this-command ',this-command)) (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)))))))