每日期的新闻组时区:头(Per newsgroup timezone in Date: header

2019-10-19 13:03发布

如何配置的Emacs /角马在发布的消息每个新闻组时区使用?

我想用CET时区在PL *新闻组和UCT一般新闻组。

Answer 1:

我将使用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)))))))

注:该代码是未经测试的,这仅仅是一个起点,你应该开发自己的解决方案。



文章来源: Per newsgroup timezone in Date: header