anhnmncb (2008-11-25 15:38 +0800) wrote:
> "John Beckett" writes:
>> While I am in mother-mode, what do people think about quoting email
>> addresses?
> Don't blame me, that's my mail client setting(emacs' gnus), and I have
> no time to see how to configure it ...
If you want just an attribution like "[person] wrote:" where [person] is
the user name (or if it isn't defined then her email address) then add
to following lines to your Gnus' init file (.gnus.el):
(setq message-citation-line-function 'my-message-insert-citation-line)
(defun my-message-insert-citation-line ()
"Insert citation line (attribution) to message.
This function inserts attribution line to the beginning of quoted
message."
(when message-reply-headers
(let* ((fullname (cdr (mail-header-parse-address
(mail-header-from message-reply-headers))))
(address (car (mail-header-parse-address
(mail-header-from message-reply-headers))))
(name (cond (fullname) (address) (t "Anonymous"))))
(insert (format "%s wrote:" name))
(newline 2))))
You can evaluate the code for your current Emacs session with "M-x
eval-region" when the code is inside a region.
Here's the code I use; it insert also international date string:
(setq message-citation-line-function 'my-message-insert-citation-line)
(defun my-message-insert-citation-line ()
"Insert citation line (attribution) to message.
This function inserts attribution line to the beginning of quoted
message."
(when message-reply-headers
(let* ((fullname (cdr (mail-header-parse-address
(mail-header-from message-reply-headers))))
(address (car (mail-header-parse-address
(mail-header-from message-reply-headers))))
(name (cond (fullname) (address) (t "Anonymous")))
(citation-date-list (parse-time-string
(mail-header-date message-reply-headers)))
(year (nth 5 citation-date-list))
(month (nth 4 citation-date-list))
(day (nth 3 citation-date-list))
(hour (nth 2 citation-date-list))
(min (nth 1 citation-date-list))
(timezone-min-total (/ (nth 8 citation-date-list) 60))
(timezone-hour (/ timezone-min-total 60))
(timezone-min (% (abs timezone-min-total) 60))
(timezone (format "%+2.2d%2.2d"
timezone-hour timezone-min)))
(insert (format "%s (%4.4d-%2.2d-%2.2d %2.2d:%2.2d %s) wrote:"
name year month day hour min timezone))
(newline 2))))
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---