Subject: bug#33870: 27.0.50; xref-goto-xref not configurable

From: Juri Linkov <[email-masked]>
Date: Sun, 06 Jan 2019 01:17:33 +0200

>> xref-quit-and-goto-xref has no good keybinding.  If you type TAB
>> in a web browser, do you expect it to close the current window
>> and open a link in a new window?
>
> I suggested TAB because in Emacs, tab completes stuff and closes
> *completions*. So it's not consistent with web browsers but is consistent
> with emacs, as usual.

Typing TAB in *Completions* moves point to the next completion,
so in xref this corresponds to xref-next-line, and Shift-TAB
moves to the previous completion that corresponds to xref-prev-line.

The closest analogue to "close and do it" in Emacs I see only
dired-find-alternate-file bound to ‘a’:

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 87ce2299c5..169f49a348 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -685,7 +674,9 @@ xref--xref-buffer-mode-map
     (define-key map (kbd "p") #'xref-prev-line)
     (define-key map (kbd "r") #'xref-query-replace-in-results)
     (define-key map (kbd "RET") #'xref-goto-xref)
-    (define-key map (kbd "TAB")  #'xref-quit-and-goto-xref)
+    (define-key map (kbd "TAB") #'xref-next-line)
+    (define-key map [backtab] #'xref-prev-line)
+    (define-key map (kbd "a") #'xref-quit-and-goto-xref)
     (define-key map (kbd "C-o") #'xref-show-location-at-point)
     ;; suggested by Johan Claesson "to further reduce finger movement":
     (define-key map (kbd ".") #'xref-next-line)