[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Automatically filling to-address (tip and question)
From: |
Cecil Westerhof |
Subject: |
Automatically filling to-address (tip and question) |
Date: |
Tue, 04 May 2010 13:01:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
When I post to a mailing list, I always have to use the same e-mail
address. As a real programmer I am lazy and do not like to do what can
be done by the computer. For this I made the code below.
There is one problem. The sequence of the fields is changed. Normally it
is:
To:
Subject:
From:
Gcc:
With my code it becomes:
Subject:
From:
Gcc:
To:
Can I do something about this?
Let me know if the code could be optimised.
(defvar gnus-to-addresses nil
"A list of group names and to-addesses to use;")
(setq gnus-to-addresses '(
("INBOX\\.Info\\.bbdb" . "bbdb-info@lists.sourceforge.net")
("INBOX\\.Info\\.clisp" . "clisp-list@lists.sourceforge.net")
("INBOX\\.Info\\.ffmpeg" . "ffmpeg-user@mplayerhq.hu")
("INBOX\\.Info.\\Floss" . "floss@vrijschrift.nl")
("INBOX\\.Info\\.OpenOffice" . "gebruikers@nl.openoffice.org")
("INBOX\\.Info\\.openSUSE" . "opensuse-factory@opensuse.org")
("INBOX\\.Info\\.org-mode" . "emacs-orgmode@gnu.org")
("INBOX\\.Info\\.slime" . "slime-devel@common-lisp.net")
("INBOX\\.Info\\.spamassassin" . "users@spamassassin.apache.org")
("INBOX\\.KDE" . "kde-i18n-nl@kde.org")
("INBOX\\.NLLGG\\.Leden" . "stamtafel@lists.nllgg.nl")
("INBOX\\.NLLGG\\.Linux" . "linux@lists.nllgg.nl")
("INBOX\\.NLLGG\\.Starter" . "linux-starter@lists.nllgg.nl")
))
(defun gnus-set-to-address ()
"Determine what to-address to use on the current message;"
(let ((to-address ""))
(if (message-news-p)
(setq to-address nil)
(when gnus-newsgroup-name
(dolist (item gnus-to-addresses)
(when (string-match (car item) gnus-newsgroup-name)
(setq to-address (cdr item))))))
to-address))
;; Posting Styles To Various Groups
(setq gnus-posting-styles
'((".*"
(to (gnus-set-to-address))
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
- Automatically filling to-address (tip and question),
Cecil Westerhof <=