Tuesday, July 15, 2008

jerry-gnus.el

;;; jerry-gnus.el --- Gnus配置-news服务器基本设置
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;news服务器基本设置
;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;新闻和邮件服务器设置
;;常用新闻服务器:news.cn99.com和news.yaako.com
;;可更换使用,谁快用谁
(setq gnus-select-method '(nntp "news.cn99.com"))

;;启用gnus-agent可以脱页浏览
(gnus-agentize)


;;;;;;;;;;;;
;;外观设置
;;;;;;;;;;;;

;;中文设置
(setq gnus-default-charset 'cn-gb-2312
  gnus-group-name-charset-group-alist '((".*" . gb2312))
  gnus-summary-show-article-charset-alist '((1 . cn-gb-2312) (2 . big5) (3 . chinese-gbk) (4 . utf-8))
  gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown iso-8859-1)
  gnus-group-posting-charset-alist '((".*" gb2312 (gb2312))))
(define-coding-system-alias 'gb18030 'gb2312)

;;窗口设置
(gnus-add-configuration '(article (vertical 1.0 (summary .35 point) (article 1.0))))

;;Group Buffer设置, 自动进入Topic-mode
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)

;;Sumarry Buffer设置
(setq gnus-summary-line-format ":%U%R %B %s %-60=|%4L |%-20,20f |%&user-date; \n")

;;Article Buffer设置
;;设定要显示的头消息格式
(setq gnus-visible-headers
  "^\\(^To:\\|^CC:\\|^From:\\|^Subject:\\|^Date:\\|^Followup-To:
  \\|^X-Newsreader:\\|^User-Agent:\\|^X-Mailer:
  \\|Line:\\|Lines:\\|Content-Type:\\|NNTP-Posting-Host\\)")
;;自动断行,每行72个字符
(add-hook 'message-mode-hook (lambda ()
  (setq fill-column 72)
  (turn-on-auto-fill)))


;;;;;;;;;;;;;;;;;;
;; 回复和发送设置
;;;;;;;;;;;;;;;;;;

;;引用设置:不要原来的签名,引用全文
(setq message-cite-function 'message-cite-original-without-signature)
(add-hook 'mail-citation-hook 'sc-cite-original)

;;在新闻组中,提示确认是r(reply)还是f(follow)
(setq gnus-confirm-mail-reply-to-news t)

;;news基本回复设置
(setq gnus-posting-styles
  '(((message-news-p)
  (name "Jarod Lau")
  (address "jarodlau@163.com")
  )
 ))

;;group parameters设置
(setq gnus-parameters
  '(("Send-.*"
  (total-expire . t)
  (expire-wait . 1))
 ("cn\\..*"
  (auto-expire . t)
  (posting-style
  (name "jerry")
  (address "jarodlau@163.com")
  (User-Agent "Debian/Gnus")
  (signature-file "~/jerry/sig/cn.sig")))
 ("\\(alt\\|comp\\|gnu\\|linux\\|sci\\)\\..*"
  (auto-expire . t)
  (posting-style
  (name "Jarod Lau")
  (address "jarodlau@163.com")
  (User-Agent "Emacs21.4/Gnus5.10.6")
  (signature-file "~/jerry/sig/en.sig")))))

;;;;;;;;;;;;;;;;;;;;;
;;news管理设置
;;;;;;;;;;;;;;;;;;;;;

;;开启记分功能
(setq gnus-use-adaptive-scoring t)
(setq gnus-save-score t)
(add-hook 'message-sent-hook 'gnus-score-followup-article)
(add-hook 'message-sent-hook 'gnus-score-followup-thread)

;;定义自己的计分原则
(defvar gnus-default-adaptive-score-alist
  '((gnus-kill-file-mark (from -10))
  (gnus-unread-mark)
  (gnus-read-mark (from 10) (subject 30))
  (gnus-catchup-mark (subject -10))
  (gnus-killed-mark (from -1) (subject -30))
  (gnus-del-mark (from -2) (subject -15))
  (gnus-ticked-mark (from 10))
  (gnus-dormant-mark (from 5))))

(setq gnus-score-find-score-files-function
  '(gnus-score-find-hierarchical gnus-score-find-bnews bbdb/gnus-score)
  gnus-use-adaptive-scoring t)

;;archive设置
(setq gnus-message-archive-group
  '((if (message-news-p)
  (concat "news." (format-time-string "%Y-%m")))))


;;保存发送的news分别到Send-News
(setq gnus-message-archive-group
  '((if (message-news-p)
  "nnml:Send-News")))

(provide 'jerry-gnus)

;;; jerry-gnus.el ends here

No comments: