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, 28 Nov 2018 01:28:40 +0200 Organization: LINKOV.NET Message-ID: <87efb6ktzz.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <5BA490EA.4000502@gmx.at> <87y39m9f8b.fsf@mail.linkov.net> <5BF65D7F.2090805@gmx.at> <87h8g3ieex.fsf@mail.linkov.net> <5BFCFB7C.4030304@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543365870 16959 195.159.176.226 (28 Nov 2018 00:44:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Nov 2018 00:44:30 +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 Nov 28 01:44:25 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 1gRnxl-0004Dc-Pn for geb-bug-gnu-emacs@m.gmane.org; Wed, 28 Nov 2018 01:44:22 +0100 Original-Received: from localhost ([::1]:45259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRnzs-0003mg-5o for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2018 19:46:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRnzU-0003kp-S2 for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2018 19:46:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRnzP-00028N-R2 for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2018 19:46:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48392) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRnzP-00028J-NM for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2018 19:46:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gRnzP-0002oO-MD for bug-gnu-emacs@gnu.org; Tue, 27 Nov 2018 19:46:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Nov 2018 00:46:03 +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.154336593310693 (code B ref 32790); Wed, 28 Nov 2018 00:46:03 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 28 Nov 2018 00:45:33 +0000 Original-Received: from localhost ([127.0.0.1]:52636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRnyv-0002mO-DS for submit@debbugs.gnu.org; Tue, 27 Nov 2018 19:45:33 -0500 Original-Received: from ladybird.maple.relay.mailchannels.net ([23.83.214.98]:56879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gRnyr-0002lx-Su for 32790@debbugs.gnu.org; Tue, 27 Nov 2018 19:45:30 -0500 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 54FE0123F87; Wed, 28 Nov 2018 00:45:25 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a3.g.dreamhost.com (unknown [100.96.36.160]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9B7C3123CD7; Wed, 28 Nov 2018 00:45:24 +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); Wed, 28 Nov 2018 00:45:25 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Befitting-Wiry: 062b5166528625a0_1543365925029_663092923 X-MC-Loop-Signature: 1543365925009:1531646877 X-MC-Ingress-Time: 1543365925009 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 32E9780921; Tue, 27 Nov 2018 16:45:24 -0800 (PST) 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=IWta9+y2weIoDsGNGDGGqLTlSUY=; b= XdbHBnSXu5B6J8+uD14TOfrEUkNTOauk/zYEq/pcazXNzY0omOWTlgeeFb6CT4oZ ov93qG6dVzmuhakkCXfrVcSP/lPak27O3I9vkj6UNSCkU2CvGIx4I7JQobS6b+A9 92Vz5yYuXhWOhq6EWoX4E81UmDt8v57i4J/nh0c8VbE= Original-Received: from mail.jurta.org (m91-129-107-242.cust.tele2.ee [91.129.107.242]) (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 B88318091F; Tue, 27 Nov 2018 16:45:22 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a3 In-Reply-To: <5BFCFB7C.4030304@gmx.at> (martin rudalics's message of "Tue, 27 Nov 2018 09:08:28 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedruddvtddgvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdegvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgepud 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:152836 Archived-At: >> I realized now that maybe a new prefix arg could be useful to also >> kill the buffer that was displayed in the deleted window. Not sure, >> if better to do this using the arg KILL of quit-window, or call >> kill-buffer explicitly after deleting the window in the given direction. >> >> The prefix arg could be 'C-u C-u', e.g. 'C-u C-u C-x S-down' to delete >> the window below and kill the buffer that it displayed. > > I can't give you any suggestions here because I can't memorize such > combinations in the first place. There are commands that use triple C-u, so this sequence is not too long. I can't find a function that deletes the window together with killing its buffer ('quit-window' with the arg KILL kills the buffer, but doesn't always delete the window): diff --git a/lisp/windmove.el b/lisp/windmove.el index 6d61806a83..de3507d2d6 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -588,7 +588,9 @@ windmove-display-in-direction If prefix ARG is `C-u', reselect a previously selected window. If `windmove-display-no-select' is non-nil, this command doesn't select the window with a displayed buffer, and the meaning of -the prefix argument is reversed." +the prefix argument is reversed. +When `switch-to-buffer-obey-display-actions' is non-nil, +`switch-to-buffer' commands are also supported." (let* ((no-select (not (eq (consp arg) windmove-display-no-select))) ; xor (old-window (or (minibuffer-selected-window) (selected-window))) (new-window) @@ -684,6 +686,7 @@ windmove-delete-in-direction "Delete the window at direction DIR. If prefix ARG is `C-u', delete the selected window and select the window at direction DIR. +With two \\[universal-argument] prefixes, also kill the buffer in that window. When `windmove-wrap-around' is non-nil, takes the window from the opposite side of the frame." (let ((other-window (window-in-direction dir nil nil arg @@ -691,7 +694,9 @@ windmove-delete-in-direction (cond ((null other-window) (user-error "No window %s from selected window" dir)) (t - (if (not (consp arg)) + (when (equal arg '(16)) + (kill-buffer (window-buffer other-window))) + (if (not (equal arg '(4))) (delete-window other-window) (delete-window (selected-window)) (select-window other-window))))))