本文介绍了每个新闻组时区的日期:标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How to configure emacs/gnus to use per newsgroup time zone in posted messages?

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

I would like to use CET time zone in pl.* newsgroups and UCT in general newsgroups.

推荐答案

我会使用 message-header-setup-hook code> message-send-hook 与此功能:

I would use message-header-setup-hook or message-send-hook with this function:

(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)))))))

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

NB: the code is untested, this is merely a starting point from which you should develop your solution.

这篇关于每个新闻组时区的日期:标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 06:52