[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to parse "To" and "Cc" headers?
From: |
Cor |
Subject: |
Re: How to parse "To" and "Cc" headers? |
Date: |
Thu, 29 Jan 2009 22:16:10 +0000 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
Some entity, AKA Teemu Likonen <tlikonen@iki.fi>,
wrote this mindboggling stuff:
(selectively-snipped-or-not-p)
> Is there a function in Gnus (or elsewhere in Emacs) for parsing "To" and
> "Cc" headers in the buffer?
>
> My goal is to make my custom message-citation-line-function use Finnish
> or English/international citation line depending on the recipient
> addresses of the message.
My-cite-line function in my .gnus.el that generated the cite line above:
;(defun message-insert-citation-line ()
; "Insert a simple citation line."
; (when message-reply-headers
; (insert "Some entity, AKA " (mail-header-from message-reply-headers)",
;wrote this mindboggling stuff:
;(selectively-snipped-or-not-p)\n\n")))
You could add an if clause with an regular-expression to test if there
is a .fi address or other domains//addresses to be addressed in finnish.
The cite-line-code could be change to:
;(defun message-insert-citation-line ()
; "Insert a simple citation line."
; (when message-reply-headers
;; The new stuff added :
;;; ( if (eq mail-header-from "\.fi$" (
"if the FROM: has an .fi do the first thing"
;;; (insert "Some Finnish " (mail-header-from message-reply-headers)",
;;; more Finnisch Text: \n\n")
"else do this thing"
;;; (insert "Some English " (mail-header-from message-reply-headers)",
;;; more English Text: \n\n"))))))
NOT tested, but the scratch-buffer did not complain sofar,
I know no finnish at all, but you get the idea ;-)
Cor
--
The only difference between GOD and me is that GOD has mercy
It is your right to restrict my rights in your house
but if you try that in my house you could get shot
My other cheek is a .40 JHP