From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#44611: Prefix arg for xref-goto-xref Date: Mon, 18 Jan 2021 03:17:40 +0200 Message-ID: <6511aade-1b6d-7a82-6848-3ccba43a794c@yandex.ru> 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> <87sg7ponct.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35618"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: joaotavora@gmail.com, 44611@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 18 02:18:20 2021 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 1l1JBT-0009Ai-SA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Jan 2021 02:18:19 +0100 Original-Received: from localhost ([::1]:59612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1JBS-00081o-Rd for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jan 2021 20:18:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1JBE-00080V-OC for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 20:18:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34369) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1JBC-0007WO-DA for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 20:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l1JBC-0004pj-7p for bug-gnu-emacs@gnu.org; Sun, 17 Jan 2021 20:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Jan 2021 01:18:02 +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.161093267218563 (code B ref 44611); Mon, 18 Jan 2021 01:18:02 +0000 Original-Received: (at 44611) by debbugs.gnu.org; 18 Jan 2021 01:17:52 +0000 Original-Received: from localhost ([127.0.0.1]:45915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1JB2-0004pK-7I for submit@debbugs.gnu.org; Sun, 17 Jan 2021 20:17:52 -0500 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:43065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1JAz-0004p8-Sq for 44611@debbugs.gnu.org; Sun, 17 Jan 2021 20:17:50 -0500 Original-Received: by mail-ej1-f44.google.com with SMTP id a10so4780068ejg.10 for <44611@debbugs.gnu.org>; Sun, 17 Jan 2021 17:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Owj9grP5aaOuFljOHNXKv6MeEtQNZETpBCmwZ4XGXUE=; b=i0n0GMNN0lzhhky+szd+3GPIHj5qhdaLV0p4zvy/J5lXsFvwlxkkVAT3eEn40k3aj2 an/1TzbElUJ8Atj4LrVReMWwVCvN51kIGXw0BrTsRGomm2vcJ2D/GxO+sXLwfdZpel9b DRKmUkXQ8Q7NEYscFRHOOgl6IcvW2p7qUjIgh7uOPHSy5szNVbez0d8CK7xTAinsb0XO VpB705mn/k1b7EvbuxNhGhVDwN+M5GTY4xmogYLqv5ZNsfYNMCeJIPueq/VlsRr/SxPG PSwfwrLt5Zh4cuVIYzDjP4b/l9GLaFF1TrbgHzZYNpro2oU5SK9pV2FBwZ3/R8PK9rCw uvbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Owj9grP5aaOuFljOHNXKv6MeEtQNZETpBCmwZ4XGXUE=; b=LanXlBNNZzkQibB01vtNdf6VZ36lHjCRZuRqfbrHo/r0OLLbfVdSZ4pIeYP9pBlO+w 05LZ2LxEbTLLE0zqWrRB3CVvAlNpf2qXssCey5lYsRG9/oQV+ksSoU78iok8tiYnev22 E4sbSqVw3U+QrqrAKVrviZCBDIzybYPqjpjbUQ7ouqNRfrSGg05KaBnfUQojlRnC6L15 U4zKkT0a0Gft7gp+eyoVFhyiGXTS/WyOMP7nMcfNt28td1KcCByhJxo08jVFrlyCzerk zJP+r1HeusgWp8LlpVRU0N+U49P2MOCkAHEdwcTf4mgCkhC5HUf3Q7XHAN3Ot0uhzbZD mk/Q== X-Gm-Message-State: AOAM530BidzFjWpOCIsMJfHjoiXMJPMhuAWfAtmHjJfbS/TIzLD35Gfk 4AUjQ+p86p8WZ/pVunpzhWx7V307eBw= X-Google-Smtp-Source: ABdhPJw+LLTsNwVliOXb6thJq9wqLR9irEg1ZAA2C/snoajlVsyFnG1d07ae1xOXgmxPjEOYqgMuhg== X-Received: by 2002:a17:906:a008:: with SMTP id p8mr15871248ejy.117.1610932663873; Sun, 17 Jan 2021 17:17:43 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id e19sm1964421eds.79.2021.01.17.17.17.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jan 2021 17:17:42 -0800 (PST) In-Reply-To: <87sg7ponct.fsf@mail.linkov.net> Content-Language: en-US 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:198068 Archived-At: On 28.12.2020 19:24, Juri Linkov wrote: >>>> 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). Sorry, missed this message previously. I don't have a strong opinion on this, but seems like it would conflate the "quit" action (what we want the command to do in this case) with the "delete" action (which what the binding might imply).