Rename
[emacs.git] / .emacs.d / config / gkar.ganneff.de.org
1 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
2 #+TITLE: gkar.ganneff.de.org - Ganneffs configuration, host specific file for gkar
3 #+DATE: %Y-%m-%d
4 #+SETUPFILE: ~/.emacs.d/elisp/org-templates/level-0.org
5
6 * Machine specific config
7 ** gnus
8 *** Mail access
9 First specific point is how I access my mail. I am using gnus, and I
10 have two hosts to get data from.
11 #+BEGIN_SRC emacs-lisp
12 (setq gnus-secondary-select-methods
13 '((nnml "")
14 (nnimap "gkar"
15 (nnimap-address "localhost")
16 (nnimap-server-port 993)
17 (nnimap-nov-is-evil t)
18 (nnimap-stream ssl)
19 ;(nnimap-fetch-partial-articles "text/")
20 ;(nnimap-stream shell)
21 ;(nnir-search-engine imap)
22 )
23 (nnimap "fry"
24 (nnimap-address "fry.nsb-software.de")
25 (nnimap-server-port 993)
26 (nnimap-stream ssl)
27 (nnimap-nov-is-evil t)
28 ;(nnimap-fetch-partial-articles "text/")
29 (nnir-search-engine imap)
30 )
31 ))
32 #+END_SRC
33
34 Together with the above I do have a =~/.authinfo= file which has lines
35 of the form
36 #+BEGIN_EXAMPLE
37 machine HOSTNAME login USERNAME password PASSWORD port XXX
38 #+END_EXAMPLE
39 where you obviously replace the placeholders. You should ensure that
40 this file has mode 600 to not have others grab your passwords[fn:1]. Or
41 leave it away entirely, then =gnus= will ask you every time you connect.
42
43 *** Search
44 On my desktop I have a notmuch instance running which I use instead of
45 nnir or direct imap searches. It is much better, though for that it has
46 its drawbacks - like building up an own database of mail. Which is the
47 reason only my desktop uses it.
48 #+BEGIN_SRC emacs-lisp :tangle yes
49 (require 'notmuch)
50 (add-hook 'gnus-group-mode-hook 'lld-notmuch-shortcut)
51 (define-key notmuch-show-mode-map (kbd "C-c C-c") 'lld-notmuch-goto-message-in-gnus)
52 (setq notmuch-fcc-dirs nil)
53 ;(setq notmuch-fcc-dirs
54 ; (quote
55 ; (("da-manager@debian.org" . ".Sentmail.DAM")
56 ; (".*" . ".Sentmail"))))
57 (setq notmuch-saved-searches
58 (quote
59 (("inbox" . "tag:inbox")
60 ("unread" . "tag:unread")
61 ("personal unread" . "tag:inbox AND (to:joerg@ganneff.de OR to:joerg@debian.org OR to:joerg@debconf.org)"))))
62
63 (defvar notmuch-hello-refresh-count 0)
64
65 (defun notmuch-hello-refresh-status-message ()
66 (unless no-display
67 (let* ((new-count
68 (string-to-number
69 (car (process-lines notmuch-command "count"))))
70 (diff-count (- new-count notmuch-hello-refresh-count)))
71 (cond
72 ((= notmuch-hello-refresh-count 0)
73 (message "You have %s messages."
74 (notmuch-hello-nice-number new-count)))
75 ((> diff-count 0)
76 (message "You have %s more messages since last refresh."
77 (notmuch-hello-nice-number diff-count)))
78 ((< diff-count 0)
79 (message "You have %s fewer messages since last refresh."
80 (notmuch-hello-nice-number (- diff-count)))))
81 (setq notmuch-hello-refresh-count new-count))))
82
83 (add-hook 'notmuch-hello-refresh-hook 'notmuch-hello-refresh-status-message)
84 #+END_SRC
85
86 *** Outgoing mail copies
87 When I send a mail (or post to a newsgroup) I want copies of that.
88 #+BEGIN_SRC emacs-lisp
89 (setq gnus-message-archive-group
90 '((if (message-news-p)
91 "nnfolder+archive:Sentnews"
92 "nnimap+gkar:Sentmail")))
93 #+END_SRC
94
95 * Footnotes
96
97 [fn:1] And of course have different passwords for imap than for your login.
98
99