GNU bug report logs - #20020
25.0.50; `info-display-manual' should reuse existing window where buffer is displayed

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 6 Mar 2015 19:17:02 UTC

Severity: wishlist

Found in version 25.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20020 in the body.
You can then email your comments to 20020 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Fri, 06 Mar 2015 19:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 06 Mar 2015 19:17:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; `info-display-manual' should reuse existing window where
 buffer is displayed
Date: Fri, 6 Mar 2015 11:15:38 -0800 (PST)
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.



In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2015-02-27 on LEG570
Bzr revision: b2a590d4e3dc692a97c1b53e015b945d84b4b4c7
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --host=i686-pc-mingw32 --enable-checking=yes,glyphs'




Severity set to 'wishlist' from 'minor' Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Mon, 30 Sep 2019 00:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Wed, 09 Oct 2019 02:14:02 GMT) Full text and rfc822 format available.

Message #10 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 20020 <at> debbugs.gnu.org
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Wed, 09 Oct 2019 04:12:52 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> 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'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 27.1, send any further explanations to 20020 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 09 Oct 2019 02:14:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Wed, 09 Oct 2019 16:56:03 GMT) Full text and rfc822 format available.

Message #15 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50;
 `info-display-manual' should reuse existing window where buffer is
 displayed
Date: Wed, 09 Oct 2019 19:54:56 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Wed, 09 Oct 2019 04:12:52 +0200
> Cc: 20020 <at> debbugs.gnu.org
> 
> Drew Adams <drew.adams <at> oracle.com> writes:
> 
> > 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?

I don't really understand what you did and what was the original
problem, because info-display-manual already behaves for me like the
OP wanted.  It has behaved like that from day one, because I wrote it
to do so.  It only displays in *info* if there's not already an
*info*<N> buffer showing the requested manual (and in my Emacs
sessions, I never have *info* for long, I either kill it or rename to
*info*<N>.

Maybe the problem is that the OP did this in dedicated windows?
That's the only factor I could think of that is different from what I
do.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Wed, 09 Oct 2019 17:52:01 GMT) Full text and rfc822 format available.

Message #18 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Wed, 09 Oct 2019 19:51:29 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I don't really understand what you did and what was the original
> problem, because info-display-manual already behaves for me like the
> OP wanted.  It has behaved like that from day one, because I wrote it
> to do so.  It only displays in *info* if there's not already an
> *info*<N> buffer showing the requested manual (and in my Emacs
> sessions, I never have *info* for long, I either kill it or rename to
> *info*<N>.

Yes, it reuses the buffer.  But the bug report is about window
behaviour.

> Maybe the problem is that the OP did this in dedicated windows?
> That's the only factor I could think of that is different from what I
> do.

Try this in Emacs 26:

M-: (info-display-manual "Coreutils")
C-x 2
C-x b *scratch*
M-: (info-display-manual "Coreutils")

You'll now have two windows displaying the same Info buffer, and that
was what the user didn't want (and I agree that it's not optimal
behaviour).  In the user's case, it was exacerbated by having the window
displayed in a different frame, but that's just a detail.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Wed, 09 Oct 2019 18:10:02 GMT) Full text and rfc822 format available.

Message #21 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Wed, 09 Oct 2019 21:08:39 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: drew.adams <at> oracle.com,  20020 <at> debbugs.gnu.org
> Date: Wed, 09 Oct 2019 19:51:29 +0200
> 
> M-: (info-display-manual "Coreutils")
> C-x 2
> C-x b *scratch*
> M-: (info-display-manual "Coreutils")
> 
> You'll now have two windows displaying the same Info buffer, and that
> was what the user didn't want (and I agree that it's not optimal
> behaviour).  In the user's case, it was exacerbated by having the window
> displayed in a different frame, but that's just a detail.

If this is the change, then I think it should be an opt-in change.  We
don't behave like that with any other buffers, why should Info buffers
be an exception by default?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Wed, 09 Oct 2019 20:59:02 GMT) Full text and rfc822 format available.

Message #24 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Thu, 10 Oct 2019 09:17:02 GMT) Full text and rfc822 format available.

Message #27 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Thu, 10 Oct 2019 11:16:15 +0200
>> 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.

The basic ingredient is a suitable 'reusable-frames' ALIST entry which
should specify the frames on which to search for such a window.  Apart
from that, plain 'pop-to-buffer' should work.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Fri, 11 Oct 2019 08:08:02 GMT) Full text and rfc822 format available.

Message #30 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Fri, 11 Oct 2019 10:07:30 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> If this is the change, then I think it should be an opt-in change.  We
> don't behave like that with any other buffers, why should Info buffers
> be an exception by default?

That's true.  Off the top of my head, I can't recall any other commands
that work this way, so it's odd for `info-display-manual' to do so.

Should I just revert the change?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Fri, 11 Oct 2019 08:10:01 GMT) Full text and rfc822 format available.

Message #33 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 20020 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Fri, 11 Oct 2019 10:09:09 +0200
martin rudalics <rudalics <at> gmx.at> writes:

> The basic ingredient is a suitable 'reusable-frames' ALIST entry which
> should specify the frames on which to search for such a window.  Apart
> from that, plain 'pop-to-buffer' should work.

Or perhaps `pop-to-buffer-same-window', since the command uses
`switch-to-window' presently?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Fri, 11 Oct 2019 08:27:01 GMT) Full text and rfc822 format available.

Message #36 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Fri, 11 Oct 2019 10:26:43 +0200
> Or perhaps `pop-to-buffer-same-window', since the command uses
> `switch-to-window' presently?

If I'm not mistaken, this would prefer the selected window to a window
on another frame.  So probably use 'display-buffer-reuse-window' as
first choice and 'display-buffer-same-window' as second choice.  With
a suitable 'reusable-frames' and an 'inhibit-same-window' nil alist
entries.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Fri, 11 Oct 2019 09:20:02 GMT) Full text and rfc822 format available.

Message #39 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Fri, 11 Oct 2019 12:18:51 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: drew.adams <at> oracle.com,  20020 <at> debbugs.gnu.org
> Date: Fri, 11 Oct 2019 10:07:30 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > If this is the change, then I think it should be an opt-in change.  We
> > don't behave like that with any other buffers, why should Info buffers
> > be an exception by default?
> 
> That's true.  Off the top of my head, I can't recall any other commands
> that work this way, so it's odd for `info-display-manual' to do so.
> 
> Should I just revert the change?

It'd be fine with me, but probably not with Drew.  having an opt-in
defcustom is a good compromise, I think.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20020; Package emacs. (Sun, 13 Oct 2019 18:23:02 GMT) Full text and rfc822 format available.

Message #42 received at 20020 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20020 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#20020: 25.0.50; `info-display-manual' should reuse existing
 window where buffer is displayed
Date: Sun, 13 Oct 2019 20:22:27 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> > If this is the change, then I think it should be an opt-in change.  We
>> > don't behave like that with any other buffers, why should Info buffers
>> > be an exception by default?
>> 
>> That's true.  Off the top of my head, I can't recall any other commands
>> that work this way, so it's odd for `info-display-manual' to do so.
>> 
>> Should I just revert the change?
>
> It'd be fine with me, but probably not with Drew.  having an opt-in
> defcustom is a good compromise, I think.

I don't know much about how dedicated windows work, but couldn't Drew
set that up to have Emacs pop up that window instead of having special
code for this in `info-display-manual'?  I had forgotten about that when
I wrote the patch.  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Nov 2019 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.