[Top][All Lists]

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

Re: xref window switching problems

From: Dmitry Gutov
Subject: Re: xref window switching problems
Date: Wed, 5 Aug 2015 15:33:28 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0

On 08/04/2015 10:42 PM, Ingo Lohmar wrote:

- the point of the *current* window is moved to the target location
   (just what the user wanted to avoid, I suppose)

That's clearly a bug. Should be fixed now, thanks.

- when the current window is the only one showing the buffer in
   question, then the same buffer is newly displayed in another window we
   pop to (hence at the same position)

Aside from the bug above, this seems to be the intended behavior.

- when another window already shows the same buffer, we pop to this
   buffer --- less annoying, but still unexpected and not helpful

I'm not sure if it's a problem, actually. That's how pop-to-buffer works. In general, it would even use the current window if it already displays the buffer in question, but for xref-find-definitions-other-window, we explicitly ask it to use another window. So it uses the other window displaying the same buffer.

The old pre-xref elisp implementations and the tags functions got the
"...-other-window" behavior right IMO: Leave my current window's buffer
and point alone in any case, and pop to the target shown in another

Are you sure it doesn't reuse the second window that displays the same buffer?

The change would be easy (see xref--pop-to-location), first get the
buffer, then do the window business, and only then xref--goto-location.

The choice of how to implement it was not so easy. Pretty much because

(with-current-buffer (current-buffer) (goto-char (point-min)))

moves point in the current window.

Maybe xref-pop-marker-stack could benefit from a discussion as well.

Maybe it could benefit from a patch proposal.

reply via email to

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