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: Thu, 08 Nov 2018 23:38:08 +0200 Organization: LINKOV.NET Message-ID: <87lg63ntbz.fsf@mail.linkov.net> References: <87efdnsp2k.fsf@mail.linkov.net> <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> <87muqsh11q.fsf@mail.linkov.net> <5BDC0E81.1050806@gmx.at> <87tvkwh4bp.fsf@mail.linkov.net> <5BE00F12.5000703@gmx.at> <87d0rjuq8c.fsf@mail.linkov.net> <5BE15552.4040507@gmx.at> <87y3a5rgm2.fsf@mail.linkov.net> <5BE2AF28.2020505@gmx.at> <877ehowp0c.fsf@mail.linkov.net> <5BE3F967.8080809@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1541713271 30544 195.159.176.226 (8 Nov 2018 21:41:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2018 21:41:11 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 32790@debbugs.gnu.org, Dmitry Gutov To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 08 22:41:07 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 1gKs31-0007pC-4o for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2018 22:41:07 +0100 Original-Received: from localhost ([::1]:59100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKs57-0000Qr-Gm for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Nov 2018 16:43:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gKs4z-0000GV-1T for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 16:43:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gKs4t-00018p-GW for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 16:43:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37681) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gKs4s-000185-Gq for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 16:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gKs4s-0000ub-Aw for bug-gnu-emacs@gnu.org; Thu, 08 Nov 2018 16:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Nov 2018 21:43: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.15417133713481 (code B ref 32790); Thu, 08 Nov 2018 21:43:02 +0000 Original-Received: (at 32790) by debbugs.gnu.org; 8 Nov 2018 21:42:51 +0000 Original-Received: from localhost ([127.0.0.1]:41939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKs4f-0000u4-VL for submit@debbugs.gnu.org; Thu, 08 Nov 2018 16:42:51 -0500 Original-Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:30029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKs4d-0000tu-8a for 32790@debbugs.gnu.org; Thu, 08 Nov 2018 16:42:47 -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 E63CF5C26D7; Thu, 8 Nov 2018 21:42:44 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a66.g.dreamhost.com (unknown [100.96.19.74]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A046A5C3E14; Thu, 8 Nov 2018 21:42:44 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a66.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, 08 Nov 2018 21:42:44 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Gusty-Thoughtful: 70dbb6cf4cb50611_1541713364763_1003297233 X-MC-Loop-Signature: 1541713364763:3135011908 X-MC-Ingress-Time: 1541713364763 Original-Received: from pdx1-sub0-mail-a66.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTP id 62BE5806DD; Thu, 8 Nov 2018 13:42:44 -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:content-transfer-encoding; s=linkov.net; bh=iS1Chp DMywsXBKSPGymZHWJBSug=; b=aP1YHqEmue2UqlOWzl0hEbLy8pIpxfr+6SlXd2 x/bP6qdH9k9zNTlRt9jaASUEBDBNEbHLbLJQP1tl3YS2nzHqoMhCXNw8K56+48QO 4jG2NoMKYfr96w+mqFjhSLokTBd0z3GUGiJS1exN8C916V5DuXj6jChC4D2D9/z9 k9ybU= Original-Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (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-a66.g.dreamhost.com (Postfix) with ESMTPSA id A5A8880695; Thu, 8 Nov 2018 13:42:40 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a66 In-Reply-To: <5BE3F967.8080809@gmx.at> (martin rudalics's message of "Thu, 08 Nov 2018 09:52:55 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrkedugdduheegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrvdeggeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddvgeegpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtoheprhhuuggrlhhitghssehgmhigrdgrthenucevlhhushhtvghrufhiiigvpedt 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:152177 Archived-At: >> Shouldn't xref support a shorter and easier to type key sequence >> =E2=80=98S-M- M-.=E2=80=99 with the following patch: >> >> diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el >> index 6b1421a6f7..6aab174bcf 100644 >> --- a/lisp/progmodes/xref.el >> +++ b/lisp/progmodes/xref.el >> @@ -425,7 +425,7 @@ xref--pop-to-location >> (xref-location-marker (xref-item-location item)))= ) >> (buf (marker-buffer marker))) >> (cl-ecase action >> - ((nil) (switch-to-buffer buf)) >> + ((nil) (pop-to-buffer-same-window buf)) >> (window (pop-to-buffer buf t)) >> (frame (let ((pop-up-frames t)) (pop-to-buffer buf t)))) >> (xref--goto-char marker)) > > I think so. In particular because 'xref--goto-char' does not cohabit > well with 'switch-to-buffer-preserve-window-point' in the first place. > Dmitry should consent, though. Dmitry, do you agree this is a change for the better? >> Then maybe all unused code should be removed including >> windmove-other-window-loc, windmove-reference-loc, >> windmove-wrap-loc-for-movement, windmove-constrain-loc-for-movement, >> etc. > > Citing from a discussion with Dmitry: > > > I thought you might go ahead and just port windmove to use > > `window-in-direction'. > > windmove has an extra ARG to distinguish the upper left corner of a > window and its position of point as reference points. I can't easily > dismiss that. > > I'm not sure whether it's still relevant but if so we'd have to include > it in 'window-in-direction'. I see that an extra ARG when =E2=80=98C-u=E2=80=99 is not interpreted as = a positive arg, and =E2=80=98M--=E2=80=99 is not interpreted as a negative arg. So I pro= pose to support these prefix keys as well: diff --git a/lisp/windmove.el b/lisp/windmove.el index 598e495c7a..ea4506049b 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -512,7 +512,7 @@ windmove-left If no window is at the desired location, an error is signaled unless `windmove-create-window' is non-nil that creates a new window." (interactive "P") - (windmove-do-window-select 'left arg)) + (windmove-do-window-select 'left (and arg (prefix-numeric-value arg)))= ) =20 ;;;###autoload (defun windmove-up (&optional arg) @@ -524,7 +524,7 @@ windmove-up If no window is at the desired location, an error is signaled unless `windmove-create-window' is non-nil that creates a new window." (interactive "P") - (windmove-do-window-select 'up arg)) + (windmove-do-window-select 'up (and arg (prefix-numeric-value arg)))) =20 ;;;###autoload (defun windmove-right (&optional arg) @@ -536,7 +536,7 @@ windmove-right If no window is at the desired location, an error is signaled unless `windmove-create-window' is non-nil that creates a new window." (interactive "P") - (windmove-do-window-select 'right arg)) + (windmove-do-window-select 'right (and arg (prefix-numeric-value arg))= )) =20 ;;;###autoload (defun windmove-down (&optional arg) @@ -548,7 +548,7 @@ windmove-down If no window is at the desired location, an error is signaled unless `windmove-create-window' is non-nil that creates a new window." (interactive "P") - (windmove-do-window-select 'down arg)) + (windmove-do-window-select 'down (and arg (prefix-numeric-value arg)))= ) =20 =20 ;;; set up keybindings