From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#44611: Prefix arg for xref-goto-xref Date: Mon, 28 Dec 2020 19:24:18 +0200 Organization: LINKOV.NET Message-ID: <87sg7ponct.fsf@mail.linkov.net> References: <87k0up68e4.fsf@mail.linkov.net> <83v9cwsct7.fsf@gnu.org> <87k0tab3y0.fsf@mail.linkov.net> <83pn31rg5a.fsf@gnu.org> <877dp9ycq6.fsf@mail.linkov.net> <837dp8r250.fsf@gnu.org> <4a0c8870-e2e7-97c7-5808-afa704ebee13@yandex.ru> <83mty4pj0u.fsf@gnu.org> <1d9bf365-224f-bb41-d79c-e22d110b41e3@yandex.ru> <83eejgpbs8.fsf@gnu.org> <9fa9d286-4497-baa9-15cd-1ef31651781f@yandex.ru> <83a6u4p8nz.fsf@gnu.org> <3c740ee3-cc1c-e2e3-d540-7be0b37d91ef@yandex.ru> <83pn2znloa.fsf@gnu.org> <87pn2zlzy3.fsf@mail.linkov.net> <83k0t7ndbs.fsf@gnu.org> <87wnx6z1gs.fsf@mail.linkov.net> <83a6u2nm8o.fsf@gnu.org> <87eejbbfm9.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26665"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: joaotavora@gmail.com, 44611@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 28 18:26:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ktwHb-0006mz-9R for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 18:26:11 +0100 Original-Received: from localhost ([::1]:56614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktwHa-0008Ae-7X for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 12:26:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktwHS-000897-6s for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:26:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktwHR-0000GN-TE for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:26:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktwHR-0005JI-Q1 for bug-gnu-emacs@gnu.org; Mon, 28 Dec 2020 12:26: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: Mon, 28 Dec 2020 17:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 44611-submit@debbugs.gnu.org id=B44611.160917630920350 (code B ref 44611); Mon, 28 Dec 2020 17:26:01 +0000 Original-Received: (at 44611) by debbugs.gnu.org; 28 Dec 2020 17:25:09 +0000 Original-Received: from localhost ([127.0.0.1]:36739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktwGb-0005IA-Kb for submit@debbugs.gnu.org; Mon, 28 Dec 2020 12:25:09 -0500 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:54809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktwGY-0005HB-JU for 44611@debbugs.gnu.org; Mon, 28 Dec 2020 12:25:08 -0500 X-Originating-IP: 91.129.99.98 Original-Received: from mail.gandi.net (m91-129-99-98.cust.tele2.ee [91.129.99.98]) (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 040B1E0003; Mon, 28 Dec 2020 17:24:58 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Sun, 27 Dec 2020 20:53:14 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196880 Archived-At: >>> On the subject of grep-mode, it could have a similar command introduced >>> too, for situations when you only needed to find one occurrence, to jump to >>> it and quit the window. >> This is what I already successfully use: >> diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el >> index d2293151c7..08c44dcb25 100644 >> --- a/lisp/progmodes/compile.el >> +++ b/lisp/progmodes/compile.el >> @@ -2572,11 +2572,15 @@ compile-goto-error >> (or (compilation-buffer-p (current-buffer)) >> (error "Not in a compilation buffer")) >> (compilation--ensure-parse (point)) >> + (let ((window (posn-window (event-end event)))) >> (if (get-text-property (point) 'compilation-directory) >> (dired-other-window >> (car (get-text-property (point) 'compilation-directory))) >> (setq compilation-current-error (point)) >> - (next-error-internal))) >> + (next-error-internal)) >> + (when current-prefix-arg >> + (with-selected-window window >> + (quit-window))))) > > So... if others like it, we could keep just this binding (C-u RET) for > "quit the window and go to location", in both Grep and Xref. To make it more future-proof for possible other uses of the prefix arg, maybe better would be to use 'C-0 RET' with better mnemonics of 0 to mean deleting the window (like 'C-x 0' deletes the window).