info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Automatically filling to-address (tip and question)


From: Cecil Westerhof
Subject: Re: Automatically filling to-address (tip and question)
Date: Tue, 04 May 2010 19:56:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

I did find a much better way to fill the To address. The sequence of the
fields is also not changed. It is possible to later still fill the To
field with the correct value, after having emptied it. (For example when
the reply the field is filled with the address of the sender instead of
with the address of the mailing list.) Is there a function to empty the
To field?

The only problem is that I know how to check for message-mode, but I do
not know how to differentiate between an article and an e-mail message.
With an article for a newsgroup there is no To field. Properly not a
very important problem. What is the chance that the name of a e-mail
folder will look like the name of a newsgroup? Still, if someone knows
how to differentiate ...

    (defvar dcbl-gnus-to-addresses nil
      "A list of group names and to-addesses to use;")
    (setq   dcbl-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")
        ))

    ;; Fill To-address
    (defadvice gnus-summary-mail-other-window (after formalities () activate)
      (dcbl-fill-to-address))

    (defun dcbl-fill-to-address ()
      "Determine what to-address to use on the current message;"
      (let ((to-address nil))
        (when (and (string= major-mode "message-mode")
                   gnus-newsgroup-name
                   (not (message-fetch-field "To")))
          (dolist (item dcbl-gnus-to-addresses)
            (when (string-match (car item) gnus-newsgroup-name)
              (setq to-address (cdr item))))
          (when to-address
            (message-goto-to)
            (insert to-address)
            (message-goto-subject)))))

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


reply via email to

[Prev in Thread] Current Thread [Next in Thread]