all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: charles@aurox.ch (Charles A. Roelli)
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 31027@debbugs.gnu.org, juri@linkov.net
Subject: bug#31027: 27.0.50; xref, tags-location-ring equivalent
Date: Thu, 05 Apr 2018 20:56:22 +0200	[thread overview]
Message-ID: <m237091nzd.fsf@aurox.ch> (raw)
In-Reply-To: <da26f625-e48f-9e47-0f52-0168fae01082@yandex.ru> (message from Dmitry Gutov on Thu, 5 Apr 2018 01:14:14 +0300)

> From: Dmitry Gutov <dgutov@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))))))





  reply	other threads:[~2018-04-05 18:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 18:06 bug#31027: 27.0.50; xref, tags-location-ring equivalent Charles A. Roelli
2018-04-03  7:15 ` Robert Pluim
2018-04-03 17:58   ` Charles A. Roelli
2018-04-03 20:32 ` Dmitry Gutov
2018-04-04 18:37   ` Charles A. Roelli
2018-04-04 18:57     ` Dmitry Gutov
2018-04-04 19:25       ` Eli Zaretskii
2018-04-04 20:59       ` Juri Linkov
2018-04-04 22:14         ` Dmitry Gutov
2018-04-05 18:56           ` Charles A. Roelli [this message]
2018-04-05 21:05             ` Dmitry Gutov
2018-04-08  9:14               ` Charles A. Roelli
2018-04-07 20:56           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m237091nzd.fsf@aurox.ch \
    --to=charles@aurox.ch \
    --cc=31027@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.