Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing window where buffer is displayed

From: Juri Linkov <[email-masked]>
Date: Wed, 09 Oct 2019 23:38:01 +0300

>> In my case, Info buffers (*info* and *info<N>*) are in dedicated
>> windows.  I expect `info-display-manual' to select such an existing
>> window.  That is, if the Calc manual is already displayed in an Info
>> buffer and I use `M-x info-display-manual' from some other buffer, I
>> expect the existing window showing that manual to be selected (and its
>> frame raised and focused, if necessary).
>>
>> Instead, `info-display-manual' displays the manual in the same window
>> where I invoke it, resulting in two windows (and frames in my case)
>> showing the same Info manual.
>
> Makes sense.  I've now done this in Emacs 27, but while writing the
> code, it struck me that there has to be a ready-made function for this
> somewhere already.  I had a peek through the plethora of
> switch-to/pop-to functions, but I didn't find anything that did exactly
> this...
>
> Does anybody know?  In short: If there's a window that has the buffer,
> then that window should be selected, and its frame popped to the top
> (and given focus).  If not, it should work like `switch-to-buffer'.

I'm not sure, maybe Martin could confirm this, but very likely
you can use display-buffer-reuse-window here.