From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/65 Path: news.gmane.org!not-for-mail From: Matthew King Newsgroups: gmane.emacs.gnus.user Subject: Lisp recipe to set From header Date: Fri, 27 Jan 2006 21:34:53 +0000 Organization: UKFSN.ORG Message-ID: <878xt1xsle.fsf@knight.monnsta.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1138483629 12788 80.91.229.2 (28 Jan 2006 21:27:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 Jan 2006 21:27:09 +0000 (UTC) Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sat Jan 28 22:27:06 2006 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F2xaz-0002lO-M7 for gegu-info-gnus-english@m.gmane.org; Sat, 28 Jan 2006 22:26:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F2xQF-0001NF-Vi for gegu-info-gnus-english@m.gmane.org; Sat, 28 Jan 2006 16:15:52 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.cw.net!cw.net!news-FFM2.ecrc.de!newsfeed01.sul.t-online.de!t-online.de!solnet.ch!solnet.ch!news.clara.net!valentin.news.clara.net!news.ukfsn.org!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 27 Original-NNTP-Posting-Host: 84-45-223-57.no-dns-yet.enta.net Original-X-Trace: slavica.ukpost.com 1138397694 31120 84.45.223.57 (27 Jan 2006 21:34:54 GMT) Original-X-Complaints-To: abuse@ukfsn.org Original-NNTP-Posting-Date: Fri, 27 Jan 2006 21:34:54 +0000 (UTC) User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:d5lmnQ7zZMI3JOF9MNtvEwpdqiQ= Original-Xref: shelby.stanford.edu gnu.emacs.gnus:76705 Original-To: info-gnus-english@gnu.org X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:65 Archived-At: I have the following: ;;; Set From header based on To header (setq gnus-posting-styles '(("nn.+:" (From (save-excursion (set-buffer gnus-article-buffer) (message-fetch-field "to")))))) Which, as the comment says, sets the From header to be that of the previous mail's To header. I have problems with my address being in the Cc header instead or with there being more than one address in To, but this is not important. What I really want to do is only set the From address to be one from a pre-set list and to fall back on user-mail-address if there is no match. I don't know anywhere near enough lisp to write this though, so how would I go about doing this? Matthew -- I must take issue with the term "a mere child," for it has been my invariable experience that the company of a mere child is infinitely preferable to that of a mere adult. -- Fran Lebowitz