当我使用其中一个*-with-original
函数在emacs中使用gnus
(message
)回复邮件时,我会得到与此类似的引用:
"Doe, John" <johndoe@example.com> writes:
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
> Consectetuer adipiscing elit. Lorem ipsum dolor sit
> amet, consectetuer adipiscing elit.
我希望gnus的行为与其他包含原始邮件日期和时间的MUA一样,如:
On Thu 11 October 2012 09:20:12 "Doe, John" <johndoe@example.com> wrote:
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
> Consectetuer adipiscing elit. Lorem ipsum dolor sit
> amet, consectetuer adipiscing elit.
有没有办法改变报价方式来实现这个目标?
更新2:我现在正在使用更简单的解决方案,来自kindahero的回答:
(setq message-citation-line-function 'message-insert-formatted-citation-line)
(setq message-citation-line-format "On %a, %b %d %Y at %r, %f wrote:")
更新1:根据perh的回答,我最终得到了以下解决方案:
(defun my-citation-line ()
"Inserts name, email, and date"
(when message-reply-headers
(insert "On "
(format-time-string "%a, %b %e, %Y at %r"
(date-to-time (mail-header-date message-reply-headers)))
", "
(or (gnus-extract-address-component-name (mail-header-from message-reply-headers))
"Somebody")
(format " <%s>"
(or (gnus-extract-address-component-email (mail-header-from message-reply-headers))
"somebody@example.com"))
" wrote:\n")))
(setq message-citation-line-function 'my-citation-line)
最终结果如下:
On Fri, Oct 12, 2012 at 03:11:48 PM, John Doe <johndoe@example.com> wrote:
答案 0 :(得分:7)
(setq message-citation-line-function 'message-insert-formatted-citation-line)
(setq message-citation-line-format "On %a, %b %d %Y, %f wrote:\n")
根据你的喜好改变变量..`format-time-string'有选项列表
.emacs中的少行:)
答案 1 :(得分:2)
您可以将message-citation-line-function设置为插入标题的合适函数:
(setq message-citation-line-function 'my-citation-line)
例如,此函数提供名称和非标准化日期:
(defun my-citation-line ()
"Inserts name and date"
(when message-reply-headers
(insert
(or (gnus-extract-address-component-name
(mail-header-from message-reply-headers))
"Somebody")
", "
(mail-header-date message-reply-headers)))
"\n")))