emacs-devel
[Top][All Lists]
Advanced

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

Re: Control help- and Info-mode buffers from other buffers


From: Juri Linkov
Subject: Re: Control help- and Info-mode buffers from other buffers
Date: Sun, 04 Jun 2023 19:50:18 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> I think a good default would be to use the most recently used window.
>
> Isn't that what would Emacs does per automatic, I mean what get-buffer or
> get-buffer-window chooses?

The docstring of 'get-buffer-window' says nothing about this,
only the Elisp manual provides the details:

 -- Function: get-buffer-window &optional buffer-or-name all-frames
     This function returns the first window displaying BUFFER-OR-NAME in
     the cyclic ordering of windows, starting from the selected window
     (*note Cyclic Window Ordering::).

Then to return the most recently used window better to use
'get-buffer-window-list' and sort the list by recency.

> As I got the idea yesterday while writing about it; It is possible to just 
> work
> in info-buffer, there is no need to also switch to window. The above 
> interacitve
> form is from Info-menu; and now I get the prompt displayed in the selected 
> frame
> not one with the *info* buffer and I can remove the ugly global var I used for
> "the communication" too :).

So you are using 'with-current-buffer'.  But what if the same Info buffer
is displayed in two windows?  What point will you get after visiting
the Info buffer with 'with-current-buffer'?  It will use the window point
from the first Info window or from the second Info window?  The preference
will be according to the cyclic ordering of windows, or the most recently
used window?



reply via email to

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