[Top][All Lists]

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

Re: tags-loop-continue

From: Dmitry Gutov
Subject: Re: tags-loop-continue
Date: Fri, 22 Jan 2016 13:13:20 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Thunderbird/44.0

On 01/22/2016 09:59 AM, Eli Zaretskii wrote:

And if someone asks for it back, ask them to go fix bug#20489 first.

I was about to suggest this myself.  So yes, let's do that.  If we
indeed try harder to leave the *xref* buffer visible, the need for
this integration would be lower.

On the other hand, while *xref* is visible, `next-error' will keep working for its results (it's item 1 in next-error-find-buffer).

That's how `next-error' stayed useful for e.g. *compilation* all these years. And it's fairly handy to call `next-error' to go to the next result, without having to switch back to *compilation*.

So, do we really remove the integration? Up to you.

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 2bccd85..1d71d24 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -600,22 +600,8 @@ xref--xref-buffer-mode-map
 (define-derived-mode xref--xref-buffer-mode special-mode "XREF"
   "Mode for displaying cross-references."
   (setq buffer-read-only t)
-  (setq next-error-function #'xref--next-error-function)
   (setq next-error-last-buffer (current-buffer)))

-(defun xref--next-error-function (n reset?)
-  (when reset?
-    (goto-char (point-min)))
-  (let ((backward (< n 0))
-        (n (abs n))
-        (xref nil))
-    (dotimes (_ n)
-      (setq xref (xref--search-property 'xref-item backward)))
-    (cond (xref
-           (xref--pop-to-location xref))
-          (t
-           (error "No %s xref" (if backward "previous" "next"))))))
 (defun xref-quit (&optional kill)
   "Bury temporarily displayed buffers, then quit the current window.

reply via email to

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