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

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 22 Nov 2019 00:04:16 +0100

Amin Bandali <[email-masked]> 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