chiark / gitweb /
dot/emacs: Configure transient-mark-mode sensibly for later Emacsen.
[profile] / dot / gnus.el
1 ;;; -*- mode: emacs-lisp; coding: utf-8 -*-
2 ;;;
3 ;;; GNUS configuration
4 ;;;
5 ;;; (c) 2009 Mark Wooding
6 ;;;
7
8 ;;;----- Licensing notice ---------------------------------------------------
9 ;;;
10 ;;; This program is free software; you can redistribute it and/or modify
11 ;;; it under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 2 of the License, or
13 ;;; (at your option) any later version.
14 ;;;
15 ;;; This program is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;;; GNU General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with this program; if not, write to the Free Software
22 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
23
24 ;;;--------------------------------------------------------------------------
25 ;;; General Gnus preferences.
26
27 ;; Divide the main groups list by topics.
28 (add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
29 (setq gnus-subscribe-newsgroup-method 'gnus-subscribe-topics)
30
31 ;; Use hacky movemail program to move mail.
32 (setq mail-source-movemail-program "~/bin/movemail-hack")
33
34 ;; Don't force use of a full window.
35 (setq gnus-use-full-window nil)
36
37 ;; Display a slrn-like tree view in the summary window.
38 (setq gnus-use-trees nil)
39 (setq gnus-summary-line-format "%U%R%z%4L %(%[%-16,16f%]%): %B %s\n")
40 (setq gnus-sum-thread-tree-root ">"
41       gnus-sum-thread-tree-false-root ">"
42       gnus-sum-thread-tree-single-indent "="
43       gnus-sum-thread-tree-indent "  ")
44 (if (memq (coding-system-get (terminal-coding-system) 'mime-charset)
45           '(nil utf-8))
46     (setq gnus-sum-thread-tree-leaf-with-other "├─>"
47           gnus-sum-thread-tree-vertical        "│ "
48           gnus-sum-thread-tree-single-leaf     "╰─>")
49   (setq gnus-sum-thread-tree-leaf-with-other   "|->"
50         gnus-sum-thread-tree-vertical          "| "
51         gnus-sum-thread-tree-single-leaf       "`->"))
52
53 ;; Sort threads in a useful way.
54 (setq gnus-thread-sort-functions
55       '(gnus-thread-sort-by-number
56         gnus-thread-sort-by-subject
57         gnus-thread-sort-by-total-score))
58
59 ;; Configure the crypto.
60 (setq mm-verify-option 'known
61       mm-sign-option 'guided
62       mm-decrypt-option 'never)
63
64 ;; Tracking available groups.  These should work for sane servers, but maybe
65 ;; they'll need hacking in the local file.
66 (setq gnus-save-killed-list nil
67       gnus-check-bogus-newsgroups nil
68       gnus-read-active-file 'ask-server)
69
70 ;; Use one article buffer per group.
71 (setq gnus-single-article-buffer nil)
72
73 ;; Don't expand threads on initial opening.
74 (setq gnus-thread-hide-subtree t)
75
76 ;; Don't use strange icons instead of traditional smileys.
77 (setq gnus-treat-display-smileys nil)
78
79 ;; Fairly large numbers of articles are OK; don't bother warning me.
80 (setq gnus-large-newsgroup 500)
81
82 ;; When splitting articles, crossposting is a reasonable thing to do.
83 (setq nnimap-split-crosspost t)
84
85 ;; We may have the misfortune to talk to an Exchange server.
86 (setq imap-enable-exchange-bug-workaround t)
87
88 ;; Save articles in mbox format by default, of course, and save an entire
89 ;; batch with the same name.
90 (setq gnus-prompt-before-saving t
91       gnus-default-article-saver 'gnus-summary-save-in-mail)
92
93 ;; Clean up properly when closing the summary.
94 (defadvice gnus-summary-exit (before mdw-kill-debris compile activate)
95   (gnus-summary-expand-window))
96
97 ;; Configure article display a bit.
98 (defun mdw-gnus-article-setup ()
99   (setq truncate-lines nil
100         truncate-partial-width-windows nil
101         word-wrap t
102         wrap-prefix (concat (propertize "..." 'face 'mdw-ellipsis-face)
103                             " ")))
104 (add-hook 'gnus-article-mode-hook #'mdw-gnus-article-setup)
105
106 ;;;--------------------------------------------------------------------------
107 ;;; Local configuration.
108
109 ;; Fetching news from the local news server seems sensible.
110 (setq gnus-select-method
111       (let ((server (mdw-config 'nntp-server)))
112         (if server
113             `(nntp ,server)
114           '(nnnil ""))))
115
116 ;; Now load a local configuration file.
117 (load "~/.gnus-local.el")
118
119 ;;;----- That's all, folks --------------------------------------------------