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#33870: 27.0.50; xref-goto-xref not configurable Date: Sun, 06 Jan 2019 01:27:11 +0200 Organization: LINKOV.NET Message-ID: <87imz28z3k.fsf@mail.linkov.net> References: <87a7ktqqx7.fsf@mail.linkov.net> <9215183d-0a44-88b5-5b3c-d0da31f749ad@yandex.ru> <878t02egph.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1546731132 18835 195.159.176.226 (5 Jan 2019 23:32:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2019 23:32:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 33870@debbugs.gnu.org, Dmitry Gutov To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 06 00:32:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvQD-0004kk-M3 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jan 2019 00:32:05 +0100 Original-Received: from localhost ([127.0.0.1]:49304 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvSK-0004u4-IS for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Jan 2019 18:34:16 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:33149 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfvSA-0004tn-Dv for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:34:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfvS6-0005TO-5W for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:34:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gfvS6-0005Sy-0e for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:34:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gfvS5-0005oU-SV for bug-gnu-emacs@gnu.org; Sat, 05 Jan 2019 18:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jan 2019 23:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33870-submit@debbugs.gnu.org id=B33870.154673118522277 (code B ref 33870); Sat, 05 Jan 2019 23:34:01 +0000 Original-Received: (at 33870) by debbugs.gnu.org; 5 Jan 2019 23:33:05 +0000 Original-Received: from localhost ([127.0.0.1]:48131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvRA-0005nF-Ta for submit@debbugs.gnu.org; Sat, 05 Jan 2019 18:33:05 -0500 Original-Received: from bisque.maple.relay.mailchannels.net ([23.83.214.18]:56675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfvR9-0005mx-By for 33870@debbugs.gnu.org; Sat, 05 Jan 2019 18:33:03 -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 346A63E3565; Sat, 5 Jan 2019 23:33:02 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id BDD253E337B; Sat, 5 Jan 2019 23:33:01 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.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, 05 Jan 2019 23:33:02 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Abiding-Harmony: 3b28900f6e3f4ead_1546731182035_3161914939 X-MC-Loop-Signature: 1546731182035:246789197 X-MC-Ingress-Time: 1546731182035 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 6596F811B1; Sat, 5 Jan 2019 15:33:01 -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=RokNvB/N7var+fMM7DQd01lm2LI=; b= 2APqD2eBIhxYfQNyOF/q+G/MTcf71+dvURfCjGfBwCoC4BhfCeyz6QyqR6Q7cSLf xTsNsntEo2Xdztap45nr3TKr7IOZgp/EQLiSnI1y2FPXZWMshDD7ZNr6oOI1RgYX ydjn2Pri1UVeB5oMJPuek0kP71JR3iv8VCC3SqitdZc= Original-Received: from mail.jurta.org (m91-129-109-141.cust.tele2.ee [91.129.109.141]) (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-a35.g.dreamhost.com (Postfix) with ESMTPSA id 34ED17F4DE; Sat, 5 Jan 2019 15:32:49 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: <878t02egph.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 03 Jan 2019 02:18:50 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrvdeggdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtledrudegudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdelrddugedupdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepjhhorghothgrvhhorhgrsehgmhgrihhlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd 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:154176 Archived-At: --=-=-= Content-Type: text/plain Here's a better patch that relies on display-buffer-in-previous-window: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=xref-previous-window.patch diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 87ce2299c5..169f49a348 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -482,19 +482,9 @@ xref--show-pos-in-buf (window-live-p xref--original-window) (or (not (window-dedicated-p xref--original-window)) (eq (window-buffer xref--original-window) buf))) - `(,(lambda (buf _alist) - (set-window-buffer xref--original-window buf) - xref--original-window)))))) - (with-selected-window - (with-selected-window - ;; Just before `display-buffer', place ourselves in the - ;; original window to suggest preserving it. Of course, if - ;; user has deleted the original window, all bets are off, - ;; just use the selected one. - (or (and (window-live-p xref--original-window) - xref--original-window) - (selected-window)) - (display-buffer buf action)) + `((display-buffer-in-previous-window) + (previous-window . ,xref--original-window)))))) + (with-selected-window (display-buffer buf action) (xref--goto-char pos) (run-hooks 'xref-after-jump-hook) (let ((buf (current-buffer))) --=-=-=--