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.

Full log


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.

This bug report was last modified 5 years and 271 days ago.

Previous Next


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