commit 7a1af5973a4d59f261434922c467152c7893708e
parent 80e0709f5481db65929dce02531d779897b483eb
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 12 Jan 2019 13:55:58 +0100
make notmuch readonly in neomutt
Diffstat:
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/mutt/muttrc b/mutt/muttrc
@@ -148,11 +148,6 @@ bind index,pager . sidebar-toggle-visible
macro index,pager , \
"<enter-command>set my_old_visible=\$sidebar_visible sidebar_visible<enter><sidebar-next><sidebar-open><enter-command>set sidebar_visible=\$my_old_visible<enter>"
-# notmuch
-
-bind index,pager \\ vfolder-from-query
-bind index,pager z entire-thread
-
# == Postponed mail ==
# save postponed mail in the inbox
@@ -186,3 +181,14 @@ macro pager H \
# http://mutt-users.mutt.narkive.com/t0y58ITT/sort-mailbox-by-spam-tag-score-sorting-strangeness
spam "X-Spam-Status: (Yes|No), score=(-?[[:digit:]]+\.[[:digit:]]+)" "%2"
+
+folder-hook . push '*'
+
+# == notmuch ==
+bind index,pager z entire-thread
+macro index,pager \\ "<vfolder-from-query>"
+# dirty hack to ensure that vfolder-from-query is read-only
+# at the bottom of the file beacuse it has to be executed first
+folder-hook . "set read_only=no"
+folder-hook (^notmuch) "set read_only=yes"
+