emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 344eea4: xref.el: Keep Emacs 26 compatibility


From: Dmitry Gutov
Subject: master 344eea4: xref.el: Keep Emacs 26 compatibility
Date: Wed, 24 Mar 2021 06:39:40 -0400 (EDT)

branch: master
commit 344eea4113f8eb3e78cd201a90cc968a8c3658f5
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    xref.el: Keep Emacs 26 compatibility
    
    * lisp/progmodes/xref.el (xref--read-identifier)
    (xref-find-definitions, xref-find-definitions-other-window)
    (xref-find-definitions-other-frame, xref-find-references):
    Undo the latest change for Emacs 26 compatibility (bug#47286).
---
 lisp/progmodes/xref.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3cb4247..ea52bef 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1192,7 +1192,12 @@ definitions."
                (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)))
@@ -1252,19 +1257,19 @@ If sufficient information is available to determine a 
unique
 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
@@ -1275,7 +1280,7 @@ offering the symbol at point as the default.
 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]