Subject: bug#47236: 28.0.50; ebdb-mua-pop-up bad interaction with gnus window configurations

From: Eric Abrahamsen <[email-masked]>
Date: Thu, 18 Mar 2021 09:29:09 -0700

Robert Pluim <[email-masked]> writes:

> Hi Eric,
>
> This is with ebdb 0.6.22.
>
> I set up gnus to have a window configuration that shows the *Group*,
> *Summary*, *Article* windows simultaneously:
>
> (gnus-add-configuration
>  '(article
>    (horizontal 1.0
>                (vertical 50 (group 1.0))
>                (vertical 1.0
>                          (summary 0.3 point)
>                          (article 1.0)))))
> (gnus-add-configuration
>  '(summary
>    (horizontal 1.0
>                (vertical 50 (group 1.0))
>                (vertical 1.0 (summary 1.0 point)))))
>
> And also to pop up a new frame whenever I write a message:
>
> (dolist (key '(message edit-article post reply forward reply-yank bug))
>   (gnus-add-configuration
>    `(,key
>      (frame 1.0
>             (if (not (buffer-live-p gnus-summary-buffer))
>                 (car (cdr (assoc 'group gnus-buffer-configuration)))
>               (car (cdr (assoc 'summary gnus-buffer-configuration))))
>             (vertical ((user-position . t) (top . 1) (left . 1)
>                        (name . ,(symbol-name key)))
>                       (message 1.0 point))))))
>
> Unfortunately, when ebdb-mua-pop-up is t, two things happen:
>
> 1. When I enter a group from the *Group* buffer, I end up with only
> the *Summary* and *Article* buffer.
>
> 2. When I reply to a message, I donʼt get a new frame popping up.

Ooh, I don't look forward to messing with Gnus' window configuration. So
first of all, the relevant customization options will be:

ebdb-gnus-window-configuration
ebdb-message-reply-window-config
ebdb-message-reply-yank-window-config

They can be used to add the relevant clauses to
`gnus-buffer-configuration'. (Composing new mail/news doesn't need this
config, because the EBDB buffer won't be popped up until you start
completing addresses.)

Of course this doesn't make any sense at all, because it obliges you to
define your entire (e.g.) `article' configuration inside an
EBDB-specific customization option, rather than in your Gnus config.

ebdb-gnus.el and ebdb-message.el each add keys to
`gnus-window-to-buffer', so probably all the EBDB code should do is
mention those keys, and then let users put them where they want them in
their `gnus-add-configuration' clauses.

EXCEPT that will mean that EBDB won't work with Gnus/Message out of the
box without some fairly heavy configuration. It won't be at all obvious
why the pop-ups aren't working.

MAYBE I should just stop messing with `gnus-buffer-configuration' at
all, and instead just do this stuff manually with the `display-buffer'
mechanisms.

Anyway, I'm thinking out loud here, but if you'd be willing to try the
config options above and just confirm that you can get things working as
desired that way, I will think a bit more about a better approach to the
whole thing.

Thanks,
Eric