From a2b76afc2b92b7706fcd5dfe4e379768c7eebd98 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 25 Feb 2022 18:20:33 +0000 Subject: nnmaildir: another attempt at gnus as a notmuch front-end --- attic/misc.org | 96 +++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 68 insertions(+), 28 deletions(-) (limited to 'attic/misc.org') 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) -- cgit v1.2.3