(with-eval-after-load 'notmuch (defun my-notmuch-search-area-banks () "Notmuch saved search 'Area: Banks'." '(and (tag unread) (or (from "transferwise.com") (from "wise.com") (from "mbank.sk") (from "intl.paypal.com") (from "paypal.com") (from "przelewy24.pl") (from "stripe.com")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-area-school () "Notmuch saved search 'Area: School'." '(and (tag unread) (or (from "uopeople.edu") (from "coursera.org") (from "yammer.com") (from "proctoru.com") (from "edupage.org") (from "edupage.info") (from "slobodnaskola.sk") (from "cit.ie") (from "mycit.ie") (from "mtu.ie") (from "instructure.com") (from "digitary.net")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-area-services () "Notmuch saved search 'Area: Services'." '(and (tag unread) (or (from "apple.com") (from "noreply@google.com") (from "accounts.google.com") (from "itunes.com") (from "o2.com") (from "o2.sk") (from "stackoverflow.email") (from "upwork.com") (from "orange.sk") (from "ocs.sun.orange.sk") (from "orange@staffino.com") (from "noreply-purchases@youtube.com") (from "payments-noreply@google.com") (from "support@fastmail.com") (from "sdf.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-area-stores () "Notmuch saved search 'Area: Stores'." '(and (tag unread) (or (subject "Fastmail renewal") (subject "Fastmail payment") (from "ikea.com") (from "bandcamp.com") (from "makeupandvanityset.com") (from "amazon.com") (from "amazon.co.uk") (from "ebay.com") (from "mailer.humblebundle.com") (from "alza.sk") (from "e-smoke.sk") (from "digitalstores.co.uk") (from "restaumatic.com") (from "ikelp.com") (from "bistro.sk") (from "takeaway.com") (from "comgate.cz") (from "123kurier.sk") (from "shopifyemail.com") (from "overenezakaznikmi.sk") (from "tnt.com") (from "fedex.com") (from "gls-slovakia.sk") (from "wolt.com") (from "crowdsupply.com") (from "packeta.sk") (from "futunatura.sk") (from "gopay.cz") (from "veglife.sk") (from "drmax.sk") (from "pizza-primavera.sk") (from "b2b.gpe.cz") (from "vapeklub.sk") (from "shipstation.com") (from "sps-sro.sk") (from "slposta.sk") (from "moergo.com")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-area-work () "Notmuch saved search 'Area: Work'." '(and (tag unread) (or (from "eggheadgames.com") (list "eggheadgames.github.com") (list "enfluid.github.com")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-citar () "Notmuch saved search 'Git: Citar'." '(and (tag unread) (list "emacs-citar.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-corfu () "Notmuch saved search 'Git: Corfu'." '(and (tag unread) (list "corfu.minad.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-gptel () "Notmuch saved search 'Git: GPTel'." '(and (tag unread) (list "gptel.karthink.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-magit () "Notmuch saved search 'Git: Magit'." '(and (tag unread) (list "magit.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-marginalia () "Notmuch saved search 'Git: Marginalia'." '(and (tag unread) (list "marginalia.minad.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-mentor () "Notmuch saved search 'Git: Mentor'." '(and (tag unread) (list "mentor.skangas.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-sensor-watch () "Notmuch saved search 'Git: Sensor Watch'." '(and (tag unread) (list "joeycastillo.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-textbooks () "Notmuch saved search 'Git: Textbooks'." '(and (tag unread) (or (list "discrete-book.oscarlevin.github.com") (list "APEXCalculus.github.com")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-vertico () "Notmuch saved search 'Git: Vertico'." '(and (tag unread) (list "vertico.minad.github.com"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-git-other () "Notmuch saved search 'Git: Other'." `(and (tag unread) (or (and (list "github.com") (not (or ,(my-notmuch-search-git-citar) ,(my-notmuch-search-git-corfu) ,(my-notmuch-search-git-gptel) ,(my-notmuch-search-git-magit) ,(my-notmuch-search-git-marginalia) ,(my-notmuch-search-git-mentor) ,(my-notmuch-search-git-sensor-watch) ,(my-notmuch-search-git-textbooks) ,(my-notmuch-search-git-vertico)))) (or (from "gitlab@mg.gitlab.com") (to "gitlab.com"))))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-egghead-games () "Notmuch saved search 'List: Egghead Games'." '(and (tag unread) (or (to "eg@lists.sr.ht") (list "~eg/eg.lists.sr.ht")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emacs-bug () "Notmuch saved search 'List: Emacs Bug'." '(and (tag unread) (or (from "bug-gnu-emacs@gnu.org") (from "help-debbugs@gnu.org") (from "@debbugs.gnu.org") (to "@debbugs.gnu.org") (list "bug-gnu-emacs.gnu.org")))))
Devel
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emacs-devel () "Notmuch saved search 'List: Emacs Devel'." '(and (tag unread) (or (to "emacs-devel@gnu.org") (list "emacs-devel.gnu.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emacs-help () "Notmuch saved search 'List: Emacs Help'." '(and (tag unread) (or (to "help-gnu-emacs@gnu.org") (to "gnu-emacs-help@gnu.org") (list "help-gnu-emacs.gnu.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emacs-org () "Notmuch saved search 'List: Emacs Org'." '(and (tag unread) (or (to "emacs-orgmode@gnu.org") (list "emacs-orgmode.gnu.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emacs-tangents () "Notmuch saved search 'List: Emacs Tangents'." '(and (tag unread) (to "emacs-tangents@gnu.org"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-emms () "Notmuch saved search 'List: EMMS'." '(and (tag unread) (or (to "emms-help@gnu.org") (list "emms-help.gnu.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-fennel () "Notmuch saved search 'List: Fennel'." '(and (tag unread) (or (to "fennel@lists.sr.ht") (list "~technomancy/fennel.lists.sr.ht") (and (from "noreply@notifs.matrix.org") (subject "Fennel")) (and (from "outgoing@sr.ht") (subject "~technomancy/fennel"))))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-geiser () "Notmuch saved search 'List: Geiser'." '(and (tag unread) (or (to "geiser-users@nongnu.org") (list "geiser-users.nongnu.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-lua () "Notmuch saved search 'List: Lua'." '(and (tag unread) (or (to "lua-l@lists.lua.org") (list "lua-l.lists.lua.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-modus-themes () "Notmuch saved search 'List: Modus Themes'." '(and (tag unread) (or (to "modus-themes@lists.sr.ht") (list "~protesilaos/modus-themes.lists.sr.ht")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-notmuch () "Notmuch saved search 'List: Notmuch'." '(and (tag unread) (or (to "notmuch@notmuchmail.org") (list "@notmuchmail.org")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-list-s7 () "Notmuch saved search 'List: s7'." '(and (tag unread) (or (to "cmdist@ccrma.Stanford.EDU") (list "cmdist.ccrma.stanford.edu")))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-maildir-all-drafts () "Notmuch saved search 'Maildir: All Drafts'." '(or (tag "draft") (folder "Drafts"))))
(with-eval-after-load 'notmuch (defun my-notmuch-search-maildir-all-sent () "Notmuch saved search 'Maildir: All Sent'." '(folder "Sent")))
(with-eval-after-load 'notmuch (defun my-notmuch-search-maildir-spam () "Notmuch saved search 'Maildir: Spam'." '(and (tag unread) (or (tag "spam") (folder "Spam")))))
(with-eval-after-load 'notmuch (let* ((functions #'(my-notmuch-search-area-banks my-notmuch-search-area-school my-notmuch-search-area-services my-notmuch-search-area-stores my-notmuch-search-area-work my-notmuch-search-git-citar my-notmuch-search-git-corfu my-notmuch-search-git-gptel my-notmuch-search-git-magit my-notmuch-search-git-marginalia my-notmuch-search-git-mentor my-notmuch-search-git-sensor-watch my-notmuch-search-git-textbooks my-notmuch-search-git-vertico my-notmuch-search-git-other my-notmuch-search-list-egghead-games my-notmuch-search-list-emacs-bug my-notmuch-search-list-emacs-devel my-notmuch-search-list-emacs-help my-notmuch-search-list-emacs-org my-notmuch-search-list-emacs-tangents my-notmuch-search-list-emms my-notmuch-search-list-fennel my-notmuch-search-list-geiser my-notmuch-search-list-lua my-notmuch-search-list-modus-themes my-notmuch-search-list-notmuch my-notmuch-search-list-s7 my-notmuch-search-maildir-all-drafts my-notmuch-search-maildir-all-sent my-notmuch-search-maildir-spam my-notmuch-search-misc-youtube)) (named-sexps (mapcar (lambda (search) (if-let* ((doc-regexp "Notmuch saved search '\\\(.*\\\)'.") (doc (documentation search t)) (name (and (string-match doc-regexp doc) (match-string 1 doc)))) (cons name (funcall search)) (user-error "Function `%s' documentation not matching: %s" search doc-regexp))) functions)) (inbox (list :name "! Inbox" :query (my-notmuch-query `(and (tag unread) (not (or ,@(mapcar #'cdr named-sexps))))))) (searches (mapcar (lambda (sexp) (list :name (car sexp) :query (my-notmuch-query (cdr sexp)))) named-sexps))) (setopt notmuch-saved-searches (cons inbox searches))))