[mew-int 00829] Re: mew-cite-fields date
Chris Beggy
chrisb at example.com
Mon Apr 8 10:21:42 JST 2002
On 08 Apr 2002, Tatsuya Kinoshita <tats at example.com> wrote:
> You can do it by `mew-cite-strings-function'.
>
> I give you a sample of ~/.mew.el:
>
> ----
> (setq mew-cite-fields '("Subject:" "Date:" "From:"))
> (setq mew-cite-format "In message \"%s\"\non %s, %s wrote:\n\n")
> (setq mew-cite-prefix-function nil)
> (setq mew-cite-strings-function
> '(lambda ()
> (let ((str (mew-cite-strings)))
> ;; Simplify `Date:'
> (when (string-match "^\\(on .*\\) +[0-9][0-9]:[0-9][0-9][^,]*" str)
> (setq str (replace-match (match-string 1 str) nil t str)))
> ;; Simplify `From:'
> (when (string-match "\\(([^)]+) *\\)\\(<[^>]+> wrote:\n\n\\)$" str)
> (setq str (replace-match (match-string 2 str) nil t str)))
> str))
> ) ;; default value is (function mew-cite-strings)
Thanks for your sample code. I made a small change to get my
desired behavior:
(setq mew-cite-fields '("Date:" "From:"))
(setq mew-cite-format "On %s, %s wrote: \n\n")
(setq mew-cite-strings-function
'(lambda ()
(let ((str (mew-cite-strings)))
;; Simplify `Date:'
(when (string-match " [SMTWF][a-z][a-z],\\(.*\\) +[0-9][0-9]:[0-9][0-9][^,]*" str)
(setq str (replace-match (match-string 1 str) nil t str)))
;; Simplify `From:'
(when (string-match "\\(([^)]+) *\\)\\(<[^>]+> wrote:\n\n\\)$" str)
(setq str (replace-match (match-string 2 str) nil t str)))
str))
)
Thanks.
Chris
More information about the Mew-int
mailing list