;;; -*-Emacs-Lisp-*- ;;; -*- coding: iso-2022-jp -*- ;;; ;;; Gnus の設定ファイル (for Semi-Gnus 6.9.12) ;;; ;;; written by NegI ;;; Lastupdate: Thu Jun 8 00:33:59 2000. ;;; $Id: .gnus.el,v 1.1 2000/04/18 03:25:51 negi Exp negi $ ;;; いろいろ設定 (setq gnus-startup-file "~/Mail/.newsrc" gnus-article-save-directory "~/tmp/articles" gnus-default-article-saver 'gnus-summary-save-in-file pgg-encrypt-for-me t mail-user-agent 'message-user-agent score-mode-coding-system 'ctext gnus-prompt-before-saving nil gnus-save-newsrc-file nil ; ~/.newsrc は書かない gnus-mailing-list-groups "jlug.*" ; ML として扱うグループ gnus-thread-indent-level 2 ; indent は短かめの方が好き gnus-large-newsgroup 100 ; 記事が 200 程度ならすぐ読む gnus-novice-user nil ; Novice じゃないです (^^; gnus-use-long-file-name t ; Unix だし gnus-check-new-newsgroups t ; 新規グループを check する gnus-summary-make-false-root 'adopt ; 迷子の記事をまとめる gnus-summary-gather-subject-limit 'fuzzy gnus-nov-is-evil nil ; NOV を使う gnus-thread-ignore-subject t ; スレッド生成時 Subject: は無視 gnus-auto-select-next 'quietly ; n でじゃんじゃん記事を読む gnus-auto-select-first 'best ; スコアの高い記事を読む gnus-article-time-format "%Y年%m月%d日 %T" gnus-treat-display-smileys nil ; smileys は使わない nnmail-crosspost nil ; メールはクロスポストしない mail-source-delete-incoming t ; テンポラリを消去する default-mime-charset 'iso-2022-jp gnus-info-filename 'gnus-ja) (setq gnus-use-cache t) (setq gnus-uncacheable-groups "^nnml") (setq message-use-multi-frames t message-delete-frame-on-exit t ; 投稿 buffer は別 frame で message-signature nil ; 勝手にシグネチャを挿入しない message-user-organization "KU3G is Utmost Unix Users Group" mime-edit-split-message nil) ; 記事を分割しない ;;; g でgetする講読の範囲 ;(setq gnus-activate-level 3) ;;; アクティブでないグループは表示しない (setq gnus-group-list-inactive-groups nil) ;;; 自分のメールは送り先を表示 (setq gnus-extra-headers '(To Newsgroups) nnmail-extra-headers gnus-extra-headers gnus-ignored-from-addresses "negi\\|neko") ;;; ヘッダに入れる PGP 関係ヘッダ (setq message-my-pgp-headers (concat "X-PGP-Key: http://www.KU3G.org/negi/pgp.txt\n" "X-PGP-Fingerprint: " "02B2 4866 EFC8 8D91 9021 8994 C766 166D 7A46 5426\n")) ;;; ヘッダに入れる Linux なヘッダ (setq message-my-linux-headers (concat "X-Linux: Kondara MNU/Linux 1.1 running on Linux-" linux-version "\n")) ;;; ヘッダに入れる謎なヘッダ (setq message-my-default-moe-headers "愛内里菜 倉木麻衣") (setq message-moe message-my-default-moe-headers) (setq message-my-moe-headers (concat "X-Moe: " message-moe "\n")) ;;; ヘッダにいろいろ挿入 (defun message-insert-etc-headers () (save-excursion (goto-char (point-max)) (beginning-of-line nil) (insert message-my-linux-headers) (insert message-my-pgp-headers) (insert message-my-moe-headers) (insert "X-Attribution: NegI\n"))) ;;; Sender: header をつけない(Gnus 5.4.x 以降) ;;; あと長い行やコントロールキャラクタがあっても文句を言わない (setq message-syntax-checks '((long-lines . disabled) (control-chars . disabled) (sender . disabled) ; ここがポイント )) ;;; フック色々 (add-hook 'gnus-summary-mode-hook '(lambda () ;; Summary モードのフック (local-unset-key "\C-l") (or window-system (local-set-key "\C-h" 'gnus-summary-prev-page)))) (add-hook 'gnus-group-mode-hook '(lambda() ;; Group モードのフック (gnus-topic-mode) ; トピックモード )) (add-hook 'gnus-article-display-hook '(lambda () ;; Article 表示のフック (gnus-article-date-user) (gnus-article-highlight-citation) ;; 引用に色を付ける )) (add-hook 'message-mode-hook '(lambda () ;; Message モードのフック (local-set-key "\C-c>" 'my-comment-region))) (add-hook 'message-sent-hook '(lambda () ;; Message を送る時のフック (gnus-score-followup-article) ;フォロー記事のスコアを上げる (gnus-score-followup-thread))) (add-hook 'message-header-hook '(lambda () (x-face-insert) (message-insert-etc-headers))) (add-hook 'nnmail-prepare-incoming-header-hook '(lambda () ;; メールが来る度に実行されるフック ; (nnmail-remove-leading-whitespace) ; ヘッダの空白を削除 (nnmail-remove-list-identifiers) ; ヘッダから特定文字を消去 ; (nnmail-remove-tabs) ; ヘッダからタブを消去 )) (add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp) (setq gnus-group-line-format "%M\%S\%p\%P\%5y: %(%-40,40g%) %6,6~(cut 2)d\n") ;;; From: 行の調整 ;; Gnus 5.3.x 以前はこう (setq gnus-user-from-line "Masahito Ohtsuka ") ;; Gnus 5.4.x 以降はこう (setq user-mail-address "negi@KU3G.org") ;; Gnus はこれも読むらしい (setq mail-host-address "KU3G.org") ;;; Message-ID はいらない(Gnus 5.4.x 以降) (setq message-required-news-headers '(From Newsgroups Date Subject Message-ID (optional . Organization) Lines (optional . User-Agent))) ;;; Mail でも Message-ID は要らない(Gnus 5.4.5x 以降?) (setq message-required-mail-headers '(From Subject Date (optional . In-Reply-To) Message-ID (optional . Organization) Lines (optional . User-Agent))) ;;; 表示するヘッダ Nifty4U 対応 :-) (setq gnus-visible-headers (concat "^From:\\|" "^Newsgroups:\\|" "^Subject:\\|" "^Date:\\|" "^Followup-To:\\|" "^Organization:\\|" "^Summary:\\|" "^Keywords:\\|" "^Reply-To:\\|" "^Cc:\\|" "^To:\\|" "^Posted-To:\\|" "^Mail-Copies-To:\\|" "^Apparently-To:\\|" "^X-Nifty-Room:\\|" "^X-Newsreader:\\|" "^X-Mailer:\\|" "^X-Dispatcher:\\|" "^User-Agent:\\|" "^Gnus-Warning:")) ;;; 必要ないヘッダは見ない (setq gnus-boring-article-headers '(empty newsgroups followup-to reply-to long-to many-to)) ;;; フェイス ;;; スプールを直接見る ;(setq gnus-select-method '(nnspool "")) ;;; NNTP で見る (setq gnus-select-method '(nntp "news")) ;;; imput で投稿 (setq gnus-post-method '(nnspool "")) ;; inews 起動プログラムでは imput を使う (setq news-inews-program "/home/negi/lib/n4u+/inews-nifty4u") ;(setq news-inews-program "/home/negi/bin/imput") (setq nnspool-inews-switches '("-h") ; -S は inews-nifty4u の方で処理 nnspool-inews-program "/home/negi/lib/n4u+/inews-nifty4u") ;; sendmail 起動プログラムでも imput をつかう ;(setq sendmail-program "/usr/bin/imput") ;(setq sendmail-program "/home/negi/bin/imput") ;;; サマリーバッファのソートポリシー ;; score -> date -> number の順番 (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number gnus-thread-sort-by-date ; gnus-thread-sort-by-score )) ;;; スコア関係 ;(setq gnus-use-adaptive-scoring t) ; 自動採点 ;(setq gnus-summary-mark-below -300) ; 中心線をズラす(from info) ;(setq gnus-home-score-file "all.SCORE") ; グローバルスコアを使う ;(setq gnus-summary-highlight ; 色をいじる ; '(((eq mark gnus-ticked-mark) . gnus-cite-face-3) ; ((> score 1999) . gnus-cite-face-2) ; ((> score 999) . gnus-cite-face-4) ; ((= score 99) . purple) ; ((> score default) . yellow) ; ((< score -999) . gnus-cite-face-10) ; ((< score default) . gnus-cite-face-7))) ;;; グループごとのヘッダの調整 (setq gnus-posting-styles '((message-this-is-news ;; News を出す場合 (name "Masahito Ohtsuka")) (message-this-is-mail ;; Mail を出す場合 (name "おおつかまさひと")))) ;;; References: を改行する ; (defun _message-fill-references () ; (save-excursion ; (save-restriction ; (goto-char (point-min)) ; (when (re-search-forward "^References:\\([\t ]+.*\n\\)+" nil t) ; (narrow-to-region (match-beginning 0) (match-end 0)) ; (let (refs len pt) ; (goto-char (point-min)) ; (while (re-search-forward "<[^<>]*>" nil t) ; (setq refs (append refs (list (match-string 0))))) ; (setq len (length refs)) ; (delete-region (+ (point-min) 11) (point-max)) ; (goto-char (point-max)) ; (cond ((eq len 1) (insert " " (car refs) "\n")) ; ((> len 1) ; (insert " " (pop refs)) ; (setq pt (point)) ; (while refs ; (insert " " (pop refs)) ; (when (> (current-column) 78) ; (goto-char pt) ; (delete-char 1) ; (insert "\n\t") ; (goto-char (point-max))) ; (setq pt (point))) ; (insert "\n")) ; (t (delete-region (point-min) (point-max))))))))) ;(setq message-header-setup-hook nil) ;'_message-fill-references) ;;; nnml の設定 (setq gnus-secondary-select-methods '((nnml "") ; (nnslashdot "") )) ;(setq nnmail-spool-file nil) ;(setq nnmh-get-new-mail nil) ;;; ML のヘッダから外す文字の正規表現 (setq nnmail-list-identifiers "\\[.*[0-9]+\\]") ;;; exprire 関係 (setq gnus-auto-expirable-newsgroups ;;expire するグループの指定 (concat "^nnml:\\(" "ML.*" "\\|" "admin" "\\|" "anag" "\\|" "trash" "\\|" "FSI" "\\|" "SeeYou" "\\)$" )) (setq nnmail-expiry-wait-function ;; グループごとの expire 期間の設定 (lambda (group) (cond ((string= group "ML.installer") 7) ((string= group "ML.linux-new") 3) ((string= group "ML.vine-users") 14) ((string= group "admin") 3) ((string= group "trash") 3) (t 30)))) ;;; メールのバックアップ (setq gnus-message-archive-group '((if (message-news-p) (progn (concat "news." (format-time-string "%Y-%m" (current-time)))) (concat "mail." (format-time-string "%Y-%m" (current-time)))))) ;;; メールの振り分け (load-file "~/.recipient") ;;; off-line ;(setq gnus-agent-expiry-days 3) ; 三日前の記事は expire ;(gnus-agentize) ;;; 下請け関数 ;; Message-id: のマウスクリックで News が読みたい (defun my-browse-url-news (url &optional arg) (set-buffer gnus-summary-buffer) (gnus-summary-goto-article (format "<%s>" (progn (string-match "^[^:]*:\\(.*\\)$" url) (match-string 1 url) )))) (setq browse-url-browser-function '(("^news:" . my-browse-url-news) ("." . browse-url-netscape))) ;; Emasc のバッファで fetchmai を起動する (defun fetchmail () (interactive) (start-process "inetwork" " *inetwork*" "fetchmail") ; (switch-to-buffer " *inetwork*") ) (defun my-comment-region (start end) "行頭に > を入れる" (interactive "r") (save-excursion (goto-char start) (while (<= (point) end) (insert (concat mail-yank-prefix " ")) (re-search-forward "^")))) ;;; Group Palameter を拡張 (add-hook 'gnus-select-group-hook (lambda () (setq bbdb/news-auto-create-p (gnus-group-find-parameter gnus-newsgroup-name 'bbdb-auto-create-p)))) (add-hook 'gnus-select-group-hook (lambda () (let ((my-top (gnus-group-find-parameter gnus-newsgroup-name 'top))) (cond ((null my-top) (setq mu-cite-my-top "おおつかです")) ((string-match "NULL" my-top) (setq mu-cite-my-top nil)) (t (setq mu-cite-my-top my-top)))))) ; (add-hook 'gnus-select-group-hook ; (lambda () ; (let ; ((x-moe ; (gnus-group-find-parameter gnus-newsgroup-name 'moe))) ; (cond ; ((null x-moe) ; (setq message-moe message-my-default-moe-headers)) ; ((string-match "NULL" x-moe) ; (setq message-my-moe-headers nil)) ; (t ; (setq message-moe x-moe))))))