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: Sat, 27 Oct 2018 22:51:05 +0300 Organization: LINKOV.NET Message-ID: <87ftwrgwp2.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <87pnx1h1op.fsf@mail.linkov.net> <5BAB489E.5090002@gmx.at> <87h8ibvrs2.fsf@mail.linkov.net> <5BAD2507.6040605@gmx.at> <87a7nedidg.fsf@mail.linkov.net> <5BC5A558.9010401@gmx.at> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1540671564 23250 195.159.176.226 (27 Oct 2018 20:19:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2018 20:19:24 +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 Sat Oct 27 22:19:20 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 1gGV3H-0005ya-RA for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Oct 2018 22:19:20 +0200 Original-Received: from localhost ([::1]:37690 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGV5O-0007G7-79 for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Oct 2018 16:21:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGV50-00076s-Qz for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 16:21:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGV4w-0006Vw-LE for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 16:21:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGV4w-0006Vj-FQ for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 16:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGV4w-00007a-8u for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 16:21: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: Sat, 27 Oct 2018 20:21: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.1540671628376 (code B ref 32790); Sat, 27 Oct 2018 20:21:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 27 Oct 2018 20:20:28 +0000 Original-Received: from localhost ([127.0.0.1]:45783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGV4N-00005v-Ra for submit@debbugs.gnu.org; Sat, 27 Oct 2018 16:20:28 -0400 Original-Received: from chocolate.maple.relay.mailchannels.net ([23.83.214.35]:48707) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGV4J-00005g-Ec for 32790@debbugs.gnu.org; Sat, 27 Oct 2018 16:20:23 -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 AB2DD5E2D18; Sat, 27 Oct 2018 20:20:21 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.20.98]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 678595E2A78; Sat, 27 Oct 2018 20:20:21 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a3.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); Sat, 27 Oct 2018 20:20:21 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Gusty-Descriptive: 280e1d5472d19bed_1540671621552_3240520372 X-MC-Loop-Signature: 1540671621552:2441350540 X-MC-Ingress-Time: 1540671621551 Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a3.g.dreamhost.com (Postfix) with ESMTP id 30CFD7F694; Sat, 27 Oct 2018 13:20:21 -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=TNh5apoNP5e/C7rYDK4l2HU2zgM=; b= FOgYjD0f/4/YzKs51PNd/cMYS6apclT+seUlP3AUgHu9qFqS/0MD9BXrQG7C/TJd R3hMTfBoQ5n6RKaGVr55GB42+0E2TWOXW5RZMhgRf/ekl7yoO21zjI9lT2h+/wpQ gB7c1YaYhFHW2q4GGR1gZ+TfUnLp4OJ0uBE7+BXyJg0= Original-Received: from mail.jurta.org (m91-129-105-154.cust.tele2.ee [91.129.105.154]) (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-a3.g.dreamhost.com (Postfix) with ESMTPSA id EDE277F68D; Sat, 27 Oct 2018 13:20:19 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a3 In-Reply-To: <5BD2C52E.2060607@gmx.at> (martin rudalics's message of "Fri, 26 Oct 2018 09:41:34 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrheeggdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdehrdduheegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddthedrudehgedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd 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:151703 Archived-At: --=-=-= Content-Type: text/plain >> Please note that in the code posted 3 days ago I used the hook that you >> proposed recently window-state-change-functions, so this code is not yet >> functional :) > > Ahh.. That hook has not been written yet and I'm not sure whether I'll > be able to ever do that. In either case: The window state will not > change when a window gets just reused by 'display-buffer' and no > selection takes place. So can't you simply use 'post-command-hook' > for your purpose? The implementation of window-state-change-functions posted to bug#32672 uses post-command-hook. It makes possible display-buffer-directionally, e.g. S-M-up ffap RET will open a file link in the upper window, etc. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=display-buffer-directionally.2.el Content-Transfer-Encoding: quoted-printable (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 `((window alist) (when (and (eq window ,win) (not (eq (nth 1 (assq 'buffer alist)) (nth 2 (assq 'buffer alist))))) ;; When a new buffer was displayed in that window, ;; we can restore a previous value. (setq display-buffer-overriding-action ',display-buffer-overriding-action) (remove-hook 'window-state-change-functions ',hook))= )) (add-hook 'window-state-change-functions hook)) (setq display-buffer-overriding-action `((lambda (buffer alist) (window--display-buffer buffer ,win 'reuse alist)))))) (let ((modifiers '(shift meta))) (dolist (key '(left right up down ?0)) (define-key global-map (vector (append modifiers (list key))) 'display-buffer-directionally))) --=-=-=--