[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xref window switching problems
From: |
Ingo Lohmar |
Subject: |
Re: xref window switching problems |
Date: |
Fri, 7 Aug 2015 17:25:00 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Stephen Leake <stephen_leake <at> stephe-leake.org> writes:
> > That would, I think, be quite close to going back "in time" to the
> > window/buffer setup that the user had before, whenever that is possible.
> > If that is deemed a reasonable goal,
>
> I don't think it is.
>
> xref-pop-marker-stack should cause the previous marker location to be
> displayed; that's _not_ the same as "also cause everything else that was
> displayed at that point in time to be displayed".
>
> Currently, it always does so in the current window; your proposal
> extends that to consider the other currently visible windows.
You're right, I overstretched the comparison. But I also think the proposal
is a reasonable and not-too-complex behavior.
>
> > the last clause seems the only one where the behavior could differ.
> > Maybe one could reuse another window showing the target buffer,
>
> Yes, I think that is best. No need to store the window; just look in the
> other currently visible windows; if the location is visible (using
> pos-visible-in-window-p ?), go there. It doesn't matter if it's the same
> window that location was in at some earlier time; it's visible now.
Thinking a bit more about this, I agree: if the user has dumped/changed the
original window, another window showing the same buffer should be reused
>
> You could almost implement this with `display-buffer-use-some-frame',
> (that I just added), with a frame-predicate that checks
> pos-visible-in-window-p, but that's not precise enough. We'd have to
> extend that with a window-predicate. Which I need to do for another use
> case. Hmm, it might be better to add window-predicate to
> display-buffer-use-some-window.
>
> > or even choose one of two or three actions, customizable by an option.
>
> Ah, the Emacs Prime Directive again :).
>
Yeah, given some time, I think that is not really useful unless somebody
asks for it and presents a compelling case. Anyway, it would be just a
varibale holding a function, defaulting to #'pop-to-buffer.