From b2c3ae43cac9c31c24ca82000ba0d6999562a655 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 29 Apr 2022 02:52:56 +0100 Subject: mail nits --- notmuch.org | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'notmuch.org') diff --git a/notmuch.org b/notmuch.org index 4d255ff..ebbb0ff 100644 --- a/notmuch.org +++ b/notmuch.org @@ -95,13 +95,15 @@ `(,(jao-notmuch--qn "feeds" "prog" "fp" '("tag:prog" "not tag:\"/emacs/\""))))) - (defvar jao-notmuch-inbox-searches + (defvar jao-notmuch-bigml-searches `(,(jao-notmuch--q "bigml" "inbox" "bi") ,(jao-notmuch--q "bigml" "support" "bs") ,(jao-notmuch--q "bigml" "bugs" "bb") ,(jao-notmuch--q "bigml" "drivel" "bd") - ,(jao-notmuch--q "bigml" "lists" "bl") - ,(jao-notmuch--q "jao" "inbox" "ji") + ,(jao-notmuch--q "bigml" "lists" "bl"))) + + (defvar jao-notmuch-inbox-searches + `(,(jao-notmuch--q "jao" "inbox" "ji") ,(jao-notmuch--q "jao" "bills" "jb") ,(jao-notmuch--q "jao" "drivel" "jd") ,(jao-notmuch--q "jao" "mdk" "jm") @@ -119,6 +121,7 @@ (setq notmuch-saved-searches (append jao-notmuch-inbox-searches + jao-notmuch-bigml-searches jao-notmuch-feed-searches jao-notmuch-emacs-searches)) @@ -245,6 +248,9 @@ (defun jao-notmuch-hello-insert-inbox-searches () (jao-notmuch-hello--insert-searches jao-notmuch-inbox-searches "inbox")) + (defun jao-notmuch-hello-insert-bigml-searches () + (jao-notmuch-hello--insert-searches jao-notmuch-bigml-searches "bigml")) + (defun jao-notmuch-hello-insert-feeds-searches () (jao-notmuch-hello--insert-searches jao-notmuch-feed-searches "feeds")) @@ -270,14 +276,15 @@ (beginning-of-buffer) (widget-forward 1))) - (defun jao-notmuch-refresh-hello () - (interactive) + (defun jao-notmuch-refresh-hello (&optional agenda) + (interactive "P") (ignore-errors (when (and (string= "Mail" (jao-afio-current-frame)) (derived-mode-p 'notmuch-hello-mode)) (when (not (string-blank-p jao-notmuch-minibuffer-string)) (let ((notmuch-hello-auto-refresh nil)) (notmuch-hello))) - (jao-notmuch-hello-first)))) + (when agenda (jao-notmuch-refresh-agenda)) + (unless (widget-at) (jao-notmuch-hello-first))))) (defvar jao-notmuch-hello--sec-rx "^\\(\\[ [0-9]+\\|All tags:.+\\)") @@ -304,7 +311,8 @@ (use-package notmuch-hello :init (setq notmuch-column-control t - notmuch-hello-sections '(jao-notmuch-hello-insert-inbox-searches + notmuch-hello-sections '(jao-notmuch-hello-insert-bigml-searches + jao-notmuch-hello-insert-inbox-searches jao-notmuch-hello-insert-feeds-searches jao-notmuch-hello-insert-emacs-searches jao-notmuch-hello-insert-dynamic-searches @@ -375,7 +383,7 @@ notmuch-wash-citation-lines-prefix 10 notmuch-wash-citation-lines-suffix 20 notmuch-show-text/html-blocked-images "." - notmuch-show-header-line t) + notmuch-show-header-line " %s") :config @@ -436,7 +444,7 @@ `(("date" . "%12s ") ("authors" . "%-25s") (jao-notmuch-msg-ticks . ,jao-mails-regexp) - (jao-notmuch-tree-and-subject . "%>-80s") + (jao-notmuch-tree-and-subject . "%>-85s") (jao-notmuch-format-tags . " (%s)")) notmuch-unthreaded-result-format notmuch-search-result-format consult-notmuch-result-format @@ -464,12 +472,14 @@ (split-window-right 40) (other-window 1))) + (defvar jao-notmuch--visits 0) + (defun jao-notmuch-after-tree-quit (&optional both) (when (and (not (derived-mode-p 'notmuch-tree-mode 'notmuch-hello-mode)) (save-window-excursion (other-window -1) (derived-mode-p 'notmuch-hello-mode))) (delete-window) - (jao-notmuch-refresh-hello))) + (jao-notmuch-refresh-hello (zerop (mod (cl-incf jao-notmuch--visits) 10))))) (advice-add 'notmuch-tree :before #'jao-notmuch-before-tree) (advice-add 'notmuch-tree-quit :after #'jao-notmuch-after-tree-quit) -- cgit v1.2.3