From: Dmitry Gutov Date: Sun, 26 Apr 2015 15:08:56 +0000 (+0300) Subject: Introduce xref-prompt-for-identifier X-Git-Tag: emacs-25.0.90~2292 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2f3b409a28241c88cdaca8778430121a736f7c77;p=emacs.git Introduce xref-prompt-for-identifier * lisp/progmodes/xref.el (xref-prompt-for-identifier): New option. (xref--read-identifier): Use it (http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg01205.html). --- diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 0257210a6c7..9f1068668b1 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -276,6 +276,15 @@ backward." :type 'integer :version "25.1") +(defcustom xref-prompt-for-identifier nil + "When non-nil, always prompt for the identifier name. + +Otherwise, only prompt when there's no value at point we can use, +or when the command has been called with the prefix argument." + :type '(choice (const :tag "always" t) + (const :tag "auto" nil)) + :version "25.1") + (defvar xref--marker-ring (make-ring xref-marker-ring-length) "Ring of markers to implement the marker stack.") @@ -559,7 +568,7 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (defun xref--read-identifier (prompt) "Return the identifier at point or read it from the minibuffer." (let ((id (funcall xref-identifier-at-point-function))) - (cond ((or current-prefix-arg (not id)) + (cond ((or current-prefix-arg xref-prompt-for-identifier (not id)) (completing-read prompt (funcall xref-identifier-completion-table-function) nil t nil