From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#33870: 27.0.50; xref-goto-xref not configurable Date: Sun, 27 Jan 2019 22:29:43 +0200 Organization: LINKOV.NET Message-ID: <87munmosx4.fsf@mail.linkov.net> References: <87a7ktqqx7.fsf@mail.linkov.net> <9215183d-0a44-88b5-5b3c-d0da31f749ad@yandex.ru> <878t02egph.fsf@mail.linkov.net> <874lak9kr0.fsf@mail.linkov.net> <87zhscklhq.fsf@gmail.com> <87bm4qel4t.fsf@mail.linkov.net> <67c9abb5-f546-361f-04ca-da96ceaca4e2@yandex.ru> <87bm4le0tm.fsf@mail.linkov.net> <87imys6x5s.fsf@mail.linkov.net> <87d0osjtna.fsf@mail.linkov.net> <8ffaaddb-1d19-b9e9-83f1-83da89445eb8@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="149658"; mail-complaints-to="usenet@blaine.gmane.org" 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 27 21:43:18 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 esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gnrGu-000clA-Sm for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Jan 2019 21:43:17 +0100 Original-Received: from localhost ([127.0.0.1]:50237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnrGt-0005uv-QS for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Jan 2019 15:43:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gnrGi-0005tN-4X for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 15:43:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gnrGh-0004Zo-Bd for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 15:43:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gnrGh-0004Za-76 for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 15:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gnrGg-0000on-Tk for bug-gnu-emacs@gnu.org; Sun, 27 Jan 2019 15: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: Sun, 27 Jan 2019 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33870 X-GNU-PR-Package: emacs Original-Received: via spool by 33870-submit@debbugs.gnu.org id=B33870.15486217803130 (code B ref 33870); Sun, 27 Jan 2019 20:43:02 +0000 Original-Received: (at 33870) by debbugs.gnu.org; 27 Jan 2019 20:43:00 +0000 Original-Received: from localhost ([127.0.0.1]:48001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnrGe-0000oQ-3n for submit@debbugs.gnu.org; Sun, 27 Jan 2019 15:43:00 -0500 Original-Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:61024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gnrGc-0000oG-1s for 33870@debbugs.gnu.org; Sun, 27 Jan 2019 15:42:58 -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 2A8AA3E3404; Sun, 27 Jan 2019 20:42:55 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a41.g.dreamhost.com (unknown [100.96.11.179]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AC7693E39D7; Sun, 27 Jan 2019 20:42:54 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a41.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); Sun, 27 Jan 2019 20:42:55 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Minister-Arch: 7aae7974406ebd20_1548621774874_2134215054 X-MC-Loop-Signature: 1548621774874:1457952599 X-MC-Ingress-Time: 1548621774873 Original-Received: from pdx1-sub0-mail-a41.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a41.g.dreamhost.com (Postfix) with ESMTP id 596167FE05; Sun, 27 Jan 2019 12:42:54 -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=FQTKkfajhzBOV5n0d04WnRKLbw4=; b= rU2G4dvV1uJ5+qhBbSu035PdsVgs7KRxTsKDwnG/rdTYHBjdE4W1SQPH+GiVj3Lw YpFGp09UHLclU+U2EXdUeZnfCZrsE93IQPM/7sR3E2EowagZbZzfzvjBqVMJOdQ0 DgMqiHeicokw00U/1+43fnXtiduXtcp5JgPiRuuAZso= Original-Received: from mail.jurta.org (m91-129-101-91.cust.tele2.ee [91.129.101.91]) (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-a41.g.dreamhost.com (Postfix) with ESMTPSA id 8CDF47FDFB; Sun, 27 Jan 2019 12:42:52 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a41 In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sun, 20 Jan 2019 00:31:08 +0000") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtledrieekgddugedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutddurdeludenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutddurdeluddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehjohgrohhtrghvohhrrgesghhmrghilhdrtghomhenucevlhhushhtvghrufhiiigvpedt 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: 209.51.188.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:154828 Archived-At: --=-=-= Content-Type: text/plain >> If only that patch were able to keep the current behavior by default. > > Yep. If Juri provides a simpler patch that does this I'm all for it. Ok, here's 100% backward-compatible patch: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=xref.simplify.patch diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 87ce2299c5..9522d7e475 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -474,27 +474,17 @@ xref--show-pos-in-buf (or (eq xref--original-window-intent 'frame) pop-up-frames)) (action - (cond ((memq - xref--original-window-intent - '(window frame)) + (cond ((eq xref--original-window-intent 'frame) t) + ((eq xref--original-window-intent 'window) + '(display-buffer-same-window)) ((and (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))) --=-=-=--