Gnus development mailing list
 help / color / mirror / Atom feed
From: Kirk Strauser <kirk@strauser.com>
Subject: Lambda functions in group parameters?
Date: Tue, 15 Apr 2003 22:09:45 -0500	[thread overview]
Message-ID: <87y92bgmti.fsf@pooh.honeypot.net> (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




             reply	other threads:[~2003-04-16  3:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16  3:09 Kirk Strauser [this message]
2003-04-16  4:32 ` Michael Shields
2003-04-16 15:00   ` Kirk Strauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y92bgmti.fsf@pooh.honeypot.net \
    --to=kirk@strauser.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).