aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xnotmuch/.config/notmuch/default/hooks/pre-new15
1 files changed, 12 insertions, 3 deletions
diff --git a/notmuch/.config/notmuch/default/hooks/pre-new b/notmuch/.config/notmuch/default/hooks/pre-new
index eb7730a..bdc15f6 100755
--- a/notmuch/.config/notmuch/default/hooks/pre-new
+++ b/notmuch/.config/notmuch/default/hooks/pre-new
@@ -1,4 +1,13 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
+# # -*- mode:scheme; -*-
+IFS=" "
+exec scsh -s "$0" "$@"
+!#
-notmuch search --output=files tag:deleted | tr '\n' '\0' | xargs -0 -L 1 rm -v
-mbsync -a
+(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))