GNU bug report logs - #44611
Prefix arg for xref-goto-xref

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 13 Nov 2020 08:33:01 UTC

Severity: normal

Tags: fixed

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: joaotavora <at> gmail.com, 44611 <at> debbugs.gnu.org
Subject: bug#44611: Prefix arg for xref-goto-xref
Date: Mon, 18 Jan 2021 03:17:40 +0200
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).




This bug report was last modified 4 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.