(xref--prompt-p this-command))
(let ((id
(completing-read
- (format-prompt prompt def)
+ (if def
+ (format "%s (default %s): "
+ (substring prompt 0 (string-match
+ "[ :]+\\'" prompt))
+ def)
+ prompt)
(xref-backend-identifier-completion-table backend)
nil nil nil
'xref--read-identifier-history def)))
definition for IDENTIFIER, display it in the selected window.
Otherwise, display the list of the possible definitions in a
buffer where the user can select from the list."
- (interactive (list (xref--read-identifier "Find definitions of")))
+ (interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier nil))
;;;###autoload
(defun xref-find-definitions-other-window (identifier)
"Like `xref-find-definitions' but switch to the other window."
- (interactive (list (xref--read-identifier "Find definitions of")))
+ (interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier 'window))
;;;###autoload
(defun xref-find-definitions-other-frame (identifier)
"Like `xref-find-definitions' but switch to the other frame."
- (interactive (list (xref--read-identifier "Find definitions of")))
+ (interactive (list (xref--read-identifier "Find definitions of: ")))
(xref--find-definitions identifier 'frame))
;;;###autoload
With prefix argument, or if `xref-prompt-for-identifier' is t,
always prompt for the identifier. If `xref-prompt-for-identifier'
is nil, prompt only if there's no usable symbol at point."
- (interactive (list (xref--read-identifier "Find references of")))
+ (interactive (list (xref--read-identifier "Find references of: ")))
(xref--find-xrefs identifier 'references identifier nil))
;;;###autoload