diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rwxr-xr-x | bin/notmuch-delete.sh | 6 | ||||
| -rwxr-xr-x | bin/notmuch-gnus-tags.sh | 20 | ||||
| -rwxr-xr-x | bin/notmuch-tags.sh | 109 | ||||
| -rw-r--r-- | custom/jao-custom-email.el | 6 | ||||
| -rw-r--r-- | custom/jao-custom-gnus.el | 96 | ||||
| -rw-r--r-- | custom/jao-custom-notmuch.el | 86 | ||||
| -rw-r--r-- | init.el | 4 | 
8 files changed, 227 insertions, 101 deletions
@@ -8,6 +8,5 @@  /lib/media/espotify-embark.el  /lib/media/espotify.el  /site -/bin/  /lib/net/signel.el  /lib/net/signel.shell diff --git a/bin/notmuch-delete.sh b/bin/notmuch-delete.sh new file mode 100755 index 0000000..fc230a5 --- /dev/null +++ b/bin/notmuch-delete.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# [[file:../mail.org::*delete shell script][delete shell script:1]] +echo "Deleting $(notmuch count tag:deleted) files" +notmuch search --output=files --format=text0 tag:deleted | xargs -r0 rm +notmuch new 2>&1 +# delete shell script:1 ends here diff --git a/bin/notmuch-gnus-tags.sh b/bin/notmuch-gnus-tags.sh new file mode 100755 index 0000000..23e1358 --- /dev/null +++ b/bin/notmuch-gnus-tags.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# [[file:../mail.org::*notmuch tags][notmuch tags:1]] +notmuch new +[[ $1 ]] && notmuch compact + +for b in ~/.emacs.d/gnus/Mail/*; do +  b="${b##*/}" +  e="${b##*.}" +  b="${b%.*}" +  if [[ $e != $b ]]; then +    notmuch tag "+$b" "+$e" -- tag:new and "folder:\"/(gnus/)?$b.$e/\""; +  else +    notmuch tag "+$b" -- tag:new and "folder:\"/(gnus/)?$b/\""; +  fi +done + +notmuch-tags.sh + +notmuch tag +trove folder:/trove/ and not tag:trove +# notmuch tags:1 ends here diff --git a/bin/notmuch-tags.sh b/bin/notmuch-tags.sh new file mode 100755 index 0000000..3a6cbef --- /dev/null +++ b/bin/notmuch-tags.sh @@ -0,0 +1,109 @@ +#!/bin/bash + +for f in local feeds bigml jao; do +  notmuch tag +$f -- tag:new and folder:$f +done +function tag_list () { +  x=${2:-$1} +  notmuch tag "+$1" -prog -drivel +lists "$3" "$4" -- "tag:new AND (List:$x OR Xref:$x)" +} + +for l in clojure elixir idris haskell erlang pharo; do +  tag_list $l +done + +tag_list idris idris2 +tag_list pharo 6f667565c2569234585a7be77mc + +for l in haskellweekly commercialhaskell agda xmonad caml; do +  tag_list haskell $l +done + +for l in xmobar notmuch mailutils lobsters; do +  tag_list $l +done + +for l in kawa chicken guile gambit scheme chez racket; do +  tag_list scheme $l +done + +# emacsy lists +for l in emacs-orgmode ding bbdb info-gnus-english; do +  tag_list emacs $l +done + +for l in emacs-devel emacs-diffs; do +  tag_list $l $l -emacs +  notmuch tag "+$l" -emacs -prog -- tag:new AND to:$l +done + +tag_list emacs-bugs bug-gnu-emacs -emacs +tag_list emacs-help help-gnu-emacs -emacs + +for l in consult embark vertico marginalia orderless corfu; do +  tag_list emacs-github $l -emacs +done + +tag_list hacking info-gnu +tag_list mdk bug-mdk -hacking +tag_list geiser geiser -scheme -emacs +function tag_bigml { +  query="(tag:bigml from:@bigml or to:@bigml) and tag:new and $1" +  shift +  notmuch tag -inbox $* -- $query +} + +function tag_drivel { +  for f in $*; do +    tag_bigml "from:\"/.*($f).*/\"" +drivel -lists -deploys; +  done +} + +tag_bigml "tag:new" +bigml -jao +tag_bigml "from:/.*uk/" +alba -drivel +tag_bigml "from:mbmcommercial" +alba -drivel +tag_bigml "to:info@bigml or from:/info/" +drivel + +tag_bigml "List:bigmlcom" +lists +tag_bigml "List:whizzml" +lists +tag_bigml "List:github" +lists +tag_bigml "(List:bigmlcom/wintermute OR List:bigmlcom/universe)" +bugs -lists -drivel +tag_bigml "List:support OR List:education" +support -inbox -drivel -lists +tag_bigml "from:\"BigML Support Transcript\"" -new +deleted +tag_bigml "from:production_reports@bigml.com" +deploys + +tag_bigml "subject:\"/.*(Confirmation code|Sameroom).*/\"" +drivel -lists +tag_drivel "gotowebinar\\.com" "digit\\.fyi" "noreply" "no-reply" +tag_drivel "slack\\.com" "globalvia\\." "ai-forum\\.com" "gsuite" "google voice" +tag_drivel "techcrunch\\.com" "demos@" "cognitionx\\." "cogx" +tag_drivel "events@" "marketing@" "security@" "info@" +tag_drivel "getrevue.com" "calendar-notification" "ed\\.ac\\.uk" +function killfile () { +  notmuch tag -new -unread $2 -- tag:new AND $1 +} + +killfile "(tag:spam OR tag:trash)" + +killfile "from:incal@dataswamp.org" +killfile "from:\"Planet Clojure: Eric Normand\"" +killfile "from:\"Planet Clojure: Ivan Grishaev\"" + +killfile "subject:prefclean from:apt-listbugs" +killfile "subject:open-thread AND Rss:astralcodexten" +1d +killfile "subject:hidden-thread AND Rss:astralcodexten" +deleted + +# gfeeds="grep -o -e feeds.*@localhost $HOME/.config/rss2email.cfg" +# for f in $($gfeeds | sort | uniq); do +#   ftag=$(echo $f | sed 's/feeds.\(.*\)@localhost/\1/'); +#   notmuch tag +rss +feeds +$ftag -- tag:new AND folder:feeds AND to:$f +# done + +notmuch tag +write +jao -words -drivel -feeds \ +        -- "tag:new AND from:/campusdee?scrip?tura/" + +notmuch tag +logwatch -- "tag:new AND subject:logwatch" + +notmuch tag +mdk -- subject:mdk + +notmuch tag -drivel -new -unread -inbox +sent +jao -- \ +        "tag:new AND from:\"/mail@jao.io|jao@gnu.org|jaor@pm.me/\"" diff --git a/custom/jao-custom-email.el b/custom/jao-custom-email.el index a3d1a92..aaaf856 100644 --- a/custom/jao-custom-email.el +++ b/custom/jao-custom-email.el @@ -9,7 +9,7 @@  ;;; personal emails and others  (defvar jao-mails) -(defvar jao-extra-mails) +(defvar jao-extra-mails nil)  (defvar jao-mails-regexp (regexp-opt jao-mails))  ;;; gnus @@ -21,7 +21,7 @@        message-directory (expand-file-name "Mail" gnus-home-directory)        mail-source-directory (expand-file-name "Mail" gnus-home-directory))  ;;; proton -(use-package jao-proton-utils) +(jao-when-linux (use-package jao-proton-utils))  ;;; message mode  ;;;; customization @@ -224,7 +224,7 @@          message-sendmail-envelope-from 'header          mail-envelope-from 'header)) -(jao-sendmail-local) +(jao-when-linux (jao-sendmail-local))  ;;; bbdb  ;; (jao-load-path "bbdb/lisp") diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index ce77285..3165372 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -42,51 +42,39 @@        gnus-generate-tree-function 'gnus-generate-horizontal-tree        gnus-tree-minimize-window nil) -(when jao-gnus-use-three-panes - -  ;; (dolist (m '(calendar-mode org-agenda-mode gnus-group-mode)) -  ;;   (add-to-list 'display-buffer-alist `((major-mode . ,m) (dedicated t)))) - -  (setq calendar-left-margin 6) - -  (let ((side-bar '(vertical 1.0 -                             ("inbox.org" 0.4) -                             ("*Org Agenda*" 1.0) -                             ("*Calendar*" 8))) -        (wide-len jao-gnus-wide-width) -        (groups-len jao-gnus-groups-width) -        (summary-len (- jao-gnus-wide-width jao-gnus-groups-width))) -    (gnus-add-configuration -     `(article -       (horizontal 1.0 -                   (vertical ,groups-len (group 1.0)) -                   (vertical ,summary-len -                             (summary 0.25 point) -                             (article 1.0)) -                   ,side-bar))) - -    (gnus-add-configuration -     `(group (horizontal 1.0 (group ,wide-len point) ,side-bar))) - -    (gnus-add-configuration -     `(message (horizontal 1.0 (message ,wide-len point) ,side-bar))) - -    (gnus-add-configuration -     `(reply-yank (horizontal 1.0 (message ,wide-len point) ,side-bar))) - -    (gnus-add-configuration -     `(summary -       (horizontal 1.0 -                   (vertical ,groups-len (group 1.0)) -                   (vertical ,summary-len (summary 1.0 point)) -                   ,side-bar))) - -    (gnus-add-configuration -     `(reply -       (horizontal 1.0 -                   (message ,(- wide-len 100) point) -                   (article 100) -                   ,side-bar))))) +(setq calendar-left-margin 6) + +(let ((wide-len jao-gnus-wide-width) +      (groups-len jao-gnus-groups-width) +      (summary-len (- jao-gnus-wide-width jao-gnus-groups-width))) +  (gnus-add-configuration +   `(article +     (horizontal 1.0 +                 (vertical ,groups-len (group 1.0)) +                 (vertical 1.0 +                           (summary 0.25 point) +                           (article 1.0))))) + +  ;; (gnus-add-configuration +  ;;  `(group (horizontal 1.0 (group ,wide-len point)))) + +  (gnus-add-configuration +   `(message (horizontal 1.0 (message ,wide-len point)))) + +  (gnus-add-configuration +   `(reply-yank (horizontal 1.0 (message ,wide-len point)))) + +  (gnus-add-configuration +   `(summary +     (horizontal 1.0 +                 (vertical ,groups-len (group 1.0)) +                 (vertical 1.0 (summary 1.0 point))))) + +  (gnus-add-configuration +   `(reply +     (horizontal 1.0 +                 (message ,(- wide-len 100) point) +                 (article 100)))))  ;;;; no blue icon  (advice-add 'gnus-mode-line-buffer-identification :override #'identity) @@ -324,8 +312,8 @@           (w (- (or w (window-width)) d)))      (setq gnus-summary-line-format (format jao-gnus--summary-line-fmt w)))) -(add-hook 'gnus-select-group-hook 'jao-gnus--set-summary-line) -;; (jao-gnus--set-summary-line 187) +;; (add-hook 'gnus-select-group-hook 'jao-gnus--set-summary-line) +;; (jao-gnus--set-summary-line 150)  (add-to-list 'nnmail-extra-headers 'Cc)  (add-to-list 'nnmail-extra-headers 'BCc) @@ -630,12 +618,13 @@    (interactive)    (gnus-demon-add-handler 'jao-gnus--scan 5 1)) -(jao-gnus-add-demon) -(gnus-demon-init) - -;; this is, in theory, not needed; but at some point in the way to emacs -;; version 31 this idle timers have ceased to work after a sleep/awake cycle -(add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon) +(jao-when-linux + (jao-gnus-add-demon) + ;; (gnus-demon-remove-handler 'jao-gnus--scan) + (gnus-demon-init) + ;; this is, in theory, not needed; but at some point in the way to emacs + ;; version 31 this idle timers have ceased to work after a sleep/awake cycle + (jao-when-linux (add-to-list 'jao-sleep-awake-functions #'jao-gnus-add-demon)))  ;;; add-ons  ;;;; notifications @@ -785,6 +774,7 @@  (jao-load-path "consult-notmuch")  (use-package consult-notmuch +  :ensure t    :bind (:map gnus-group-mode-map ("S" . #'jao-gnus-consult-notmuch)))  ;;; keyboard shortcuts diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 42d9e12..30b0976 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -199,9 +199,9 @@            ("signed")            ("new" "ยท")            ("replied" "โฉ" (propertize tag 'face '(:family "Fira Code"))) -          ("sent" "๐ช") -          ("attachment" "๐") -          ("deleted" "๐" (propertize tag 'face '(:underline nil ,@e))) +          ("sent" "โ") +          ("attachment" "โงบ") +          ("deleted" "โ" (propertize tag 'face '(:underline nil ,@e)))            ("flagged" "โ")            ("jao" "j")            ("bigml" "b") @@ -613,46 +613,48 @@  (when jao-notmuch-enabled (setq mm-text-html-renderer 'shr))  ;;; consult -(jao-load-path "consult-notmuch") -(require 'consult-notmuch) -(setq consult-notmuch-newest-first t) -(consult-customize consult-notmuch :preview-key 'any) - -(defvar jao-consult-notmuch-history nil) - -(defvar jao-mailbox-folders '("bigml" "jao")) - -(defun jao-consult-notmuch-folder (&optional tree folder) -  (interactive "P") -  (let* ((folder (if folder -                     (file-name-as-directory folder) -                   (completing-read "Group: " -                                    jao-mailbox-folders -                                    nil nil nil -                                    jao-consult-notmuch-history -                                    "."))) -         (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder)) -         (init (read-string "Initial query: ")) -         (init (format "folder:/%s/ %s" folder init))) -    (if tree (consult-notmuch-tree init) (consult-notmuch init)))) - -(with-eval-after-load "notmuch-hello" -  (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder)) +(jao-when-linux + (jao-load-path "consult-notmuch") + (require 'consult-notmuch) + (setq consult-notmuch-newest-first t) + (consult-customize consult-notmuch :preview-key 'any) + + (defvar jao-consult-notmuch-history nil) + + (defvar jao-mailbox-folders '("bigml" "jao")) + + (defun jao-consult-notmuch-folder (&optional tree folder) +   (interactive "P") +   (let* ((folder (if folder +                      (file-name-as-directory folder) +                    (completing-read "Group: " +                                     jao-mailbox-folders +                                     nil nil nil +                                     jao-consult-notmuch-history +                                     "."))) +          (folder (replace-regexp-in-string "/\\(.\\)" ".\\1" folder)) +          (init (read-string "Initial query: ")) +          (init (format "folder:/%s/ %s" folder init))) +     (if tree (consult-notmuch-tree init) (consult-notmuch init)))) + + (with-eval-after-load "notmuch-hello" +   (define-key notmuch-hello-mode-map "f" #'jao-consult-notmuch-folder)))  ;;; recoll -(defun jao-notmuch-open-file (fname &optional _page) -  (with-temp-buffer -    (insert-file-contents-literally fname) -    (goto-char (point-min)) -    (and (re-search-forward "^Message-ID: <\\([^>]+\\)>$" nil t) -         (notmuch-show (concat "id:" (match-string 1)))))) - -(when jao-notmuch-enabled -  (with-eval-after-load "org" -    (org-link-set-parameters "message" :follow #'jao-notmuch-open-file)) - -  (with-eval-after-load "consult-recoll" -    (add-to-list 'consult-recoll-open-fns -                 '("message/rfc822" . jao-notmuch-open-file)))) +(jao-when-linux + (defun jao-notmuch-open-file (fname &optional _page) +   (with-temp-buffer +     (insert-file-contents-literally fname) +     (goto-char (point-min)) +     (and (re-search-forward "^Message-ID: <\\([^>]+\\)>$" nil t) +          (notmuch-show (concat "id:" (match-string 1)))))) + + (when jao-notmuch-enabled +   (with-eval-after-load "org" +     (org-link-set-parameters "message" :follow #'jao-notmuch-open-file)) + +   (with-eval-after-load "consult-recoll" +     (add-to-list 'consult-recoll-open-fns +                  '("message/rfc822" . jao-notmuch-open-file)))))  ;;; .  (provide 'jao-custom-notmuch) @@ -1159,7 +1159,7 @@  ;;;; afio  (use-package jao-afio -  :if (jao-is-linux) +  ;; :if (jao-is-linux)    :demand t    :config    (jao-afio-setup (not window-system)) @@ -1340,7 +1340,7 @@    (add-hook 'nov-mode-hook #'jao-nov-register-session))  ;;; Email -(jao-when-linux (require 'jao-custom-email)) +(require 'jao-custom-email)  ;;; Shells and terms  ;;;; shell modes  | 
