1

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

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

4

1 回答 1

0

我会使用message-header-setup-hookormessage-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)))))))

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

于 2015-07-17T20:58:45.403 回答