Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* signing all mail by default
@ 2014-02-12 10:32 Kevin Brubeck Unhammer
  2014-02-12 11:32 ` Charles Philip Chan
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Brubeck Unhammer @ 2014-02-12 10:32 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 1052 bytes --]


I would love to simply say

    (add-hook 'message-setup-hook 'mml-secure-message-sign)

and have all mail signed by default. Unfortunately, this hook is called
before gnus inserts reply text (so the <#secure thing is put below
quoted text) and for certain emails even makes my Emacs hang (with 100 %
CPU usage).

So instead, I use this mess to sign all email by default (both for
global shortcut C-x m and for R/F/r/f/a from gnus):


    (defadvice gnus-summary-handle-replysign (before always-sign activate)
      ;; the function itself may override this to encrypt as well.
      (mml-secure-message-sign))
    
    (defun mml-sign-unless-called-by-gnus ()
      (unless (boundp 'article)
        ;; If we're called by gnus, article is bound (yes, this is hacky)
        (mml-secure-message-sign)))
    (add-hook 'message-setup-hook 'mml-sign-unless-called-by-gnus)


Is there a less hacky way?


-- 
Kevin Brubeck Unhammer

Never attribute to malice that which is adequately explained by
incompetence or laziness.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 472 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: signing all mail by default
  2014-02-12 10:32 signing all mail by default Kevin Brubeck Unhammer
@ 2014-02-12 11:32 ` Charles Philip Chan
  2014-02-12 12:21   ` Kevin Brubeck Unhammer
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Philip Chan @ 2014-02-12 11:32 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 868 bytes --]

Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:

> I would love to simply say
>
>     (add-hook 'message-setup-hook 'mml-secure-message-sign)
>
> and have all mail signed by default. Unfortunately, this hook is
> called before gnus inserts reply text (so the <#secure thing is put
> below quoted text) and for certain emails even makes my Emacs hang
> (with 100 % CPU usage).

Strange, there must be something in your setting that is preventing
that. The "<#secure method=pgpmime mode=sign>" line is always inserted
below the "--text follows this line--" for me with 0% cpu usage. Try
bisecting your config. Also, I just notice, I am using
"gnus-message-setup-hook" and not "message-setup-hook", so try that
instead.

Charles

-- 
Linux!  Guerrilla UNIX Development     Venimus, Vidimus, Dolavimus.
(By mah@ka4ybr.com, Mark A. Horton KA4YBR)

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

* Re: signing all mail by default
  2014-02-12 11:32 ` Charles Philip Chan
@ 2014-02-12 12:21   ` Kevin Brubeck Unhammer
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Brubeck Unhammer @ 2014-02-12 12:21 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 1124 bytes --]

Charles Philip Chan <cpchan@bell.net> writes:

> Kevin Brubeck Unhammer <unhammer@fsfe.org> writes:
>
>> I would love to simply say
>>
>>     (add-hook 'message-setup-hook 'mml-secure-message-sign)
>>
>> and have all mail signed by default. Unfortunately, this hook is
>> called before gnus inserts reply text (so the <#secure thing is put
>> below quoted text) and for certain emails even makes my Emacs hang
>> (with 100 % CPU usage).
>
> Strange, there must be something in your setting that is preventing
> that. The "<#secure method=pgpmime mode=sign>" line is always inserted
> below the "--text follows this line--" for me with 0% cpu usage. Try
> bisecting your config. Also, I just notice, I am using
> "gnus-message-setup-hook" and not "message-setup-hook", so try that
> instead.

Ah, that worked! Actually, I now have both:

    (add-hook 'gnus-message-setup-hook 'mml-secure-message-sign)
    (add-hook 'message-setup-hook 'mml-secure-message-sign)

and it no longer hangs, and all email gets signed at the right place.
Thank you :-)

-- 
Kevin Brubeck Unhammer

GPG: 0x766AC60C

[-- Attachment #1.2: Type: application/pgp-signature, Size: 472 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

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

end of thread, other threads:[~2014-02-12 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 10:32 signing all mail by default Kevin Brubeck Unhammer
2014-02-12 11:32 ` Charles Philip Chan
2014-02-12 12:21   ` Kevin Brubeck Unhammer

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 NNTP newsgroup(s).