Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from gnus-posting-styles applies

From: Eric Abrahamsen <[email-masked]>
Date: Thu, 21 Nov 2019 21:55:10 -0800

Lars Ingebrigtsen <[email-masked]> writes:

> Lars Ingebrigtsen <[email-masked]> writes:
>
>> So that leaves the nil case -- `C-c C-w' could peek at the
>> global version of the variable if it's buffer-locally nil?
>
> I've now done this on the trunk.  It seems harmless and is more DWIM.

Okay, let me just float an idea here, and if it looks appealing I'll
open a separate bug report to keep it for posterity, and if it doesn't
we can just quietly let it go.

How about a Gnus-specific minor-mode to run in message buffers that are
expected to be tied to Gnus? Like gnus-message-minor-mode, whatever. The
minor mode could do two things:

1. Hook into header completion, so that completing a mail address in
any of the To/From/Cc/Bcc fields would run the whole message through
gnus-posting-styles again, possibly re-writing other parts of the draft
message.

2. Add an X-Gnus-Server header (stripped on sending), which could be set
as a part of posting styles, or associated with a From address, or
otherwise figured out later. The header value would be a Gnus server (eg
nntp:news.gmane.org), and other message action functions would be
patched by the minor mode to first query that server to see if it wants
to "handle" the action, before passing it on to the message-mode
functions.

The beautiful future I'm imagining is that an nnimap server queries its
remote server for "special use" mailboxes, so that it knows which of its
groups is \Drafts, which is \Sent, etc. Now we save the message as a
draft, and the minor mode first checks with the X-Gnus-Server: "can you
handle drafts?" The server can! Or it can't, and the message goes into
nndraft. Or the message is sent, and if there's no Gcc, the minor mode
asks the server, "Can you archive this somewhere?" And hey, maybe the
server can.

All this confined to a minor-mode, of course.

WDYT?