summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-18 07:09:56 +0100
committerjao <jao@gnu.org>2021-04-18 07:10:46 +0100
commit2fd1979b9ba1df8bfb1291618d5a356a2d33aefa (patch)
tree64cbd81d8571b6c5a9c838dfee21edb51883f06e
parent4dc7928deecc29f7233d913e76453d39703e53be (diff)
downloadelibs-2fd1979b9ba1df8bfb1291618d5a356a2d33aefa.tar.gz
elibs-2fd1979b9ba1df8bfb1291618d5a356a2d33aefa.tar.bz2
notmuch poised for a gnus overtaking
-rw-r--r--.gitignore1
-rw-r--r--email.org130
-rw-r--r--lib/eos/jao-afio.el2
3 files changed, 82 insertions, 51 deletions
diff --git a/.gitignore b/.gitignore
index 1a131a7..919aafa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@
/site
/gnus.el
/init.el
+/bin/
diff --git a/email.org b/email.org
index f3e23c5..a72cf05 100644
--- a/email.org
+++ b/email.org
@@ -1,4 +1,6 @@
#+title: email handling (message mode, bbdb, notmuch, et al.)
+#+property: header-args :tangle no :comments no :results silent :shebang "#!/bin/bash"
+#+auto_tangle: t
* Message mode
*** Customization
@@ -192,14 +194,14 @@
;; (jao-sendmail-gmail)
(jao-sendmail-local)
#+END_SRC
-* notmuch
-*** Package configuration
+* notmucn
+*** notmuch config
#+begin_src emacs-lisp
(defun jao-notmuch--mboxes-search (box)
(mapcar (lambda (m)
`(:name ,m
- :search-type tree
- :query ,(format "folder:%s/%s and tag:unread" box m)))
+ :search-type tree
+ :query ,(format "folder:%s/%s and tag:unread" box m)))
(jao-list-mailboxes box)))
(use-package notmuch
@@ -208,15 +210,16 @@
(setq notmuch-fcc-dirs '(("jao@bigml.com" . "bigml/sent")
(".*" . "jao/sent"))
notmuch-message-headers-visible t
- notmuch-message-headers
- '("Subject" "To" "Cc" "Date" "List-Id"
- "X-Mailer" "User-Agent" "X-User-Agent")
+ notmuch-message-headers '("Subject" "To" "Cc" "Date" "List-Id"
+ "X-Mailer" "User-Agent" "X-User-Agent")
+ notmuch-show-mark-read-tags '("-new" "-unread")
+ notmuch-archive-tags '("+archive" "-new" "-unread")
notmuch-tagging-keys
'(("a" notmuch-archive-tags "Archive")
("u" notmuch-show-mark-read-tags "Mark read")
("f" ("+flagged") "Flag")
- ("s" ("+spam" "-inbox") "Mark as spam")
- ("d" ("+deleted" "-inbox") "Delete"))
+ ("s" ("+spam" "-new") "Mark as spam")
+ ("d" ("+deleted" "-new" "-unread") "Delete"))
notmuch-saved-searches
`((:name "jao" :key "j"
:query "folder:jao/inbox"
@@ -229,17 +232,15 @@
,@(jao-notmuch--mboxes-search "jao")
,@(jao-notmuch--mboxes-search "bigml")
,@(jao-notmuch--mboxes-search "feeds")
- (:name "unread" :query "tag:unread" :key "u" :search-type tree)
+ (:name "new" :query "tag:new" :key "u" :search-type tree)
(:name "sent" :query "tag:sent" :key "t" :search-type tree)
(:name "drafts" :query "tag:draft" :key "d" :search-type tree)
- (:name "all mail" :query "*" :count-query "tag:unread" :key "a"
- :search-type tree))
- notmuch-hello-sections
- '(notmuch-hello-insert-saved-searches
- notmuch-hello-insert-alltags
- notmuch-hello-insert-header
- ;; notmuch-hello-insert-footer
- )
+ (:name "all mail"
+ :query "*" :count-query "tag:new" :key "a" :search-type tree))
+ notmuch-hello-sections '(notmuch-hello-insert-saved-searches
+ notmuch-hello-insert-alltags
+ notmuch-hello-insert-header)
+ notmuch-hello-thousands-separator ","
notmuch-show-all-multipart/alternative-parts nil
notmuch-show-all-tags-list t
notmuch-show-indent-messages-width 2
@@ -248,14 +249,71 @@
notmuch-show-empty-saved-searches nil
notmuch-tree-result-format
'(("date" . "%12s ")
- ("authors" . "%-30s")
- ("subject" . " - %-90s")
+ ("authors" . "%-35s")
+ ((("subject" . "%.95s")) . " %-95s")
("tags" . " (%s)"))
notmuch-unthreaded-result-format notmuch-tree-result-format
notmuch-wash-wrap-lines-length 80)
+ :config
+
+ (defun jao--refresh-agenda () (save-window-excursion (org-agenda-list)))
+ (add-hook 'notmuch-hello-refresh-hook #'jao--refresh-agenda)
+
+ (defun jao-notmuch-goto-message-buffer ()
+ (interactive)
+ (when (window-live-p notmuch-tree-message-window)
+ (select-window notmuch-tree-message-window)))
+
+ (defun jao-notmuch-jump ()
+ (interactive)
+ (let ((resize-mini-windows t)) (notmuch-jump-search)))
+
:bind (:map notmuch-show-mode-map
- ("C-c C-c" . jao-notmuch-goto-message-in-gnus)))
- #+end_SRC
+ ("C-c C-c" . jao-notmuch-goto-message-in-gnus)
+ :map notmuch-hello-mode-map
+ (("j" . jao-notmuch-jump)
+ ("S" . consult-notmuch))
+ :map notmuch-tree-mode-map
+ (("h" . jao-notmuch-goto-message-buffer))))
+ #+end_src
+*** notmuch tagger
+ #+begin_src bash :tangle ./bin/notmuch-tags.sh :tangle-mode (identity #o755)
+ notmuch new > $HOME/var/log/notmuch.log 2>&1
+
+ function tag_deleted {
+ notmuch tag -inbox +deleted -- folder:$1 AND date:..3d AND NOT tag:flagged
+ }
+
+ for f in drivel lists reports deploys; do
+ notmuch tag +bigml +$f -- tag:new AND folder:bigml/$f
+ tag_deleted bigm/$f
+ done;
+
+ for f in inbox support; do
+ notmuch tag +bigml +$f -- tag:new AND folder:bigml/$f
+ done;
+
+ notmuch tag +feeds -- tag:new AND folder:/feeds.+/
+ tag_deleted "/feeds.+/"
+
+ notmuch tag +jao -- tag:new AND folder:/jao.+/
+
+ for f in drivel lists books think; do
+ notmuch tag +$f -- tag:new AND folder:jao/$f
+ tag_deleted jao/$f
+ done
+
+ mkdir -p /tmp/trash/notmuch
+ notmuch search --output=files --format=text0 tag:deleted xargs -r0 rm
+
+ notmuch new >> $HOME/var/log/notmuch.log 2>&1
+ notmuch compact >> $HOME/var/log/notmuch.log 2>&1
+ #+end_src
+*** notmuch expirer
+ #+begin_src bash :tangle ./bin/notmuch-expire.sh :tangle-mode (identity #o755)
+ notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm
+ notmuch new > $HOME/var/log/notmuch-expire.log 2>&1
+ #+end_src
* gnus
*** notmuch -> gnus
#+begin_src emacs-lisp
@@ -301,34 +359,6 @@
nndraft-directory (jao-gnus-dir "drafts")
nnrss-directory (jao-gnus-dir "rss"))
#+end_src
-* Visual message fill column
- #+begin_src emacs-lisp
- (use-package visual-fill-column
- :ensure t
- :init
- (setq-default fringes-outside-margins nil
- visual-fill-column-width 80
- visual-fill-column-fringes-outside-margins nil)
- (setq gnus-treat-fill-long-lines nil)
- :config
- (setq split-window-preferred-function
- #'visual-fill-column-split-window-sensibly)
- :bind ((:map ctl-x-map ("M-f" . visual-fill-column-mode))))
-
- ;; (add-hook 'gnus-article-mode-hook #'visual-line-mode)
- ;; (add-hook 'gnus-article-mode-hook #'visual-fill-column-mode)
-
- ;; Name may be misleading, it does not set `fill-column' (which
- ;; is still used by M-q) in `message-mode', but enables
- ;; auto-filling on a given column.
- ;; (setq message-fill-column nil)
- ;; FIXME: There is no proper way to make fill commands to unfill.
- ;; (add-hook 'message-mode-hook
- ;; (lambda ()
- ;; (setq-local fill-column most-positive-fixnum)))
- ;; (when-require 'visual-fill-column
- ;; (add-hook 'message-mode-hook #'visual-fill-column-mode))
- #+end_src
* Mail this buffer
#+BEGIN_SRC emacs-lisp
(defun jao-mail-this-file ()
diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el
index e6f1e72..0f17d44 100644
--- a/lib/eos/jao-afio.el
+++ b/lib/eos/jao-afio.el
@@ -23,7 +23,7 @@
(defvar jao-open-doc-fun 'find-file)
(defvar jao-afio-mail-function 'gnus)
(defvar jao-afio-use-w3m nil)
-(defvar jao-afio-notmuch-in-web t)
+(defvar jao-afio-notmuch-in-web nil)
(defvar jao-afio-switch-hook nil)
(defvar jao-afio--configs '(?c ?w ?g ?p ?s))