GNU bug report logs - #31027
27.0.50; xref, tags-location-ring equivalent

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Mon, 2 Apr 2018 18:08:02 UTC

Severity: wishlist

Found in version 27.0.50

Full log


Message #32 received at 31027 <at> debbugs.gnu.org (full text, mbox):

From: charles <at> aurox.ch (Charles A. Roelli)
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 31027 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#31027: 27.0.50; xref, tags-location-ring equivalent
Date: Thu, 05 Apr 2018 20:56:22 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Thu, 5 Apr 2018 01:14:14 +0300
>
> >> What's simpler about that? You'd need some new commands to use it as
> >> well, right?
> > 
> > Is the idea to use a ring of next-error capable buffers?
> > So that the next-error command in the current buffer
> > will return a list of all potentially next-error capable buffers
> > and allow the user to select the required one.
> 
> Umm, I don't think the request is anything so ambitious.
> 
> Charles has been asking for a ring to store the navigation locations 
> visited by xref only.

Exactly, this feature request is only about xref.  Nevertheless, the
idea of a "ring of next-error capable buffers" does sound like it
could be useful in its own right -- if anybody wants to open up a bug
for that, feel free.

Anyway, I suggest we follow the etags implementation of
"tags-location-ring".  This is all there is to it, in simplified
terms:

(defun find-tag-noselect ...
  ...
  (if (eq '- PREFIX-ARG)
	;; Pop back to a previous location.
	(if (ring-empty-p tags-location-ring)
	    (user-error "No previous tag locations")
	  (let ((marker (ring-remove tags-location-ring 0)))
	    (prog1
		;; Move to the saved location.
		(set-buffer (or (marker-buffer marker)
                                (error "The marked buffer has been deleted")))
	      (goto-char (marker-position marker))
	      ;; Kill that marker so it doesn't slow down editing.
	      (set-marker marker nil nil))))
    ;; Else, we jump to wherever we wanted to go, and record and add a
    ;; marker to tags-location-ring.
    (let ((marker (make-marker)))
      (with-current-buffer
	  (find-tag-in-order ...)
	(set-marker marker (point))
	(run-hooks 'local-find-tag-hook)
	(ring-insert tags-location-ring marker)
	(current-buffer))))))




This bug report was last modified 7 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.