diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-03 07:17:15 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-03 07:38:01 -0700 |
commit | e60b94a24ff9aad2024f94034b201b80521df1b9 (patch) | |
tree | c37dd2d6d43d7a9775d6ee08f85d6b677d250c8a /.emacs.d/init.el | |
parent | d58d321e176a57689d56967ca7cde86b21231d75 (diff) | |
download | dotfiles-e60b94a24ff9aad2024f94034b201b80521df1b9.tar.gz |
don't process spw--lists-browse-searches every time fn is called
Diffstat (limited to '.emacs.d/init.el')
-rw-r--r-- | .emacs.d/init.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 10b2bbe9..bc3a6db4 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1071,7 +1071,11 @@ Two ways to read: `(:name ,name :search-type nil :sort-order newest-first :key ,key :query ,query))))) (add-to-list 'notmuch-saved-searches search t) - (add-to-list 'spw--lists-browse-searches search t)))) + (add-to-list 'spw--lists-browse-searches + (cons (plist-get search :name) + (concat "tag:unread and (" + (plist-get search :query) + ")")) t)))) ;; now prepend views for processing the day's mail addressed to me (let* ((readall (spw--disjoin-queries spw--lists-readall)) @@ -1121,7 +1125,11 @@ Two ways to read: :query ,(concat "tag:unread and " "not (" categorised ")")))) (add-to-list 'notmuch-saved-searches query t) - (add-to-list 'spw--lists-browse-searches query t))) + (add-to-list 'spw--lists-browse-searches + (cons "uncategorised unread" + (concat "tag:unread and (" + categorised + ")")) t))) (spw--standard-notmuch-saved-searches) (defun spw--notmuch-import-gpg () @@ -1135,24 +1143,19 @@ Two ways to read: ;; use of `return' requires cl to be loaded, which advises `dolist' (defun spw--next-unread-group () (interactive) - (let* ((all-queries - (mapcar - (lambda (s) - (cons (plist-get s :name) - (concat "tag:unread and (" (plist-get s :query) ")"))) - spw--lists-browse-searches)) - (already-looking (and (bound-and-true-p notmuch-tree-basic-query) - (seq-contains (mapcar 'cdr all-queries) - notmuch-tree-basic-query - 'string=))) + (let* ((already-looking (and (bound-and-true-p notmuch-tree-basic-query) + (seq-contains + (mapcar 'cdr spw--lists-browse-searches) + notmuch-tree-basic-query + 'string=))) (remaining-queries (when (bound-and-true-p notmuch-tree-basic-query) (seq-drop (seq-drop-while (lambda (q) (not (string= (cdr q) notmuch-tree-basic-query))) - all-queries) 1))) - (queries (or remaining-queries all-queries))) + spw--lists-browse-searches) 1))) + (queries (or remaining-queries spw--lists-browse-searches))) (let ((found-one nil)) (dolist (query queries) (let ((total |