Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Kamen TOMOV <kamen@evrocom.net>
To: info-gnus-english@gnu.org
Subject: `eval' in Posting Styles
Date: Thu, 08 Feb 2007 12:50:07 +0200	[thread overview]
Message-ID: <uhctwly8w.fsf@evrocom.net> (raw)

Hi,

I needed to have a function executed depending on the Posting Style,
e.g. to have a things like that:

(setq gnus-posting-styles
      '(("foo"
	 (eval 'bar))
        ....))

(defun bar ()
       ....)

It looks like the base was laid some time ago and I wonder why wasn't
it implemented fully.

In gnus-msg.el I changed gnus-configure-posting-styles:

      (dolist (result results)
	(add-hook 'message-setup-hook
		  (cond
		   ((eq 'eval (car result))
-		    'ignore)
+		    (cdr result))
		   ((eq 'body (car result))

This way I managed to have the functionality I needed. Do you see any
reason why not to put it into the main branch?

Any suggestions, improvements, etc. are welcome.

-- 
Камен

             reply	other threads:[~2007-02-08 10:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 10:50 Kamen TOMOV [this message]
2007-02-11  9:48 ` Reiner Steib
2007-02-12  7:40   ` Kamen TOMOV

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=uhctwly8w.fsf@evrocom.net \
    --to=kamen@evrocom.net \
    --cc=info-gnus-english@gnu.org \
    /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).