[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2f3b409: Introduce xref-prompt-for-identifier
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] master 2f3b409: Introduce xref-prompt-for-identifier |
Date: |
Sun, 26 Apr 2015 15:09:14 +0000 |
branch: master
commit 2f3b409a28241c88cdaca8778430121a736f7c77
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
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).
---
lisp/progmodes/xref.el | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 0257210..9f10686 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 2f3b409: Introduce xref-prompt-for-identifier,
Dmitry Gutov <=