diff options
-rw-r--r-- | .config/cron/spwhitton/iris.silentflame.com | 2 | ||||
-rw-r--r-- | .config/cron/swhitton/zephyr.silentflame.com | 2 | ||||
-rw-r--r-- | .emacs.d/init-org.el | 12 | ||||
-rw-r--r-- | .emacs.d/init.el | 207 | ||||
-rwxr-xr-x | .fmail/.notmuch/hooks/post-new | 18 | ||||
-rwxr-xr-x | .fmail/.notmuch/hooks/pre-new | 46 | ||||
-rw-r--r-- | .notmuch-config | 98 | ||||
-rw-r--r-- | .zshrc | 1 | ||||
-rwxr-xr-x | bin/mount-archived-mail | 10 |
9 files changed, 8 insertions, 388 deletions
diff --git a/.config/cron/spwhitton/iris.silentflame.com b/.config/cron/spwhitton/iris.silentflame.com index c61fb9ff..ebb25992 100644 --- a/.config/cron/spwhitton/iris.silentflame.com +++ b/.config/cron/spwhitton/iris.silentflame.com @@ -1,2 +1,2 @@ */15 * * * * chronic doccheckin -*/30 * * * * offline || chronic notmuch new +*/30 * * * * offline || chronic mbsync fastmail diff --git a/.config/cron/swhitton/zephyr.silentflame.com b/.config/cron/swhitton/zephyr.silentflame.com index 0f3c57b5..5adf28df 100644 --- a/.config/cron/swhitton/zephyr.silentflame.com +++ b/.config/cron/swhitton/zephyr.silentflame.com @@ -2,4 +2,4 @@ 0 */2 * * * srem --refresh-emacs */15 * * * * chronic doccheckin -*/30 * * * * chronic notmuch new +*/30 * * * * chronic mbsync fastmail diff --git a/.emacs.d/init-org.el b/.emacs.d/init-org.el index 108f212b..abcdd6ff 100644 --- a/.emacs.d/init-org.el +++ b/.emacs.d/init-org.el @@ -62,10 +62,6 @@ (call-interactively 'htmlize-buffer) (write-file "~/tmp/calendar.html")))) -;;; links to notmuch messages - -(use-package org-notmuch :load-path "/usr/share/org-mode/lisp") - ;;;; ---- preferences ---- @@ -640,9 +636,6 @@ different occasions." '(("t" "Task to be refiled" entry (file "~/doc/org/refile.org") "* TODO %^{Title} %?") - ("m" "Task from mail to be refiled" entry (file "~/doc/org/refile.org") - "* TODO [[notmuch:id:%:message-id][%^{Title|\"%:subject\" from %:fromname}]] -%?") ("n" "Information to be refiled" entry (file "~/doc/org/refile.org") "* %^{Title} %?") @@ -663,11 +656,6 @@ different occasions." ("u" "URI on clipboard" entry (file "~/doc/org/refile.org") "* SOMEDAY [[%^{URI|%x}][%^{Title}]]" :immediate-finish t))) -(setq org-capture-templates-contexts - '(("t" "m" ((in-mode . "notmuch-show-mode"))) - ("t" ((not-in-mode . "notmuch-show-mode"))) - ("m" ((in-mode . "notmuch-show-mode"))))) - ;;; function and advice for my weekly review process (see the ;;; docstrings immediately below) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index e372f8b6..82014992 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -375,17 +375,6 @@ ;;; in more than one window (use-package pointback - ;; this breaks `notmuch-tree-mode' (when notmuch moves to a new - ;; message (e.g. upon hitting 'n'), it deletes the split message - ;; view, creates a new split, and displays the message there. But - ;; deleting the split windows causes pointback mode to move point in - ;; the original window, so point is no longer on the message - ;; displayed. This leads to various strange behaviours) and due to - ;; limitations of `define-globalized-minor-mode', it is not clear - ;; how to cleanly disable pointback only in `notmuch-tree-mode' - ;; buffers (see https://stackoverflow.com/a/6839968). So just - ;; disable for now - :disabled t :commands global-pointback-mode :defer 5 :config @@ -1053,66 +1042,6 @@ :init (setq redtick-history-file nil)) -(use-package notmuch - :if (spw--optional-pkg-available-p "notmuch") - :bind (("C-c m" . notmuch-jump-search) - ("C-c z" . notmuch-tree)) - :init - ;; these let bindings avoid the need to add saved searches to the - ;; database, so that our database remains recreteable from just my - ;; Maildirs - (let ((lists "to:(lists.debian.org or lists.alioth.debian.org) and not to:-announce and not to:spwhitton@spwhitton.name and not to:spwhitton@email.arizona.edu") - (feeds "from:rss@spwhitton.name")) - (setq notmuch-saved-searches - `((:name "all unread" :key "u" :search-type tree - :query "tag:unread") - (:name "personal unread" :key "p" :search-type tree - :query ,(concat - "tag:unread and not to:spwhitton@email.arizona.edu and not (" - lists - ") and not (" - feeds - ")")) - (:name "UA unread" :key "U" :search-type tree - :query "tag:unread and to:spwhitton@email.arizona.edu") - (:name "listserv unread" :key "l" :search-type tree - :query ,(concat "tag:unread and (" lists ")")) - (:name "feeds unread" :key "f" :search-type tree - :query ,(concat "tag:unread and (" feeds ")")) - ;; (:name "flagged" :key "F" :search-type tree - ;; :query "tag:flagged" ) - (:name "sent" :key "s" :search-type tree - :query "from:spwhitton@spwhitton.name or from:spwhitton@email.arizona.edu") - ;; (:name "drafts" :key "d" :search-type tree - ;; :query "tag:draft") - ;; (:name "all mail" :key "a" :search-type tree - ;; :query "*") - ))) - - (setq notmuch-tagging-keys - '(("u" ("+unread") "Mark as unread") - ("s" ("+spam") "Mark as spam") - ("m" ("+killed") "Kill thread") ; 'm' for 'mute' - ("d" ("+deleted") "Send to trash"))) - - ;; this ensures that hitting C-x m right after Emacs starts yields a - ;; message with the correct From: address and User-Agent header, etc. - (defun compose-mail--load-notmuch (&rest ignore) - (require 'notmuch)) - (advice-add 'compose-mail :before #'compose-mail--load-notmuch) - - ;; always decrypt & verify PGP parts - (setq notmuch-crypto-process-mime t) - ;; have Emacs set envelope-from to be on the safe side - (setq mail-specify-envelope-from t - message-sendmail-envelope-from 'header - mail-envelope-from 'header) - - :config - ;; some bindings - (bind-key "S-SPC" 'notmuch-tree-scroll-message-window-back notmuch-tree-mode-map) - (bind-key "g" (notmuch-tree-close-message-pane-and #'notmuch-show-reply) notmuch-tree-mode-map)) - ;;;; ---- functions ---- @@ -1920,42 +1849,6 @@ Ensures the kill ring entry always ends with a newline." 'fixed-pitch (face-attribute face :inherit)))) -;;; shells in Emacs - -(defun spw--shell-here () - "Switch to this project's shell, then change to this buffer's directory." - (interactive) - (let ((here default-directory) - (shell-buffer-name - (if (projectile-project-name) - ;; convention established by `projectile-run-shell' - (concat "*shell " (projectile-project-name) "*") - ;; just one shell buffer, '*shell*', lies outside of any - ;; projectile project - "*shell*"))) - (if (get-buffer shell-buffer-name) - (progn - (pop-to-buffer (get-buffer shell-buffer-name)) - (unless (string= default-directory here) - (spw--shell-cd here)))) - (shell shell-buffer-name))) - -(defun spw--shell-cd (dir) - "Try to change directory to DIR in the current buffer. - -Assumes that the current buffer is `shell-mode'." - ;; it might be more robust to use `comint-send-input', but that - ;; clutters the tail of the shell buffer - (end-of-buffer) - (insert (concat "cd " dir)) - (comint-send-input)) - -(defun spw--remote-shell (host) - "Open or switch to a shell on HOST, via TRAMP." - (interactive "sHost: ") - (let ((default-directory (concat "/" host ":"))) - (shell (concat "*shell " host "*")))) - ;;;; ---- personal settings ---- @@ -1980,6 +1873,9 @@ Assumes that the current buffer is `shell-mode'." ;; fixup-whitespace seems to make just-one-space redundant (bind-key "M-SPC" 'fixup-whitespace) +;; never want to send any e-mail +(unbind-key "C-x m") + ;; fallback expanding (bind-key "M-/" 'hippie-expand) @@ -2254,7 +2150,7 @@ Assumes that the current buffer is `shell-mode'." ;; slightly modify C-c C-z behaviour: fix Mutt and Emacs which both ;; think that there doesn't need to be a newline before the ;; signature dashes - ;; (add-hook 'message-mode-hook 'spw/fix-initial-signature) + (add-hook 'message-mode-hook 'spw/fix-initial-signature) ;; (advice-add 'message-kill-to-signature :after #'spw/fix-signature-kill) (defun spw/debbugs-no-ack () @@ -2291,21 +2187,6 @@ superflous blank quoted lines." ;; them in my sent mail folder (setq mml-secure-openpgp-encrypt-to-self t) - (use-package message-templ - :if (spw--optional-pkg-available-p "message-templ") - :commands message-templ-config-exec - :init - (setq message-templ-alist '(("default" - ("From" . "Sean Whitton <spwhitton@spwhitton.name>")) - ("UA" - ("From" . "Sean Whitton <spwhitton@email.arizona.edu>")) - ("Debian" - ("From" . "Sean Whitton <spwhitton@debian.org>")))) - (setq message-templ-config-alist '(("^To:.*@.*\\(\.edu\\|\.ac\.uk\\)" - (lambda () - (message-templ-apply "UA") - (mml-unsecure-message)))))) - ;; C-c C-b should skip over mml's sign/encrypt lines (it is a bad ;; idea to advise message-goto-body as various functions assume it ;; does not skip over sign/encrypt lines @@ -2317,54 +2198,8 @@ superflous blank quoted lines." (forward-line))) (bind-key "C-c C-b" 'spw--message-goto-body--skip-mml-secure message-mode-map) - (defun spw--message-normalise () - (interactive) - (message-fill-yanked-message) - (spw/compact-blank-lines) - ;; sign messages by default - (mml-secure-message-sign-pgpmime) - ;; set up From address and disable signing where appropriate - (message-templ-config-exec) - (save-excursion - (message-goto-body) - (let ((body (point))) - ;; if the message begins with quoted text, insert a basic - ;; salutation - (when (looking-at "^\\(<#[^\n]+>\n\\)*On .* wrote:$") - (forward-line) - (insert "Hello,\n\n")) - (message-goto-signature) - (unless (eobp) - (end-of-line -1)) - ;; delete trailing whitespace in message body, when that - ;; message body exists (this protects signature dashes and - ;; empty headers) - (when (< body (point)) - (delete-trailing-whitespace body (point))) - ;; ensure there is a newline before the signature dashes - (unless (bolp) - (insert "\n"))))) - - ;; try to strip signatures when citing - (setq notmuch-mua-cite-function 'message-cite-original-without-signature) - - ;; with defaults, this gets us "On X, Y wrote:" lines - (setq message-citation-line-function 'message-insert-formatted-citation-line) - - ;; run this when setting up the message. we could run it in a hook - ;; run before the message is sent, but I always want to review the - ;; results of the cleanup - ;; - ;; note that certain aspects of the normalisation won't take effect - ;; at this stage of message buffer setup, such as adding the salutation - (add-hook 'message-setup-hook 'spw--message-normalise) - - ;; this key is normally used to insert a Newsgroups: header, but I - ;; don't need that - (bind-key "C-c C-n" 'spw--message-normalise message-mode-map) - ;; default is not much use and I keep hitting it by mistake - (bind-key "C-c C-s" 'message-goto-subject notmuch-message-mode-map)) + (bind-key "C-c C-s" 'message-goto-subject message-mode-map)) (defun djcb/snip (b e summ) "Replace region B to E with SUMM like this: [snip:summary (n lines)]." @@ -2487,37 +2322,5 @@ superflous blank quoted lines." (c-add-style "linux-tabs" '("linux" (indent-tabs-mode . t))) (setq c-default-style "linux-tabs") -;;; shells in Emacs - -;; while this forces us to yank text into another buffer before making -;; edits, it's more annoying to require M-> before typing a command -(setq comint-scroll-to-bottom-on-input t) - -;; for the time being zsh is my login shell, but for robustness, stick -;; with bash in Emacs shells -(setenv "ESHELL" "/bin/bash") - -(setenv "PAGER" "cat") - -(add-hook 'shell-mode-hook - (lambda () - ;; avoid scroll jumps when newlines are output into the - ;; shell buffer (tip from Ryan Barrett's Emacs config) - (set (make-local-variable 'scroll-conservatively) 10) - - ;; `dirtrack-mode' generally better than the default - ;; `shell-dirtrack-mode' - ;; TODO I think `dirtrack-list' needs to be modified for my custom PS1 - (shell-dirtrack-mode 0) - (dirtrack-mode 1))) - -;; this is my entry point -(bind-key "C-c J" 'spw--shell-here) - -;; TODO need to set `display-buffer-reuse-frames' so emacsclient calls -;; from the shell work as expected? e.g. when a command calls $EDITOR - -;; TODO open local and remote shells as root using TRAMP - (provide 'init) ;;; init.el ends here diff --git a/.fmail/.notmuch/hooks/post-new b/.fmail/.notmuch/hooks/post-new deleted file mode 100755 index e824a866..00000000 --- a/.fmail/.notmuch/hooks/post-new +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -. $HOME/.shenv - -# mark all sent mail as read -notmuch tag -unread -- folder:sent - -# mark all drafts as drafts, and as read -notmuch tag -unread +draft -- folder:drafts - -# mark all spam as spam -notmuch tag +spam -- folder:spam - -# mark all trash as trash -notmuch tag +deleted -- folder:trash - -# mark all archived mail as read and unflagged -notmuch tag -unread -flagged -- path:pre2012/** or path:2013/** or path:2014/** or path:2015/** or path:2016/** or path:2017a/** diff --git a/.fmail/.notmuch/hooks/pre-new b/.fmail/.notmuch/hooks/pre-new deleted file mode 100755 index 2c4f014e..00000000 --- a/.fmail/.notmuch/hooks/pre-new +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -. $HOME/.shenv - -# The primary purpose of my pre-new and post-new scripts is to -# maintain the 'draft', 'spam', 'deleted' and 'unread' tags such that -# the only data in the notmuch database that cannot be reproduced from -# the Maildir is which threads have been killed, which is not -# important information. Then there is no need to sync the notmuch -# database between machines. Syncing the maildir with mbsync(1) is -# sufficient. - -# Note that another aspect of this setup is not using an 'inbox' tag. - -# In this script, we move mail according to tags that may have been -# added since the last 'notmuch new' run. Then we sync with my IMAP -# server. Then in the post-new script we add tags to new messages in -# particular folders - -# ensure all drafts are in the drafts folder -floating_drafts=$(notmuch search --output=files -- tag:draft and not folder:drafts) -if [ ! -z "$floating_drafts" ]; then - mdmv $floating_drafts $HOME/.fmail/drafts -fi - -# propagate the 'killed' tag to all messages in the killed message's thread -killed_threads=$(notmuch search --output=threads tag:killed) -if [ ! -z "$killed_threads" ]; then - notmuch tag -unread -- $killed_threads -fi - -# ensure all spam is in the spam folder to train FastMail's spam filter -floating_spam=$(notmuch search --output=files -- tag:spam and not folder:spam) -if [ ! -z "$floating_spam" ]; then - mdmv $floating_spam $HOME/.fmail/spam -fi - -# ensure all deleted messages are in the trash folder -floating_deleted=$(notmuch search --output=files -- tag:deleted and not folder:trash) -if [ ! -z "$floating_deleted" ]; then - mdmv $floating_deleted $HOME/.fmail/trash -fi - -movemail - -#mount-archived-mail diff --git a/.notmuch-config b/.notmuch-config deleted file mode 100644 index 878132f2..00000000 --- a/.notmuch-config +++ /dev/null @@ -1,98 +0,0 @@ -# .notmuch-config - Configuration file for the notmuch mail system -# -# For more information about notmuch, see https://notmuchmail.org - -# Database configuration -# -# The only value supported here is 'path' which should be the top-level -# directory where your mail currently exists and to where mail will be -# delivered in the future. Files should be individual email messages. -# Notmuch will store its database within a sub-directory of the path -# configured here named ".notmuch". -# -[database] -path=/home/spwhitton/.fmail/ - -# User configuration -# -# Here is where you can let notmuch know how you would like to be -# addressed. Valid settings are -# -# name Your full name. -# primary_email Your primary email address. -# other_email A list (separated by ';') of other email addresses -# at which you receive email. -# -# Notmuch will use the various email addresses configured here when -# formatting replies. It will avoid including your own addresses in the -# recipient list of replies, and will set the From address based on the -# address to which the original email was addressed. -# -[user] -name=Sean Whitton -primary_email=spwhitton@spwhitton.name -other_email=spwhitton@email.arizona.edu; - -# Configuration for "notmuch new" -# -# The following options are supported here: -# -# tags A list (separated by ';') of the tags that will be -# added to all messages incorporated by "notmuch new". -# -# ignore A list (separated by ';') of file and directory names -# that will not be searched for messages by "notmuch new". -# -# NOTE: *Every* file/directory that goes by one of those -# names will be ignored, independent of its depth/location -# in the mail store. -# -[new] -tags=unread; -ignore= - -# Search configuration -# -# The following option is supported here: -# -# exclude_tags -# A ;-separated list of tags that will be excluded from -# search results by default. Using an excluded tag in a -# query will override that exclusion. -# -[search] -exclude_tags=deleted;spam; - -# Maildir compatibility configuration -# -# The following option is supported here: -# -# synchronize_flags Valid values are true and false. -# -# If true, then the following maildir flags (in message filenames) -# will be synchronized with the corresponding notmuch tags: -# -# Flag Tag -# ---- ------- -# D draft -# F flagged -# P passed -# R replied -# S unread (added when 'S' flag is not present) -# -# The "notmuch new" command will notice flag changes in filenames -# and update tags, while the "notmuch tag" and "notmuch restore" -# commands will notice tag changes and update flags in filenames -# -[maildir] -synchronize_flags=true - -# Cryptography related configuration -# -# The following option is supported here: -# -# gpg_path -# binary name or full path to invoke gpg. -# -[crypto] -gpg_path=gpg @@ -78,6 +78,7 @@ alias calup="emacs -batch -l /home/swhitton/.emacs.d/init.el -eval \"(org-batch- alias dotex="texi2dvi --pdf --clean --batch" alias whitenoise="cvlc --quiet --loop ~/lib/annex/doc/sounds/R*.ogg" alias myip="dig +short myip.opendns.com @resolver1.opendns.com" +alias mailnow="pkill mbsync ; mbsync -q fastmail && mutt -Z" alias mykb="setxkbmap gb; setxkbmap -option ctrl:nocaps" alias fixmacs="pkill -USR2 emacs" alias myfiles="cadaver https://myfiles.messagingengine.com/" diff --git a/bin/mount-archived-mail b/bin/mount-archived-mail deleted file mode 100755 index f57cadc3..00000000 --- a/bin/mount-archived-mail +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -for maildir in $HOME/lib/annex/doc/mail/*.maildir.tar; do - year="$(basename $maildir | cut -d. -f1)" - dest="$HOME/.fmail/$year" - mkdir -p $dest - if ! mount | grep $dest; then - archivemount -o readonly -o subtree=$year $maildir $dest - fi -done |