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