From: Dmitry Gutov Date: Fri, 1 Jan 2021 13:18:41 +0000 (+0200) Subject: xref-show-definitions-completing-read: Default to the first location X-Git-Tag: emacs-28.0.90~4439 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a516e6986383b8fd0b840cd2e18ac3212bf2550d;p=emacs.git xref-show-definitions-completing-read: Default to the first location * lisp/progmodes/xref.el (xref-show-definitions-completing-read): Default to the first location. --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 04798de76fd..29e7b6849fd 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -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))))