GNU bug report logs - #36917
27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Sun, 4 Aug 2019 02:36:01 UTC

Severity: minor

Found in version 27.0.50

Done: Michael Albinus <michael.albinus <at> gmx.de>

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 36917 in the body.
You can then email your comments to 36917 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#36917; Package emacs. (Sun, 04 Aug 2019 02:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 04 Aug 2019 02:36:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Sun, 04 Aug 2019 04:35:47 +0200
Hi,

I don't want that debbugs-gnu-bugs reuses the selected window.  It's not
easy to change that as a user because 'debbugs-gnu-show-reports' uses
`switch-to-buffer' to display the reports AFAICT (the whole library uses
s-to-buffer quite a lot).  It would be nice if it would either use named
actions or just use to display-buffer so that one could control behavior
via display-buffer-alist.

TIA, Michael.






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

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Sun, 04 Aug 2019 13:07:23 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Hi,

Hi Michael,

> I don't want that debbugs-gnu-bugs reuses the selected window.  It's not
> easy to change that as a user because 'debbugs-gnu-show-reports' uses
> `switch-to-buffer' to display the reports AFAICT (the whole library uses
> s-to-buffer quite a lot).  It would be nice if it would either use named
> actions or just use to display-buffer so that one could control behavior
> via display-buffer-alist.

Patches welcome :-)

> TIA, Michael.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Mon, 05 Aug 2019 06:30:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Mon, 05 Aug 2019 08:29:24 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Patches welcome :-)

Yeah, that's what I think too!

Jokes aside: I don't know the code, so I don't really know what I'm
doing unless I study it.  Do you know it?  I could suggest a patch but
it would be more work than like for you or Lars I guess.

> Best regards, Michael.

Yeah, again, that's what I wanted to say, too.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Mon, 05 Aug 2019 06:37:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Mon, 05 Aug 2019 08:36:11 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

Hi Michael,

> Jokes aside: I don't know the code, so I don't really know what I'm
> doing unless I study it.  Do you know it?  I could suggest a patch but
> it would be more work than like for you or Lars I guess.

Likely yes. I could (will) push it on my TODO list, but it won't have
the highest priority. Too many other items in that list.

Will be happy to review any patch which arrives in the meantime.

> Yeah, again, that's what I wanted to say, too.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Tue, 13 Aug 2019 15:38:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Tue, 13 Aug 2019 11:37:38 -0400
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Jokes aside: I don't know the code, so I don't really know what I'm
> doing unless I study it.  Do you know it?  I could suggest a patch but
> it would be more work than like for you or Lars I guess.

I guess just a trivial s/switch-to-buffer/pop-to-buffer-same-window/
would allow the user to control things with display-buffer-alist.  Maybe
you could try that and see if it works out?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Sun, 18 Aug 2019 12:25:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Sun, 18 Aug 2019 14:24:01 +0200
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> gmail.com> writes:

> I guess just a trivial s/switch-to-buffer/pop-to-buffer-same-window/
> would allow the user to control things with display-buffer-alist.  Maybe
> you could try that and see if it works out?

Yeah, that works for me.  So I have this patch:

[0001-Use-pop-to-buffer-same-window-in-debbugs-gnu-show-re.patch (text/x-diff, inline)]
From 64894d01765e25d03c4c911f24778caeee128901 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Fri, 16 Aug 2019 16:26:22 +0200
Subject: [PATCH] Use pop-to-buffer-same-window in debbugs-gnu-show-reports

Use 'pop-to-buffer-same-window' instead of 'switch-to-buffer' to
display bug reports so user can configure behavior via
'display-buffer-alist' (Bug#36917).

* packages/debbugs/debbugs-gnu.el (debbugs-gnu-show-reports): Use
'pop-to-buffer-same-window' to display bug reports.
---
 packages/debbugs/debbugs-gnu.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index 25fb02958a..515129b95f 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/debbugs-gnu.el
@@ -722,7 +722,7 @@ are taken from the cache instead."
     ;; rid of them.
     (when (get-buffer buffer-name)
       (kill-buffer buffer-name))
-    (switch-to-buffer (get-buffer-create buffer-name))
+    (pop-to-buffer-same-window (get-buffer-create buffer-name))
     (debbugs-gnu-mode)

     ;; Print bug reports.
--
2.23.0.rc1

[Message part 3 (text/plain, inline)]
Should I install it?  Should I also bump the version?

I didn't have a look at the other remaining `switch-to-buffer' calls.
Noam, did you mean to substitute all of them?

Thanks,

Michael.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Sun, 18 Aug 2019 12:36:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Noam Postavsky <npostavs <at> gmail.com>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Sun, 18 Aug 2019 14:35:45 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

Hi Michael,

> Should I install it?  Should I also bump the version?

In case you install it, pls wait with increasing the version. I have the
hope, that bug#36903 will be fixed also soon. At least, Eric wanted to
test his patch locally.

> I didn't have a look at the other remaining `switch-to-buffer' calls.
> Noam, did you mean to substitute all of them?

For that, I have no opinion (not tested). I let it to you and Noam.

> Thanks,
>
> Michael.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Sun, 18 Aug 2019 15:00:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Sun, 18 Aug 2019 10:59:29 -0400
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Use 'pop-to-buffer-same-window' instead of 'switch-to-buffer' to
> display bug reports so user can configure behavior via
> 'display-buffer-alist' (Bug#36917).
>
> * packages/debbugs/debbugs-gnu.el (debbugs-gnu-show-reports): Use
> 'pop-to-buffer-same-window' to display bug reports.

I think you can combine these two paragraphs.

> I didn't have a look at the other remaining `switch-to-buffer' calls.
> Noam, did you mean to substitute all of them?

If you think you might want to control the buffer switching of those
other functions with display-buffer-alist, then yes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Sun, 18 Aug 2019 22:56:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Michael Heerdegen <michael_heerdegen <at> web.de>,
 Noam Postavsky <npostavs <at> gmail.com>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Mon, 19 Aug 2019 06:55:33 +0800
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>
> Hi Michael,
>
>> Should I install it?  Should I also bump the version?
>
> In case you install it, pls wait with increasing the version. I have the
> hope, that bug#36903 will be fixed also soon. At least, Eric wanted to
> test his patch locally.

I tested it and it didn't work, I think because even if you blank out
`gnus-format-specs' at Gnus shutdown, that doesn't blank out the value
of eg `gnus-summary-line-format', so `gnus-format-specs' is simply
rebuilt from the customized value.

I still feel medium-strongly that the registry shouldn't be left hanging
around after Gnus exits, and that it's sheer accident that debbugs used
to work when it *was* left hanging around. On the other hand, figuring
out all the ways in which debbugs-gnu-summary-mode may or may not depend
on the user's Gnus customizations sounds a bit hopeless. Worst come to
worst, I can rework 2815174f to prevent double-loading some other way,
and remove the `gnus-registry-clear' function so the registry isn't
cleared, but I would feel a little bad about that, ha.

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36917; Package emacs. (Wed, 21 Aug 2019 12:42:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: Michael Albinus <michael.albinus <at> gmx.de>, 36917 <at> debbugs.gnu.org
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Wed, 21 Aug 2019 14:41:02 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

> > Use 'pop-to-buffer-same-window' instead of 'switch-to-buffer' to
> > display bug reports so user can configure behavior via
> > 'display-buffer-alist' (Bug#36917).
> >
> > * packages/debbugs/debbugs-gnu.el (debbugs-gnu-show-reports): Use
> > 'pop-to-buffer-same-window' to display bug reports.
>
> I think you can combine these two paragraphs.

Done.

> > I didn't have a look at the other remaining `switch-to-buffer' calls.
> > Noam, did you mean to substitute all of them?
>
> If you think you might want to control the buffer switching of those
> other functions with display-buffer-alist, then yes.

I've installed the single change for now.  I'm not familiar with the
rest of the package, so I would want to leave that to the authors.


Thanks,

Michael.




Reply sent to Michael Albinus <michael.albinus <at> gmx.de>:
You have taken responsibility. (Wed, 21 Aug 2019 19:07:02 GMT) Full text and rfc822 format available.

Notification sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
bug acknowledged by developer. (Wed, 21 Aug 2019 19:07:02 GMT) Full text and rfc822 format available.

Message #37 received at 36917-done <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 36917-done <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
Date: Wed, 21 Aug 2019 21:06:25 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

Hi Michael,

>> > I didn't have a look at the other remaining `switch-to-buffer' calls.
>> > Noam, did you mean to substitute all of them?
>>
>> If you think you might want to control the buffer switching of those
>> other functions with display-buffer-alist, then yes.
>
> I've installed the single change for now.  I'm not familiar with the
> rest of the package, so I would want to leave that to the authors.

Thanks. I'm closing the bug, not changing anything else. Let's wait
until there are further requests.

> Thanks,
>
> Michael.

Best regards, Michael.




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

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

Previous Next


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