xref-show-definitions-completing-read: Default to the first location

* lisp/progmodes/xref.el (xref-show-definitions-completing-read):
Default to the first location.
This commit is contained in:
Dmitry Gutov 2021-01-01 15:18:41 +02:00
parent 3ea7cec4c0
commit a516e69863

View file

@ -1057,9 +1057,12 @@ between them by typing in the minibuffer with completion."
((eq action 'metadata)
'(metadata . ((category . xref-location))))
(t
(complete-with-action action collection string pred))))))
(complete-with-action action collection string pred)))))
(def (caar collection)))
(cdr (assoc (completing-read "Choose definition: "
ctable nil t)
ctable nil t
nil nil
def)
collection)))))
(xref-pop-to-location xref (assoc-default 'display-action alist))))