Gnus development mailing list
 help / color / mirror / Atom feed
* Lambda functions in group parameters?
@ 2003-04-16  3:09 Kirk Strauser
  2003-04-16  4:32 ` Michael Shields
  0 siblings, 1 reply; 3+ messages in thread
From: Kirk Strauser @ 2003-04-16  3:09 UTC (permalink / raw)


I'm trying to get Gnus to use per-group values for gnus-message-setup-hook
(mainly so that I can use the mml-secure-message-sign-pgpmime function to
sign email, and the mml-secure-message-sign-pgp function to sign news).  In
my .gnus, I have:

    (add-hook 'gnus-message-setup-hook
              (lambda ()
                (interactive)
                (and setup-hook-function-name
                     (funcall setup-hook-function-name))))

Now, if I edit my top-level ``Gnus'' topic and set
"setup-hook-function-name" to a static default value, then I can override
that value on a per-topic or per-group basis.  This works well.  However,
I've lately decided that I want to intermingle my email and news groups (for
example, to put all of the Debian groups under one common topic, rather than
having seperate topics under "Mail" and "News").  To avoid having to set the
group parameters for way too many newsgroups, I'd like to put something like
this in my ``Gnus'' topic parameters:

    ((posting-style
      (signature-file "~/.signature"))
     (setup-hook-function-name
      '((if
    	(message-news-p)
    	'mml-secure-message-sign-pgp
        'mml-secure-message-sign-pgpmime))))

When I try this, though, I get this error:

   Invalid function: ((if (message-news-p) (quote this-is-a-newsgroup) (quote this-is-a-mailgroup)))

I've tried writing it as a lambda function:

    ((posting-style
      (signature-file "~/.signature"))
     (setup-hook-function-name
      (lambda ()
    	(if (message-news-p)
    	'mml-secure-message-sign-pgp
        'mml-secure-message-sign-pgpmime))))

but I don't get any response - no error message, nothing.  What am I doing
wrong?  This is Gnus, so I know this *has* to be possible somehow.  :)
-- 
Kirk Strauser




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

* Re: Lambda functions in group parameters?
  2003-04-16  3:09 Lambda functions in group parameters? Kirk Strauser
@ 2003-04-16  4:32 ` Michael Shields
  2003-04-16 15:00   ` Kirk Strauser
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Shields @ 2003-04-16  4:32 UTC (permalink / raw)
  Cc: ding

In article <87y92bgmti.fsf@pooh.honeypot.net>,
Kirk Strauser <kirk@strauser.com> wrote:
> I'm trying to get Gnus to use per-group values for gnus-message-setup-hook
> (mainly so that I can use the mml-secure-message-sign-pgpmime function to
> sign email, and the mml-secure-message-sign-pgp function to sign news).

Why not:

    (add-hook 'gnus-message-setup-hook
              (lambda ()
                (if (message-news-p)
                   (mml-secure-message-sign-pgp)
                 (mml-secure-message-sign-pgpmime))))
-- 
Shields.




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

* Re: Lambda functions in group parameters?
  2003-04-16  4:32 ` Michael Shields
@ 2003-04-16 15:00   ` Kirk Strauser
  0 siblings, 0 replies; 3+ messages in thread
From: Kirk Strauser @ 2003-04-16 15:00 UTC (permalink / raw)
  Cc: ding

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

At 2003-04-16T04:32:36Z, Michael Shields <shields@msrl.com> writes:

>> I'm trying to get Gnus to use per-group values for
>> gnus-message-setup-hook (mainly so that I can use the
>> mml-secure-message-sign-pgpmime function to sign email, and the
>> mml-secure-message-sign-pgp function to sign news).

> Why not:
>
>     (add-hook 'gnus-message-setup-hook
>               (lambda ()
>                 (if (message-news-p)
>                    (mml-secure-message-sign-pgp)
>                  (mml-secure-message-sign-pgpmime))))

The reason is that I have some groups where I never sign my email, such as
those for my clients who just can't be made to understand that PGP is not a
virus (well, in the standard sense :) ).  My current setup lets me set a
default method of signing, then configure a different method (or no method
at all) on a per-topic or per-group basis.
-- 
Kirk Strauser

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

end of thread, other threads:[~2003-04-16 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-16  3:09 Lambda functions in group parameters? Kirk Strauser
2003-04-16  4:32 ` Michael Shields
2003-04-16 15:00   ` Kirk Strauser

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