emacs-devel
[Top][All Lists]
Advanced

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

Re: xref and displaying locations in appropriate window or frame


From: martin rudalics
Subject: Re: xref and displaying locations in appropriate window or frame
Date: Sun, 24 Jan 2016 11:55:33 +0100

> - xref-find-definitions-other-window should, apparently, pick some
> window which isn't the original one, nor the one which displays the
> *xref* buffer. Or create a new one, in a pop-to-buffer fashion. Is
> there a function in window.el I can reuse, and/or display-buffer alist
> argument that would make it ignore whole two buffers, and not just the
> currently selected one?

No.  Satisfying a contract that requires three windows to appear
simultaneously on a frame is impossible with ‘display-buffer’ on a
default Emacs.

I can only give my personal preference, feel free to ignore it: *xref*
would be displayed by ‘with-temp-buffer-window’ so that I can use
‘temp-buffer-resize-mode’ on it.  By default *xref* would be shown at
the bottom of the frame with columns arranged as in the *Completions*
buffer.

Conceptually, this should allow to split the "original" window into two
side-by-side windows where the left one would continue to display the
original buffer and the right one would display the buffer chosen by
‘xref-find-definitions-other-window’.  If there's already another window
on the side of the original window, that window would be reused by
‘xref-find-definitions-other-window’.

Obviously, if the frame is too narrow, splitting will fail and the
buffer will be shown in the original window.  But, as mentioned above,
there's nothing you can do about this.  The doc-string of
‘xref-find-definitions-other-window’ should probably mention it.

And ‘xref-find-definitions’ would display its buffer in the original
window above the *xref* window.

martin




reply via email to

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