[Top][All Lists]

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

Re: xref window switching problems

From: Stephen Leake
Subject: Re: xref window switching problems
Date: Thu, 06 Aug 2015 04:16:39 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

Dmitry Gutov <address@hidden> writes:

> On 08/05/2015 09:56 AM, Stephen Leake wrote:
>>> Maybe xref-pop-marker-stack could benefit from a discussion as
>>> well.
>> I haven't used that much, but so far it does what I want; change the
>> current window to display the previous location.
>> If I want to preserve the current location in a window, I would first
>> move to a different window; I haven't tested to see if that works in the
>> one buffer/two locations scenario.
> I think the behavior of xref-find-definitions-other-window followed by
> xref-pop-marker-stack leaves a lot to be desired.

What, exactly, do you not like?

Suppose I'm in ede/emacs.el, with one window in one frame, point is on
'file-name-extension',  and I invoke C-x 4 .

The current window is split, and point is now in files.el at "(defun

Now I invoke M-,. The window displaying files.el now has emacs.el; I now
have two windows displaying the same thing.

That's exactly what I asked for, so I don't have a problem with it.

I agree it's not particularly useful, but the solution is simple; don't
do that.

Often I will invoke M-, multiple times, to go back to where I started; I
don't want Emacs messing with windows on the way. I'll manage my own
windows, thank you.

There might be a use case for xref-pop-marker-stack-other-window. I'm
working on a more general solution, that uses a prefix key to specify
'other window' or 'other frame' to _any_ command that uses
display-buffer or switch-to-buffer. The code is almost ready; stay tuned

> However, I don't see an obvious way of fixing it. Apparently,
> xref--marker-ring will have to store more information.
> Would it keep track of the buffer opened in the new window as well? So
> that xref-pop-marker-stack would quit that window?

No, the user probably wants to display something else in it. Using a
subsequent M-,, for example.

The user specifically requested that a second window be created. Don't
delete it unless the user specifically requests that.

A window created by an -other-window command is not at all like a
temporary prompt window. For xref-find-definitions, it could be
considered to be like a *Help* window; those hang around until the user
explicitly deletes them.

-- Stephe

reply via email to

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