summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-11 19:44:35 +0100
committerjao <jao@gnu.org>2021-06-11 19:44:35 +0100
commit50d28f2ec1274feb43a5bc6dfb84ebbf140b619b (patch)
treedd597ce6f4470ccd758b1ab6691a94c2d1190a69
parent330d3743c65aa61991d61090b1b9869bbf484586 (diff)
downloadelibs-50d28f2ec1274feb43a5bc6dfb84ebbf140b619b.tar.gz
elibs-50d28f2ec1274feb43a5bc6dfb84ebbf140b619b.tar.bz2
email tagging tweaks
-rw-r--r--email.org50
-rw-r--r--gnus.org9
2 files changed, 28 insertions, 31 deletions
diff --git a/email.org b/email.org
index d641ede..8b86842 100644
--- a/email.org
+++ b/email.org
@@ -359,7 +359,9 @@
(defun jao-notmuch--q (d0 d1 &optional k qs st)
(let ((q (or (when qs (mapconcat #'identity qs " AND "))
- (format "folder:%s/%s and tag:\"/^(unread|new)$/\"" d0 d1))))
+ (concat "tag:\"/^(unread|new)$/\" AND "
+ (mapconcat (lambda (d) (when d (concat "tag:" d)))
+ (list d0 d1) " AND ")))))
(list :name (concat d0 (when d1 "/") d1)
:key k :query q :search-type (or st 'tree)
:sort-order 'oldest-first)))
@@ -367,20 +369,17 @@
(defun jao-notmuch--mboxes-search (box &rest excluded)
(let ((ms (seq-difference (jao-list-mailboxes box) excluded))
(bp (substring box 0 1)))
- (mapcar `(lambda (m)
- (jao-notmuch--q ,box (car m) (concat ,bp (cdr m))))
+ (mapcar (lambda (m) (jao-notmuch--q box (car m) (concat bp (cdr m))))
(shorten-strings (sort ms #'string<)))))
(setq notmuch-saved-searches
- `(,(jao-notmuch--q "bigml/inbox" nil "bi"
- '("tag:new" "tag:bigml" "tag:inbox"))
- ,(jao-notmuch--q "bigml/support" nil "bs"
- '("tag:new" "tag:support"))
+ `(,(jao-notmuch--q "bigml" "inbox" "bi")
+ ,(jao-notmuch--q "bigml" "support" "bs")
+ ,(jao-notmuch--q "bigml" "bug" "bb")
,@(jao-notmuch--mboxes-search "bigml" "inbox" "support")
,@(jao-notmuch--mboxes-search "jao")
,@(jao-notmuch--mboxes-search "feeds")
- ,(jao-notmuch--q "gmane/emacs" nil "e"
- '("tag:gmane" "tag:new" "tag:emacs"))
+ ,(jao-notmuch--q "gmane" "emacs" "e")
,(jao-notmuch--q "gmane" nil "g"
'("tag:gmane" "tag:new" "not tag:emacs"))
,(jao-notmuch--q "bml/today" nil "tb" '("tag:bigml" "date:1d..") t)
@@ -391,8 +390,9 @@
#+end_src
*** package
#+begin_src emacs-lisp
- (when (< emacs-major-version 28)
- (jao-load-path "notmuch"))
+ (if (< emacs-major-version 28)
+ (jao-load-path "notmuch")
+ (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/"))
(use-package notmuch
;; :ensure t
@@ -700,11 +700,9 @@
#+end_src
*** consult
#+begin_src emacs-lisp
- (when (< emacs-major-version 28)
- (jao-load-path "consult-notmuch"))
+ (jao-load-path "consult-notmuch")
(use-package consult-notmuch
- ;; :ensure t
:init (setq consult-notmuch-authors-width 30)
:config (consult-customize consult-notmuch :preview-key 'any))
@@ -786,7 +784,7 @@
}
function tag_list () {
- notmuch tag "+$1" -- tag:new AND List:${2:-$1}
+ notmuch tag "+$1" $3 -- tag:new AND List:${2:-$1}
}
tag_directory bigml
@@ -810,8 +808,9 @@
tag_list scheme $l
done
- tag_list emacs-bugs bug-gnu-emacs
- tag_list mailutils bug-mailutils
+ tag_list emacs-bugs bug-gnu-emacs -lists
+ tag_list mailutils bug-mailutils -lists
+ tag_list feeds Lobsters +programming -lists
#+end_src
*** expiry shell script
#+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-expire.sh :tangle-mode (identity #o755)
@@ -822,17 +821,12 @@
notmuch tag +deleted -- "$1 AND date:..${2:-3d} AND NOT $spared_tags"
}
- function tag_deleted_foldr {
- tag_deleted "folder:\"/$1/\"" $2
- }
-
- tag_deleted_foldr "bigml.(drivel|lists|deploys|bugs)" 3d
- tag_deleted_foldr "bigml.reports" 1d
- tag_deleted_foldr "jao.(drivel|lists|books|think|local)" 3d
+ tag_deleted "tag:bigml and tag:\"/^(drivel|lists|deploys|bugs)$/\"" 3d
+ tag_deleted "tag:bigml and tag:reports" 1d
+ tag_deleted "tag:bigml AND tag:support" 7d
+ tag_deleted "tag:jao and tag:\"/^(drivel|lists|books|think|local)$/\"" 3d
tag_deleted "tag:feeds" 3d
- tag_deleted "tag:support AND tag:bigml" 7d
-
notmuch new > $HOME/var/log/notmuch-expire.log 2>&1
notmuch compact >> $HOME/var/log/notmuch-expire.log 2>&1
#+end_src
@@ -840,6 +834,6 @@
#+begin_src bash :shebang "#!/bin/bash" :tangle ./bin/notmuch-delete.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
- notmuch compact >> $HOME/var/log/notmuch-expire.log 2>&1
+ notmuch new > $HOME/var/log/notmuch-delete.log 2>&1
+ notmuch compact >> $HOME/var/log/notmuch-delete.log 2>&1
#+end_src
diff --git a/gnus.org b/gnus.org
index 8d2f587..91dc945 100644
--- a/gnus.org
+++ b/gnus.org
@@ -179,11 +179,14 @@
(when jao-gnus-use-maildirs
(add-to-list 'gnus-secondary-select-methods
- '(nnmaildir "bml" (directory "/home/jao/var/maildir/bigml/")))
+ `(nnmaildir "bml" (directory "~/var/mail/bigml/")
+ ,(jao-gnus-search-engine 'gnus-search-notmuch)))
(add-to-list 'gnus-secondary-select-methods
- '(nnmaildir "jao" (directory "/home/jao/var/maildir/jao/")))
+ '(nnmaildir "jao" (directory "~/var/mail/jao/")
+ ,(jao-gnus-search-engine 'gnus-search-notmuch)))
(add-to-list 'gnus-secondary-select-methods
- '(nnmaildir "gmail" (directory "/home/jao/var/maildir/gmail/"))))
+ '(nnmaildir "feeds" (directory "~/var/mail/feeds/")
+ ,(jao-gnus-search-engine 'gnus-search-notmuch))))
#+end_src
* Demons and notifications