[emacs] start configuring Gnus :)
authorAmin Bandali <bandali@gnu.org>
Wed, 7 Nov 2018 19:31:29 +0000 (14:31 -0500)
committerAmin Bandali <bandali@gnu.org>
Wed, 7 Nov 2018 19:31:29 +0000 (14:31 -0500)
init.org

index 477eef2..ecf3a88 100644 (file)
--- a/init.org
+++ b/init.org
@@ -1746,17 +1746,57 @@ Hopefully temporary.
 (setq amin-gnus-init-file (no-littering-expand-etc-file-name "gnus"))
 
 (use-package gnus
-  :bind ("C-c m" . gnus)
+  :bind ("s-m" . gnus)
   :init
   (setq
-   gnus-init-file        amin-gnus-init-file
+   gnus-select-method
+   '(nnimap "local"
+            (nnimap-address "localhost")
+            (nnimap-stream shell))
+   nnimap-shell-program  "/usr/lib/dovecot/imap -o mail_location=maildir:$MAILDIR/amin:LAYOUT=fs:INBOX=$MAILDIR/amin/Inbox"
+   ;; gnus-init-file        amin-gnus-init-file
    gnus-home-directory   (no-littering-expand-var-file-name "gnus/")
-   gnus-directory        (no-littering-expand-var-file-name "gnus/News/")
-   message-directory     amin-maildir
+   ;; gnus-directory        (no-littering-expand-var-file-name "gnus/News/")
+   ;; message-directory     amin-maildir
    gnus-save-newsrc-file nil
    gnus-read-newsrc-file nil
+   gnus-interactive-exit nil
    gnus-gcc-mark-as-read t))
 
+(use-package gnus-art
+  :config
+  (setq
+   gnus-visible-headers
+   (concat gnus-visible-headers "\\|^List-Id:\\|^X-RT-Originator:")
+   gnus-sorted-header-list
+   '("^From:" "^Subject:" "^Summary:" "^Keywords:"
+     "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
+     "^Newsgroups:" "List-Id:" "^Organization:"
+     "^Date:")
+  ;; local-lapsed article dates
+  ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
+  gnus-article-date-headers '(user-defined)
+  gnus-article-time-format
+  (lambda (time)
+    (let* ((date (format-time-string "%a, %d %b %Y %T %z" time))
+           (local (article-make-date-line date 'local))
+           (combined-lapsed (article-make-date-line date
+                                                    'combined-lapsed))
+           (lapsed (progn
+                     (string-match " (.+" combined-lapsed)
+                     (match-string 0 combined-lapsed))))
+      (concat local lapsed)))))
+
+(use-package gnus-sum
+  :config
+  (setq gnus-extra-headers (append gnus-extra-headers
+                                   '(List-Id X-RT-Originator))))
+
+(use-package nnmail
+  :config
+  (setq nnmail-extra-headers (append nnmail-extra-headers
+                                     '(List-Id X-RT-Originator))))
+
 (use-package mm-decode
   :config
   (setq mm-discouraged-alternatives '("text/html" "text/richtext")))
@@ -1764,11 +1804,13 @@ Hopefully temporary.
 
 # #+begin_src emacs-lisp :tangle (concat gnus-init-file ".el") :mkdirp yes
 #+begin_src emacs-lisp :tangle no
-(setq gnus-select-method
-      '(nnmaildir "gnu"
-                  (directory "~/mail/gnu/")
-                  (directory-files nnheader-directory-files-safe)
-                  (get-new-mail nil)))
+(setq
+ gnus-select-method
+ '(nnimap "local"
+          (nnimap-address "localhost")
+          (nnimap-stream shell))
+ nnimap-shell-program
+ "/usr/lib/dovecot/imap -o maildir:$MAILDIR/amin:LAYOUT=fs:INBOX=$MAILDIR/amin/Inbox")
 #+end_src
 
 ** sendmail
@@ -1813,7 +1855,7 @@ Hopefully temporary.
 
 See [[notmuch:id:87muuqsvci.fsf@fencepost.gnu.org][bug follow-up]].
 
-#+begin_src emacs-lisp
+#+begin_src emacs-lisp :tangle no
 (defun amin/notmuch ()
   "Delete other windows, then launch `notmuch'."
   (interactive