Gnus development mailing list
 help / color / mirror / Atom feed
From: dsg@world.std.com (David S. Goldberg)
Subject: Re: matching headers with gnus-posting-styles
Date: 21 Dec 2000 15:52:32 -0500	[thread overview]
Message-ID: <m1bbsu5ijjj.fsf@blackbird.mitre.org> (raw)
In-Reply-To: <m3d7el35uf.fsf@wash-382.res.umass.edu>

posting-styles is applied before (well, while) the message buffer is
generated.  In general that means the To: header will not be filled in
during processing of posting-styles.  To do what you want you either
want one of the addons that sets headers after the fact (search
through the list archives; I don't use them) or, for a reply, here's
an example from my gnus-posting-styles that works (mostly) for me.
This may be over complicated with all the bbdb stuff; feel free to
mail me direct if you have questions about it.  Be aware, though, that
I might not be able to reply for a while...

(gnus-article-reply
 (signature-file
  (let* ((net
	  (save-excursion
	    (set-buffer gnus-article-buffer)
	    (car
	     (cdr
	      (mail-extract-address-components
	       (message-fetch-field
		"From"))))))
	 (rec (car (bbdb-search
		    (bbdb-records) nil nil
		    net nil nil)))
	 (sig (if rec
		  (bbdb-record-getprop
		   rec 'signature))))
    (cond (sig sig)
	  ((string-match ".*:.*personal.*"
			 (or gnus-newsgroup-name ""))
	   "~/.signature-personal")
	  ((string-match ".*emacs.*"
			 (or gnus-newsgroup-name ""))
	   "~/.signature-personal")
	  ((string-match ".*fvwm.*"
			 (or gnus-newsgroup-name ""))
	   "~/.signature-personal")
	  (t "~/.signature-work"))))
 ("From"
  (let* ((net
	  (save-excursion
	    (set-buffer gnus-article-buffer)
	    (car
	     (cdr
	      (mail-extract-address-components
	       (message-fetch-field
		"From"))))))
	 (rec (car (bbdb-search
		    (bbdb-records) nil nil
		    net nil nil)))
	 (mail-from (if rec
			(bbdb-record-getprop
			 rec 'mail-from))))
    (cond (mail-from mail-from)
	  ((string-match ".*:.*personal.*"
			 (or gnus-newsgroup-name ""))
	   "dsg@world.std.com (David S. Goldberg)")
	  ((string-match ".*emacs.*"
			 (or gnus-newsgroup-name ""))
	   "dsg@world.std.com (David S. Goldberg)")
	  (t (concat user-mail-address
		     " (David S. Goldberg)"))))))
-- 
Dave Goldberg
dsg@world.std.com



  reply	other threads:[~2000-12-21 20:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-21 19:15 lewst
2000-12-21 19:57 ` Nick Papadonis
2000-12-21 20:52   ` David S. Goldberg [this message]
2000-12-21 20:34 ` ShengHuo ZHU
2000-12-21 21:59   ` Kai Großjohann
2000-12-21 20:10 lewst
2000-12-21 20:31 ` Charles Sebold

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=m1bbsu5ijjj.fsf@blackbird.mitre.org \
    --to=dsg@world.std.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).