GNU bug report logs - #38289
27.0.50; C-c C-w not working if signature from gnus-posting-styles applies

Previous Next

Packages: gnus, emacs;

Reported by: Amin Bandali <bandali <at> gnu.org>

Date: Wed, 20 Nov 2019 06:45:02 UTC

Severity: minor

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 38289 in the body.
You can then email your comments to 38289 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, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Wed, 20 Nov 2019 06:45:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Amin Bandali <bandali <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org. (Wed, 20 Nov 2019 06:45:02 GMT) Full text and rfc822 format available.

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

From: Amin Bandali <bandali <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; C-c C-w not working if signature from gnus-posting-styles
 applies
Date: Wed, 20 Nov 2019 01:44:30 -0500
As the title suggests, pressing C-c C-w (bound
to message-insert-signature) in message-mode
does not insert the signature if the signature
field of a style defined in gnus-posting-styles
applies here.  However, if I comment those bits
out and instead use a ~/.signature file, then
C-c C-w inserts the signature as expected.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Thu, 21 Nov 2019 13:42:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Amin Bandali <bandali <at> gnu.org>
Cc: 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Thu, 21 Nov 2019 14:41:39 +0100
Amin Bandali <bandali <at> gnu.org> writes:

> As the title suggests, pressing C-c C-w (bound to
> message-insert-signature) in message-mode does not insert the
> signature if the signature field of a style defined in
> gnus-posting-styles applies here.  However, if I comment those bits
> out and instead use a ~/.signature file, then C-c C-w inserts the
> signature as expected.

I'm not sure that's a bug, though: message-mode knows nothing about
gnus-posting-styles, and `C-c C-w' is documented to act according to
what the `message-signature' variables says.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Severity set to 'minor' from 'normal' Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 21 Nov 2019 13:42:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Thu, 21 Nov 2019 20:39:01 GMT) Full text and rfc822 format available.

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

From: Amin Bandali <bandali <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Thu, 21 Nov 2019 15:38:01 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I'm not sure that's a bug, though:
> message-mode knows nothing about
> gnus-posting-styles, and `C-c C-w' is
> documented to act according to what the
> `message-signature' variables says.

While I so wish `message-mode' knew about
`gnus-posting-styles', that's not the bug I'm
reporting.  This is a bug where whenever a
signature rule from `gnus-posting-styles'
applies, `C-c C-w' ceases to work according to
its documentation; it does /nothing/ at all.
The expected behaviour would be for `C-c C-w'
to carry out whatever `message-signature' is
set to do, like you mentioned; but that doesn't
happen; at least not for me.

For instance, if `message-mode' was opened by
hitting `r' on an article in nnimap+gnu:INBOX
which has a custom signature set using
`gnus-posting-styles', if I manually remove the
prefilled signature and hit `C-c C-w', nothing
happens, as if `message-signature' was set to
nil; whereas it is actually t.  Makes sense?




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Thu, 21 Nov 2019 23:05:06 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Amin Bandali <bandali <at> gnu.org>
Cc: 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Fri, 22 Nov 2019 00:04:16 +0100
Amin Bandali <bandali <at> gnu.org> writes:

> For instance, if `message-mode' was opened by
> hitting `r' on an article in nnimap+gnu:INBOX
> which has a custom signature set using
> `gnus-posting-styles', if I manually remove the
> prefilled signature and hit `C-c C-w', nothing
> happens, as if `message-signature' was set to
> nil; whereas it is actually t.  Makes sense?

Yes indeed -- I misread your bug report.

And, yes, that's how this works.  When doing the posting styles, Gnus
sets the message variables buffer-locally:

		   ((eq 'signature (car result))
		    (set (make-local-variable 'message-signature) nil)
		    (set (make-local-variable 'message-signature-file) nil)

I'm now quite sure what's the best way to fix this -- perhaps `C-c C-w'
should consult the global values?  But that may be equally wrong,
because somebody may be setting that variable buffer-locally in a hook,
for instance, and `C-c C-w' should do the obvious thing and work on that
value.

The nil case makes it seem obvious that Message should be doing
something other than what it's doing now, but if you've set the
signature via Gnus posting styles, and then deleted it, and then want to
insert it again with `C-c C-w' -- shouldn't that work?  I think it
should.  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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Thu, 21 Nov 2019 23:21:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Amin Bandali <bandali <at> gnu.org>
Cc: 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Fri, 22 Nov 2019 00:20:40 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 21 Nov 2019 23:21:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 38289 <at> debbugs.gnu.org and Amin Bandali <bandali <at> gnu.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 21 Nov 2019 23:21:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Fri, 22 Nov 2019 05:56:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Amin Bandali <bandali <at> gnu.org>, 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Thu, 21 Nov 2019 21:55:10 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Fri, 22 Nov 2019 12:39:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: Amin Bandali <bandali <at> gnu.org>, 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Fri, 22 Nov 2019 13:38:24 +0100
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> 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:

That does sound cleaner than the current Gnus/Message integration, which
is based inserting some text in the buffer, and then locally setting a
bunch of Message variables to disable the default action.

But I'm not sure how it would look in practice.

> 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.

Hm...  I'm not sure I see how that would work.  The posting styles just
insert a bunch of stuff and can eval whatever.

> 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.

It sounds a bit abstract -- would it ignore nndrafts if the IMAP server
has \Drafts?  (Auto-saving over nnimap isn't recommended, really.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Fri, 22 Nov 2019 18:21:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Amin Bandali <bandali <at> gnu.org>, 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Fri, 22 Nov 2019 10:20:08 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> 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:
>
> That does sound cleaner than the current Gnus/Message integration, which
> is based inserting some text in the buffer, and then locally setting a
> bunch of Message variables to disable the default action.
>
> But I'm not sure how it would look in practice.

Well I certainly didn't spend a lot of time thinking about it :)

>> 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.
>
> Hm...  I'm not sure I see how that would work.  The posting styles just
> insert a bunch of stuff and can eval whatever.

I'm not sure exactly how it would look either, but I believe that with
some refactoring, we could trigger a change of sending "profile" based
on completions of To/From addresses. Ideally re-using what people have
already got in their posting styles. There are a few external packages
out there that provide for "personas", it's a definite need. I could put
it on the list of things to think about.

>> 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.
>
> It sounds a bit abstract -- would it ignore nndrafts if the IMAP server
> has \Drafts?  (Auto-saving over nnimap isn't recommended, really.)

Actually I think this part would be much more straightforward to
implement. We decide on a priority for the various headers -- ie, an
explicit Gcc beats a X-Gnus-Server that can handle sent message, for
drafts maybe X-Draft-From comes into play -- and then just run through
what's in the message buffer. For drafts I think it would be easy enough
to have the auto-save process save the message to nndrafts, while
explicit "C-x C-s", "C-c C-d" and the gnus-quit prompt would check the
server for draft capability and give that priority.

Shall I open a wishlist bug report for this? Or keep it to myself?

Eric




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Sat, 23 Nov 2019 12:02:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: Amin Bandali <bandali <at> gnu.org>, 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Sat, 23 Nov 2019 13:01:13 +0100
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> For drafts I think it would be easy enough to have the auto-save
> process save the message to nndrafts, while explicit "C-x C-s", "C-c
> C-d" and the gnus-quit prompt would check the server for draft
> capability and give that priority.

Yeah, having `C-c C-d' save messages to \Drafts would be nice.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#38289; Package emacs,gnus. (Sat, 23 Nov 2019 14:21:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Amin Bandali <bandali <at> gnu.org>, 38289 <at> debbugs.gnu.org
Subject: Re: bug#38289: 27.0.50; C-c C-w not working if signature from
 gnus-posting-styles applies
Date: Sat, 23 Nov 2019 06:19:55 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> For drafts I think it would be easy enough to have the auto-save
>> process save the message to nndrafts, while explicit "C-x C-s", "C-c
>> C-d" and the gnus-quit prompt would check the server for draft
>> capability and give that priority.
>
> Yeah, having `C-c C-d' save messages to \Drafts would be nice.

Okay, I'll put this on the (already very long) list. Maybe a new derived
major-mode...




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Dec 2019 12:24:06 GMT) Full text and rfc822 format available.

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

Previous Next


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