Subject: bug#44611: Prefix arg for xref-goto-xref

From: Juri Linkov <[email-masked]>
Date: Sun, 27 Dec 2020 18:20:01 +0200

> Do you think that what "big corporations" do is okay?  If you do, then
> I understand why you consider it OK for us to do something similar.
> But if you don't, then why do you suggest that we follow bad examples?

No, this is not the reason to do something similar.  I already
explained the reason below, i.e.: "Unlike the above examples,
in Emacs everything is configurable, so you can easily
add to the init file".

> I don't think frequent changes in the UI and the defaults are a Good
> Thing.  Each time I upgrade some software which comes from those big
> corporations, I have to waste some significant time to get many of my
> previous defaults back, disable or reconfigure annoying new features
> etc.  Moreover, no matter how conservative we are in Emacs with
> breaking backward compatibility, we are still being occasionally
> accused of not being conservative enough.  So evidently, veteran users
> don't like such changes to happen too frequently.  Looking at NEWS for
> past releases, I conclude that we indeed didn't make such changes.

The notion "conservative" is irrelevant here, because TAB was bound in xref
recently, this discussion is not about changing some long-established bindings.

>> Unlike the above examples,
>> in Emacs everything is configurable, so you can easily add to the init file:
>>
>>   (define-key xref--xref-buffer-mode-map (kbd "TAB") #'xref-quit-and-goto-xref)
>
> This works both ways: if you want TAB to do something other than its
> default, you can rebind it for you, right?

This is not about my personal preferences.  For example, my preference
is not to add tab-line-tab-face-special to tab-line-tab-face-functions,
but since everyone wants it, I had to install it as the default value.

>> But having no command bound to TAB is a lose-lose situation because
>> users of grep-like xref commands will have less compatible keys.
>
> I didn't suggest unbinding TAB, I suggested to leave its current
> binding as it was in Emacs 27 and older.

This would be the worst thing to do.  For Emacs 28 we are working
to provide grep-like experience in the xref output, but not adding
a key binding compatible with grep mode would harm our efforts.

>> > And why C-j?  That's LFD, a key more suitable for acting on something
>> > at point, not quitting the buffer.
>>
>> The initial xref UI was closer to completion UI, so C-j makes it consistent
>> with icomplete mode for users who still perceive xref as completion UI.
>
> That contradicts what Dmitry said: that the current Xref UI moves away
> of the completion UI, and towards compilation-mode and grep-mode.
> There, deleting the window with C-j will look odd, I think.

There are two modes: xref-show-xrefs and xref-show-defs.
xref-show-xrefs is similar to grep, whereas xref-show-defs
resembles the Completion UI where C-j makes sense.

>> > Why not 'q' (for "quit") or 'b' (for "bury")?
>>
>> 'xref-quit-and-goto-xref' also jumps to xref, not only quits,
>> but 'q' and 'b' should only quit.
>
> That's not a catastrophe, but if you want, we could use "C-c C-c"
> instead, as that is used in some other modes for similar effect.

I think this is a good idea for completion-like xref-show-defs,
but not for grep-like xref-show-xrefs because in grep-mode
'C-c C-c' is bound to compile-goto-error that doesn't quit window.