summaryrefslogtreecommitdiffhomepage
path: root/attic/misc.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-25 18:20:33 +0000
committerjao <jao@gnu.org>2022-02-25 18:21:34 +0000
commita2b76afc2b92b7706fcd5dfe4e379768c7eebd98 (patch)
tree525368e869234226d8f4629f9457a023403b6980 /attic/misc.org
parent472495bfba28cc371ecaf567bc856d9a3aa04b92 (diff)
downloadelibs-a2b76afc2b92b7706fcd5dfe4e379768c7eebd98.tar.gz
elibs-a2b76afc2b92b7706fcd5dfe4e379768c7eebd98.tar.bz2
nnmaildir: another attempt at gnus as a notmuch front-end
Diffstat (limited to 'attic/misc.org')
-rw-r--r--attic/misc.org96
1 files changed, 68 insertions, 28 deletions
diff --git a/attic/misc.org b/attic/misc.org
index 9dd6b24..be5ae99 100644
--- a/attic/misc.org
+++ b/attic/misc.org
@@ -1,33 +1,5 @@
#+title: Miscellaneous config bits that i don't use anymore
-* spam
- #+begin_src emacs-lisp :tangle no
- (setq jao-gnus-ham-groups ".*\\(bigml\\|jao\\|feeds\\)\\..*"
- gnus-spam-process-destinations `((,jao-gnus-ham-groups "nnml:spam"))
- gnus-spam-newsgroup-contents
- `((".*spam.*" gnus-group-spam-classification-spam)
- (,jao-gnus-ham-groups gnus-group-spam-classification-ham))
- gnus-ham-process-destinations
- '((".*\\(jao\\|feeds\\)\\..*" "jao.inbox")
- (".*bigml\\..*" "bigml.inbox"))
- gnus-spam-process-newsgroups
- `((,jao-gnus-ham-groups ((spam spam-use-bogofilter)
- (ham spam-use-bogofilter)
- (spam spam-use-spamassassin)
- (ham spam-use-spamassassin)
- (spam spam-use-blacklist)))
- ("nnml:spam" ((ham spam-use-blacklist)
- (spam spam-use-bogofilter)
- (ham spam-use-bogofilter))))
- spam-use-blacklist t
- spam-use-BBDB nil
- spam-use-bogofilter t
- spam-use-spamassassin nil
- spam-spamassassin-program "spamc"
- spam-split-group "spam")
-
- ;; (spam-initialize)
- #+end_src
* portability macros
#+begin_src emacs-lisp
(defmacro jao-syscase (clauses)
@@ -1113,6 +1085,74 @@
("K" "dislike" jao-streaming-dislike)
("S" "toggle shuffling" jao-spt-toggle-shuffle :if jao-spt-on-p)]])
#+end_src
+* gnus
+*** gnus maildirs
+ #+begin_src emacs-lisp
+ (defvar jao-gnus-use-maildirs nil)
+
+ (when jao-gnus-use-maildirs
+ (defun jao-gnus--maildir (dir)
+ (let ((root (concat "/tmp/mboxes/" dir "/"))
+ (config (concat "~/.notmuch-config-" dir)))
+ (add-to-list
+ 'gnus-secondary-select-methods
+ `(nnmaildir ,dir (directory ,root)
+ (gnus-search-engine gnus-search-notmuch
+ (remove-prefix ,root)
+ (config-file ,config))))))
+ (jao-gnus--maildir "jao")
+ (jao-gnus--maildir "feeds")
+ (jao-gnus--maildir "bigml"))
+
+ #+end_src
+*** gnus spam
+ #+begin_src emacs-lisp :tangle no
+ (setq jao-gnus-ham-groups ".*\\(bigml\\|jao\\|feeds\\)\\..*"
+ gnus-spam-process-destinations `((,jao-gnus-ham-groups "nnml:spam"))
+ gnus-spam-newsgroup-contents
+ `((".*spam.*" gnus-group-spam-classification-spam)
+ (,jao-gnus-ham-groups gnus-group-spam-classification-ham))
+ gnus-ham-process-destinations
+ '((".*\\(jao\\|feeds\\)\\..*" "jao.inbox")
+ (".*bigml\\..*" "bigml.inbox"))
+ gnus-spam-process-newsgroups
+ `((,jao-gnus-ham-groups ((spam spam-use-bogofilter)
+ (ham spam-use-bogofilter)
+ (spam spam-use-spamassassin)
+ (ham spam-use-spamassassin)
+ (spam spam-use-blacklist)))
+ ("nnml:spam" ((ham spam-use-blacklist)
+ (spam spam-use-bogofilter)
+ (ham spam-use-bogofilter))))
+ spam-use-blacklist t
+ spam-use-BBDB nil
+ spam-use-bogofilter t
+ spam-use-spamassassin nil
+ spam-spamassassin-program "spamc"
+ spam-split-group "spam")
+
+ ;; (spam-initialize)
+ #+end_src
+*** notmuch -> gnus
+ #+begin_src emacs-lisp
+ (defun jao-notmuch-goto-message-in-gnus ()
+ "Open a summary buffer containing the current notmuch article."
+ (interactive)
+ (let ((group (jao-maildir-file-to-group (notmuch-show-get-filename)
+ mail-source-directory))
+ (message-id (replace-regexp-in-string "^id:"
+ ""
+ (notmuch-show-get-message-id))))
+ (if (and group message-id)
+ (org-gnus-follow-link group message-id)
+ (message "Couldn't get relevant infos for switching to Gnus."))))
+
+ (defalias 'jao-open-gnus-frame 'jao-afio--goto-mail)
+
+ (eval-after-load "notmuch-show"
+ '(define-key notmuch-show-mode-map (kbd "C-c C-c")
+ #'jao-notmuch-goto-message-in-gnus))
+ #+end_src
* snippets
#+begin_src emacs-lisp
(defun jao-minibuffer--text-with-padding (text)