dotfiles/notmuch/.config/notmuch/default/hooks/pre-new
Tom Willemse e7bac680ad [notmuch] Replace pre-new script with SCSH script
This also handles finding 0 emails that have the ‘deleted’ tag without showing
an error.
2022-05-29 17:00:13 -07:00

13 lines
268 B
Scheme
Executable file

#!/usr/bin/env sh
# # -*- mode:scheme; -*-
IFS=" "
exec scsh -s "$0" "$@"
!#
(define deleted
(run/sexp (notmuch search --output=files --format=sexp tag:deleted)))
(if (> (length deleted) 0)
(map (lambda (mail) (run (rm -v ,mail))) deleted))
(run (mbsync -a))