unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
@ 2019-08-04  2:35 Michael Heerdegen
  2019-08-04 11:07 ` Michael Albinus
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2019-08-04  2:35 UTC (permalink / raw)
  To: 36917


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.







^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-04  2:35 bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer Michael Heerdegen
@ 2019-08-04 11:07 ` Michael Albinus
  2019-08-05  6:29   ` Michael Heerdegen
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2019-08-04 11:07 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 36917

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-04 11:07 ` Michael Albinus
@ 2019-08-05  6:29   ` Michael Heerdegen
  2019-08-05  6:36     ` Michael Albinus
  2019-08-13 15:37     ` Noam Postavsky
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Heerdegen @ 2019-08-05  6:29 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 36917

Michael Albinus <michael.albinus@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-05  6:29   ` Michael Heerdegen
@ 2019-08-05  6:36     ` Michael Albinus
  2019-08-13 15:37     ` Noam Postavsky
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Albinus @ 2019-08-05  6:36 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 36917

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-05  6:29   ` Michael Heerdegen
  2019-08-05  6:36     ` Michael Albinus
@ 2019-08-13 15:37     ` Noam Postavsky
  2019-08-18 12:24       ` Michael Heerdegen
  1 sibling, 1 reply; 11+ messages in thread
From: Noam Postavsky @ 2019-08-13 15:37 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Michael Albinus, 36917

Michael Heerdegen <michael_heerdegen@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?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-13 15:37     ` Noam Postavsky
@ 2019-08-18 12:24       ` Michael Heerdegen
  2019-08-18 12:35         ` Michael Albinus
  2019-08-18 14:59         ` Noam Postavsky
  0 siblings, 2 replies; 11+ messages in thread
From: Michael Heerdegen @ 2019-08-18 12:24 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Michael Albinus, 36917

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Noam Postavsky <npostavs@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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-pop-to-buffer-same-window-in-debbugs-gnu-show-re.patch --]
[-- Type: text/x-diff, Size: 1159 bytes --]

From 64894d01765e25d03c4c911f24778caeee128901 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@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


[-- Attachment #3: Type: text/plain, Size: 191 bytes --]


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.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-18 12:24       ` Michael Heerdegen
@ 2019-08-18 12:35         ` Michael Albinus
  2019-08-18 22:55           ` Eric Abrahamsen
  2019-08-18 14:59         ` Noam Postavsky
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Albinus @ 2019-08-18 12:35 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Noam Postavsky, 36917

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-18 12:24       ` Michael Heerdegen
  2019-08-18 12:35         ` Michael Albinus
@ 2019-08-18 14:59         ` Noam Postavsky
  2019-08-21 12:41           ` Michael Heerdegen
  1 sibling, 1 reply; 11+ messages in thread
From: Noam Postavsky @ 2019-08-18 14:59 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Michael Albinus, 36917

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-18 12:35         ` Michael Albinus
@ 2019-08-18 22:55           ` Eric Abrahamsen
  0 siblings, 0 replies; 11+ messages in thread
From: Eric Abrahamsen @ 2019-08-18 22:55 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Michael Heerdegen, Noam Postavsky, 36917

Michael Albinus <michael.albinus@gmx.de> writes:

> Michael Heerdegen <michael_heerdegen@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





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-18 14:59         ` Noam Postavsky
@ 2019-08-21 12:41           ` Michael Heerdegen
  2019-08-21 19:06             ` Michael Albinus
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Heerdegen @ 2019-08-21 12:41 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Michael Albinus, 36917

Noam Postavsky <npostavs@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer
  2019-08-21 12:41           ` Michael Heerdegen
@ 2019-08-21 19:06             ` Michael Albinus
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Albinus @ 2019-08-21 19:06 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 36917-done, Noam Postavsky

Michael Heerdegen <michael_heerdegen@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.





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-08-21 19:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-04  2:35 bug#36917: 27.0.50; debbugs-gnu: Don't hardcode switch-to-buffer Michael Heerdegen
2019-08-04 11:07 ` Michael Albinus
2019-08-05  6:29   ` Michael Heerdegen
2019-08-05  6:36     ` Michael Albinus
2019-08-13 15:37     ` Noam Postavsky
2019-08-18 12:24       ` Michael Heerdegen
2019-08-18 12:35         ` Michael Albinus
2019-08-18 22:55           ` Eric Abrahamsen
2019-08-18 14:59         ` Noam Postavsky
2019-08-21 12:41           ` Michael Heerdegen
2019-08-21 19:06             ` Michael Albinus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).