;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; MC's configuration file for Gnus, the Swiss army chainsaw of Mail ;;; and News reading. ;;; ;;; Time-stamp: <2005-10-10 10:15:09 by MC> ;;; ;;; If you copy anything from here, I won't be responsible if it ;;; doesn't behave the way you thought it would. ;;; ;;; M.C. Widerkrantz, mc at hack.org. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Reading News. ;;; My main News server is news.hack.org. (setq gnus-select-method '(nntp "news" (nntp-address "news.hack.org"))) ;;; Some of the news servers I access wants userinfo. I don't want to ;;; type it in manually. (add-hook 'nntp-server-opened-hook 'nntp-send-mode-reader) ;;; I use nnml as backend for storing local mail. Wastes plenty of ;;; i-nodes but it's rather speedy. (setq gnus-secondary-select-methods '((nnml "private"))) ;;; I get my mail from the local spool, but it may be delivered to a ;;; Maildir as well. (setq mail-sources '((file :path "/var/mail/mc") (maildir :path "/home/mc/Maildir"))) ;;; Remove mail we have already fetched. Only reason to have this set ;;; to anything else than t is that you think Gnus will lose your ;;; mail. Useful if you're experimenting with something. (setq mail-source-delete-incoming t) ;;; If you fetch mail with POP3 with APOP authentication, you might ;;; want to fill this in: ;; (setq mail-sources ;; '((pop :server "zoot.hack.org" ;; :password "fooledyou" ;; :authentication apop))) ;;; ;;; News reading settings. ;;; (setq gnus-subscribe-newsgroup-method 'gnus-subscribe-killed ; Don't subscribe to newsgroups automagically. gnus-use-generic-form nil ; gnus-large-newsgroup 300 ; Ask when fetching more articles than this. gnus-auto-select-first nil ; Just show the summary, don't fetch the first article. gnus-auto-select-next nil ; Same thing with next article. gnus-auto-center-subject nil ; No auto centering of the summary line. gnus-use-adaptive-scoring nil ; No scoring. gnus-check-new-newsgroups nil ; Don't check for newly created groups. gnus-save-killed-list nil ; Since we don't bother with new groups, don't remember what groups are killed. gnus-read-active-file 'some) ; Don't read the entire friggin' active file when we connect. ;;; Sort incoming mail. (setq nnmail-split-methods 'nnmail-split-fancy) (setq nnmail-split-fancy '(| ("To\\|Cc" "mc@hack\\.org" "mc") ("To\\|Cc" "mc\\+jobb@hack\\.org" "mc+jobb") ("To\\|Cc" "mc\\+activism@hack\\.org" "mc+activism") ;;; Add any mailing lists you want here, like this: ("To\\|Cc" "listname@domain\\.name" "folder") ;; Catch all folder if nothing else matches. "spam")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Displaying messages ;;; If we have an alternative, don't show HTML or RichText messages at ;;; all. (eval-after-load "mm-decode" '(progn (add-to-list 'mm-discouraged-alternatives "text/html") (add-to-list 'mm-discouraged-alternatives "text/enriched") (add-to-list 'mm-discouraged-alternatives "text/richtext"))) ;;; Wash HTML encoded articles with the built in function. (setq mm-text-html-renderer 'html2text) ;;; Customizing threading in Gnus ;;; Yes, please do threading. But don't bore us; hide things like ;;; subject and killed, but not living subtrees. (setq gnus-show-threads t gnus-thread-hide-subject t gnus-thread-hide-subtree nil gnus-thread-hide-killed t gnus-thread-ignore-subject nil gnus-use-cross-reference nil gnus-nov-is-evil nil) ;;; Fetch no older articles, but thread everything we got. (setq gnus-fetch-old-headers 'nil) ;;; Gather subjects by fuzzy string matching in the same thread if we ;;; don't have any References. (setq gnus-summary-gather-subject-limit 'fuzzy) ;;; Gather threads with use of References header. (setq gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references) (setq gnus-summary-make-false-root 'adopt) ;;; My own key bindings. ;;; ;;; I want to be able to refer to a parent in a thread with $ (as well ;;; as A r) since my keyboard is slightly broken. ;;; ;;; Gnus at times handles long lines erroneously, so I want to be able ;;; to fill long lines with F only at a few times. (add-hook 'gnus-summary-mode-hook (function (lambda () (define-key gnus-summary-mode-map "K" 'gnus-summary-kill-thread) (define-key gnus-summary-mode-map "F" 'gnus-article-fill-long-lines) (define-key gnus-summary-mode-map "$" 'gnus-summary-refer-parent-article) (define-key gnus-summary-mode-map "z" 'scroll-down) (define-key gnus-summary-mode-map "v" 'scroll-up)))) ;;; I want to see To: headers instead of From: headers in my outgoing ;;; archive groups. (setq gnus-extra-headers '(To Newsgroups)) (setq nnmail-extra-headers gnus-extra-headers) ;;; Ignore my own names and addresses. (setq gnus-ignored-from-addresses ".*mc.*@hack\\.org.*\\|.*mc@sics\\.se.*\\|.*mikael\\.cardell@bredband\\.com.*\\|.*mc@relogic\\.se.*") ;;; Very fancy and eyecandy rich summary lines with faces. (setq gnus-summary-same-subject "") (copy-face 'default 'mysubject) (setq gnus-face-1 'mysubject) (copy-face 'default 'mytime) (set-face-foreground 'mytime "indianred2") (setq gnus-face-2 'mytime) (copy-face 'default 'mythreads) (set-face-foreground 'mythreads "indianred2") (setq gnus-face-3 'mythreads) (copy-face 'default 'mygrey) (set-face-foreground 'mygrey "grey") (setq gnus-face-4 'mygrey) (copy-face 'default 'myblack) (set-face-foreground 'myblack "grey60") (setq gnus-face-5 'myblack) (copy-face 'default 'mybiggernumbers) (set-face-foreground 'mybiggernumbers "indianred4") (setq gnus-face-6 'mybiggernumbers) (setq gnus-user-date-format-alist '(((gnus-seconds-today) . "%k:%M") (604800 . "%a %k:%M") ((gnus-seconds-month) . "%a %d") (t . "%Y-%m-%d"))) (setq gnus-summary-line-format (concat "%*%5{%U%R%z%}" "%2{%-10&user-date;%}" "%2{ %}%(%-24,24f%)" "%2{%6k %}" "%2{ %}%3{%B%}%1{%s%}\n")) ;;; How is the Gnus Group Buffer going to look like? (setq gnus-group-line-format "%5{%M\%S\%p%} %G: %y (%t)\n") ;;; I want the Group Buffer divided by "topics" I define. (add-hook 'gnus-group-mode-hook 'gnus-topic-mode) (setq gnus-topic-line-format "%i%n: %A\n") ;;; What should articles look like? ;;; We want headers sorted and will only show a few. (setq gnus-visible-headers "^From:\\|^Reply-To\\|^Organization:\\|^To:\\|^Cc:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Gnus") ;;; Show the article headers in this order. (setq gnus-sorted-header-list '("^From:" "^Reply-To" "^Organization:" "^To:" "^Cc:" "^Newsgroups:" "^Subject:" "^Date:" "^Gnus")) ;;; I want the date to be represented in descending order, dammit! ;;; Long live the ISO date format! ;;; I also want the date to be shown in my own time zone. (setq gnus-article-time-format "%Y-%m-%d %H:%M") ;;; Before, I used the prepare hook, but now, there is the new ;;; display-part hook. ; (add-hook 'gnus-article-prepare-hook 'gnus-article-date-user) (add-hook 'gnus-part-display-hook 'gnus-article-date-user) (setq gnus-treat-buttonize t) ;;; Articles with very long lines should be filled. ;;; I do this manually now. See above for key bindings. ; (setq gnus-treat-fill-long-lines t) ;;; Store ticked or dormant articles locally, so they won't get ;;; expired and lost to me. (setq gnus-use-cache t) (setq gnus-cacheable-groups "^nntp") (setq gnus-cache-directory "~/News/cache") (setq gnus-expiry-wait 7) ;;; Use a per group *Article* buffer, so I can look at several ;;; articles at the same time. (setq gnus-single-article-buffer nil) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Posting ;;; ;;; I want to set posting charset to ISO 8859-1 and transfer encoding ;;; to 8bit all the time. ;;; ;;; This is old. Since I sign stuff with PGP, I can't use 8bit ;;; transfers as I can't be sure that the 8bit characters will not be ;;; converted to, say, Quoted unPrintables when passing through some ;;; nasty MTA. Thus, I use QP myself nowadays. ;;; ;;; Note to self: Is there a better way to do it? Look at ;;; mm-encode.el and pay attention to the variable ;;; mm-content-transfer-encoding-defaults. ;; (setq gnus-group-posting-charset-alist ;; '(("^\\(no\\|fr\\)\\.[^,]*\\(,[ \n]*\\(no\\|fr\\)\\.[^,]*\\)*$" iso-8859-1 ;; (iso-8859-1)) ;; ("^\\(fido7\\|relcom\\)\\.[^,]*\\(,[ \n]*\\(fido7\\|relcom\\)\\.[^,]*\\)*$" koi8-r ;; (koi8-r)) ;; (message-this-is-mail "iso-8859-1" t) ;; (message-this-is-news "iso-8859-1" t))) (setq gnus-group-posting-charset-alist '( (message-this-is-mail "iso-8859-1" t) (message-this-is-news "iso-8859-1" t))) (setq mm-body-charset-encoding-alist '((iso-2022-jp . 7bit) (iso-2022-jp-2 . 7bit) (utf-16 . base64) (utf-16be . base64) (utf-16le . base64) (iso-8859-1 . quoted-printable))) ;;; We want to post news to the same server we are reading the current ;;; group from. (setq gnus-post-method 'current) ;;; Archive my outgoing messages, both mail and news in a group called ;;; out.year-month. Use the nnfolder backend for the archives. (setq gnus-message-archive-group '((concat "out." (format-time-string "%Y-%m" (current-time))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Initialize use of the Insidious Big Brother Database, my address ;;; book, with Gnus. (bbdb-insinuate-gnus) (bbdb-insinuate-message) ;;; Add all addresses in these groups automagically to BBDB. (setq gnus-select-group-hook '(lambda () (setq bbdb/news-auto-create-p (or (string= "mc" gnus-newsgroup-name))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Sending mail ; If using smtpmail: (setq user-mail-address "mc@hack.org") ; To fool smtpmail.el into ; sending a shorter MAIL FROM. (setq my-email-addresses-regexp (concat "mc@lysator\\.liu\\.se" "\\|" "mc@hack\\.org" "\\|" "stavrogin@hack\\.org" "\\|" "mc@gbg\\.hack\\.org" "\\|" "mikael@wibni\\.com")) ;; Don't send carbon copies to myself. Yes, this is, like, really, ;; the variable to use. (setq rmail-dont-reply-to-names my-email-addresses-regexp) ;;; Send my mail directly with SMTP. Uncomment if you want to use the ;;; Emacs Lisp SMTP delivery code. I currently use my local MTA ;;; instead. ;; (setq message-send-mail-function 'smtpmail-send-it) ;;;; My Split Personality. (setq gnus-posting-styles '( (".*" (from "Michael Widerkrantz ") (organization "Temple of the Moby Hack")) ("^frukt" (signature "")) (message-news-p (signature-file "~mc/lib/signatures/delete")))) ;;; Use no signature in posts at the moment. (setq message-signature nil) ;;; If I change my mind, use my own function, see below. ;(setq message-signature 'mc-insert-sig) ;;; Use the entire novel /Neuromancer/ to dig .sig quotes from. (setq yow-file "~mc/public/text/neuromancer.yow") (defun mc-insert-sig () "Insert a quote as signature at the end of the buffer." (save-excursion (goto-char (point-max)) (unless (bolp) (insert "\n")) (when message-signature-insert-empty-line (insert "\n")) (insert "-- \n") (insert "Reverend M. C. Widerkrantz , KotSBSD, Hom. Lud., &c\nhttp://hack.org/mc/\n") (insert "\"") ;; Insert zippyism. If yow-file is set to something else, insert ;; that instead. ;; The canonical yow lines are here: ;; "/usr/local/share/emacs/21.3/etc/yow.lines" (yow 1) (insert "\"") (goto-char (point-max)) (or (bolp) (insert "\n")))) ;;; Start footnote minor mode when writing messages. (add-hook 'message-mode-hook 'footnote-mode) (setq use-hard-newlines t) ;;;; For PGP encryption and decryption support. (require 'pgg) ;; Only sign mail messages, not News postings. (defun mc-message-sign () (if (not message-this-is-news) (mml-secure-message-sign-pgpmime))) (add-hook 'message-setup-hook 'mc-message-sign) (setq mml-default-sign-method "pgp") (setq pgg-cache-passphrase t) (setq pgg-passphrase-cache-expiry (* 8 3600)) ;;; When displaying a signed message, show buttons and show if the ;;; signature was valid. (setq mm-verify-option 'known mm-decrypt-option 'known gnus-article-emulate-mime t gnus-buttonized-mime-types (append (list "multipart/signed" "multipart/encrypted") gnus-buttonized-mime-types)) ;;; Gnus Unplugged (setq gnus-agent-expire-days 7)