[Top][All Lists]

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

bug#34908: Push mark in xref-push-marker-stack

From: Dmitry Gutov
Subject: bug#34908: Push mark in xref-push-marker-stack
Date: Wed, 20 Mar 2019 03:47:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 19.03.2019 23:02, Juri Linkov wrote:

Yes, its inconvenience is that you have to remember whether a previous
position was in the same file or not, and depending on this decide
what command to use: global or local pop.

Sooner or later, I believe we should rethink that UI.

Even so, I think it's been nice enough that every command can choose
whether it pushes the mark to the local/global buffer rights, and/or it
adds it to the xref marker stack. Do we have any particular guidelines in
the manual for when either should happen?

I think it should push to both.


I'm not sure where to call push-mark: closer to the command,
or closer to ring-insert.  It seems a suitable place for
push-mark is in xref-push-marker-stack as its name suggests.

I'd rather have a more localized change, at least for now. And leave xref-push-marker-stack to only modify its own data structure.

So how about this?

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 6974d00048..015ea16f34 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -797,6 +797,7 @@ xref--read-identifier-history
 (defvar xref--read-pattern-history nil)

 (defun xref--show-xrefs (xrefs display-action &optional always-show-list)
+  (push-mark nil t)
    ((and (not (cdr xrefs)) (not always-show-list))

reply via email to

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