如何配置的Emacs /角马在发布的消息每个新闻组时区使用?
我想用CET时区在PL *新闻组和UCT一般新闻组。
如何配置的Emacs /角马在发布的消息每个新闻组时区使用?
我想用CET时区在PL *新闻组和UCT一般新闻组。
我将使用message-header-setup-hook
或message-send-hook
与此功能:
(defvar date-rewrite-rules
'(("pl" . return-time-string-in-CET)
("." . return-time-string-in-UTC)))
(defun rewrite-date-based-on-newsgroup ()
(save-excursion
(save-restriction
(widen)
(goto-char 0)
(narrow-to-region 0 (search-forward mail-header-separator))
(goto-char 0)
(search-forward-regexp "^Newsgroup: ")
(let ((date-f nil)
(tail date-rewrite-rules))
(while (and (null date-f)
tail)
(let ((rule (pop tail)))
(when (looking-at (car rule))
(setq date-f (cdr rule)))))
(when date-f
(goto-char 0)
(search-forward-regexp "^Date: ")
(delete-region (point) (line-end-position))
(insert (funcall date-f)))))))
注:该代码是未经测试的,这仅仅是一个起点,你应该开发自己的解决方案。