aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/xref.el29
1 files changed, 17 insertions, 12 deletions
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index e5e59721eb3..18e97bd0f64 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -828,20 +828,25 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
828(defun xref--read-identifier (prompt) 828(defun xref--read-identifier (prompt)
829 "Return the identifier at point or read it from the minibuffer." 829 "Return the identifier at point or read it from the minibuffer."
830 (let* ((backend (xref-find-backend)) 830 (let* ((backend (xref-find-backend))
831 (id (xref-backend-identifier-at-point backend))) 831 (def (xref-backend-identifier-at-point backend)))
832 (cond ((or current-prefix-arg 832 (cond ((or current-prefix-arg
833 (not id) 833 (not def)
834 (xref--prompt-p this-command)) 834 (xref--prompt-p this-command))
835 (completing-read (if id 835 (let ((id
836 (format "%s (default %s): " 836 (completing-read
837 (substring prompt 0 (string-match 837 (if def
838 "[ :]+\\'" prompt)) 838 (format "%s (default %s): "
839 id) 839 (substring prompt 0 (string-match
840 prompt) 840 "[ :]+\\'" prompt))
841 (xref-backend-identifier-completion-table backend) 841 def)
842 nil nil nil 842 prompt)
843 'xref--read-identifier-history id)) 843 (xref-backend-identifier-completion-table backend)
844 (t id)))) 844 nil nil nil
845 'xref--read-identifier-history def)))
846 (if (equal id "")
847 (or def (user-error "There is no defailt identifier"))
848 id)))
849 (t def))))
845 850
846 851
847;;; Commands 852;;; Commands