bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23179: 25.0.92; Restore `M-,' to continue etags search


From: Eli Zaretskii
Subject: bug#23179: 25.0.92; Restore `M-,' to continue etags search
Date: Mon, 04 Apr 2016 18:49:38 +0300

> Date: Mon, 4 Apr 2016 06:22:28 +0200
> From: Anders Lindgren <andlind@gmail.com>
> Cc: Brief Busters <dgutov@yandex.ru>, 23179@debbugs.gnu.org
> 
>  Sorry, I don't understand: how is this different from *Help* or 
> *Completions*?
> 
> *Completions* go away once it's not needed anymore and *Help* is something 
> that I explicitly as for, so I
> don't consider them to be problems.
> 
> I only want the xref UI to be displayed when doing commands like 
> `find-all-occurences' etc. When doing a
> plain search, there is no need for it.

Dmitry, is the patch below okay with you?  Any comments?  (I will add
documentation if this is acceptable.)

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index feed0fb..4ae4c06 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -342,6 +342,14 @@ xref-prompt-for-identifier
                      (const :tag "Except" not)
                      (repeat :inline t (symbol :tag "command")))))
 
+(defcustom xref-display-xref-buffer t
+  "When non-nil, xref commands that return multiple hits display XREF buffer.
+
+When nil, the XREF buffer is never shown, and \\[next-error] should
+be used to display the hits."
+  :type '(choice (const :tag "Display XREF buffer with multiple hits" t)
+                 (const :tag "Don't display XREF buffer" nil)))
+
 (defcustom xref-after-jump-hook '(recenter
                                   xref-pulse-momentarily)
   "Functions called after jumping to an xref."
@@ -691,9 +699,14 @@ xref--show-xref-buffer
         (erase-buffer)
         (xref--insert-xrefs xref-alist)
         (xref--xref-buffer-mode)
-        (pop-to-buffer (current-buffer))
+        (and xref-display-xref-buffer
+            (pop-to-buffer (current-buffer)))
         (goto-char (point-min))
         (setq xref--window (assoc-default 'window alist))
+        (unless xref-display-xref-buffer
+          (xref-next-line)
+          (message "%s" (substitute-command-keys
+                         "Use `\\[next-error]' to display further matches")))
         (current-buffer)))))
 
 





reply via email to

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