Date中的每个新闻组时区:标题

时间:2014-03-08 15:54:37

标签: emacs elisp emacs24 gnus usenet

如何配置emacs / gnus以在发布的消息中使用每个新闻组时区?

我想在一般新闻组的pl。*新闻组和UCT中使用CET时区。

1 个答案:

答案 0 :(得分:0)

我会将message-header-setup-hookmessage-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)))))))

注意:代码未经测试,这只是您开发解决方案的起点。