From b221688313e7c39024417fedda997297ca69a30d Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 28 May 2022 18:59:07 +0100 Subject: notmuch tweaks, including hello feeds grouping --- notmuch.org | 85 ++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 51 insertions(+), 34 deletions(-) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index ee076fa..3b203fe 100644 --- a/notmuch.org +++ b/notmuch.org @@ -70,33 +70,33 @@ (ts (split-string (shell-command-to-string cmd)))) (seq-difference ts (append jao-notmuch--shared-tags (cons tag excl))))) - (defvar jao-notmuch-feed-searches - (append (mapcar #'jao-notmuch--sq '("news" - "fun" - "words" - "computers" - "mailutils" - "notmuch" - "lobsters" - "clojure" - "haskell" - "idris" - "pharo" - "lisp" - "scheme" - "xmobar" - "geiser")) + (defvar jao-notmuch-feed-searches-news + (mapcar #'jao-notmuch--sq '("news" "fun" "words" "computers"))) + + (defvar jao-notmuch-feed-searches-hack + (mapcar #'jao-notmuch--sq + '("xmobar" "geiser" "lobsters" "mailutils" "notmuch"))) + + (defvar jao-notmuch-feed-searches-lang + (append (mapcar #'jao-notmuch--sq + '("clojure" "lisp" "scheme" + "haskell" "idris" "erlang" "pharo")) `(,(jao-notmuch--qn "feeds" "prog" "fp" - '("tag:prog" "not tag:\"/emacs/\""))) - (mapcar #'jao-notmuch--sq '("philosophy" - "math" - "physics" - "sci" - "gr-qc" - "quant-ph")))) + '("tag:prog" "not tag:\"/emacs/\""))))) + + (defvar jao-notmuch-feed-searches-sci + (mapcar #'jao-notmuch--sq + '("philosophy" "math" "physics" "sci" "gr-qc" "quant-ph"))) + + (defvar jao-notmuch-feed-searches + (append jao-notmuch-feed-searches-news + jao-notmuch-feed-searches-hack + jao-notmuch-feed-searches-lang + jao-notmuch-feed-searches-sci)) (defvar jao-notmuch-bigml-searches `(,(jao-notmuch--q "bigml" "inbox" "bi") + ,(jao-notmuch--q "bigml" "alba" "ba") ,(jao-notmuch--q "bigml" "support" "bs") ,(jao-notmuch--q "bigml" "bugs" "bb") ,(jao-notmuch--q "bigml" "drivel" "bd") @@ -119,6 +119,7 @@ (defvar jao-notmuch-emacs-searches `(,(jao-notmuch--sq "emacs" "ee" "emacs" "feeds") + ,(jao-notmuch--sq "emacs-help" "eh" "emacs" "help") ,(jao-notmuch--sq "emacs-github" "eg" "emacs" "github") ,(jao-notmuch--sq "emacs-devel" "ed" "emacs" "devel") ,(jao-notmuch--sq "emacs-bugs" "eb" "emacs" "bugs") @@ -187,6 +188,8 @@ ("sent" "S") ("attachment" "📎") ("deleted" "🗙" (propertize tag 'face '(:underline nil ,@e))) + ;; ("attachment" "+") + ;; ("deleted" "xxx" (propertize tag 'face '(:underline nil ,@e))) ("flagged" "!" (propertize tag 'face ',e)) ("jao" "j") ("bigml" "b") @@ -215,8 +218,8 @@ notmuch-address-internal-completion '(received nil) notmuch-fcc-dirs '(("\\(support\\|education\\)@bigml.com" . nil) - (".*@bigml.com" . "bigml.trove +bigml +sent -new -unread") - (".*" . "jao.trove +jao +sent +trove -new -unread")) + (".*@bigml.com" . "bigml/trove +bigml +sent -new -unread") + (".*" . "jao/trove +jao +sent +trove -new -unread")) notmuch-maildir-use-notmuch-insert t) :config @@ -251,7 +254,8 @@ (let ((notmuch-column-control 1.0) (start (point))) (notmuch-hello-insert-buttons searches) - (indent-rigidly start (point) notmuch-hello-indent))))) + (indent-rigidly start (point) notmuch-hello-indent)) + cnt))) (defun jao-notmuch-hello-insert-inbox-searches () (jao-notmuch-hello--insert-searches jao-notmuch-inbox-searches "inbox")) @@ -264,7 +268,13 @@ (jao-notmuch-hello--insert-searches jao-notmuch-flagged-searches nil)) (defun jao-notmuch-hello-insert-feeds-searches () - (jao-notmuch-hello--insert-searches jao-notmuch-feed-searches "feeds")) + (let ((sect "feeds")) + (dolist (s `(,jao-notmuch-feed-searches-news + ,jao-notmuch-feed-searches-hack + ,jao-notmuch-feed-searches-lang + ,jao-notmuch-feed-searches-sci)) + (let ((i (funcall #'jao-notmuch-hello--insert-searches s sect))) + (setq sect (unless i sect)))))) (defun jao-notmuch-hello-insert-emacs-searches () (jao-notmuch-hello--insert-searches jao-notmuch-emacs-searches "emacs")) @@ -456,13 +466,15 @@ (family (or family "Source Code Pro"))) (dolist (f '(notmuch-tree-match-tree-face notmuch-tree-no-match-tree-face)) - (set-face-attribute f nil :family family :foreground fg)))) + (if family + (set-face-attribute f nil :family family :foreground fg) + (set-face-attribute f nil :foreground fg))))) (use-package notmuch-tree :init (setq notmuch-tree-result-format `(("date" . "%12s ") - ("authors" . "%-25s") + (jao-notmuch-format-author . 25) (jao-notmuch-msg-ticks . ,jao-mails-regexp) (jao-notmuch-tree-and-subject . "%>-85s") (jao-notmuch-format-tags . " (%s)")) @@ -473,15 +485,20 @@ ("authors" . "%-35s") ("subject" . " %-100s") (jao-notmuch-format-tags . " (%s)")) + ;; notmuch-tree-thread-symbols + ;; '((prefix . "─") (top . "─") (top-tee . "┬") + ;; (vertical . "│") (vertical-tee . "├") (bottom . "╰") + ;; (arrow . "")) notmuch-tree-thread-symbols - '((prefix . "─") (top . "─") (top-tee . "┬") - (vertical . "│") (vertical-tee . "├") (bottom . "╰") - (arrow . ""))) + '((prefix . " ") (top . " ") (top-tee . " ") + (vertical . " ") (vertical-tee . " ") (bottom . " ") + (arrow . "")) + ) :config - (when (string-prefix-p "Hack" jao-themes-default-face) - (jao-notmuch-adjust-tree-fonts)) + (jao-notmuch-adjust-tree-fonts + (when (string-prefix-p "Hack" jao-themes-default-face) "Source Code Pro")) (jao-notmuch-tree-setup "T") -- cgit v1.2.3