From 0cb17135b9ed52c89f20e671b03decd94ab7b2fe Mon Sep 17 00:00:00 2001 From: burbschat Date: Fri, 24 Nov 2023 21:39:31 +0100 Subject: [PATCH] Fix escaping in message IDs from notmuch `+` was properly escaped but only once. `$` was not escaped at all. This would result in messages with message IDs containing more than one `+` or at least on `$` to not be shown after limiting. `$` itself has to be escaped presumably for the shell. This results in three prepended backslashes in the limit string and six in the config file, as there backslashes themselves have to be escaped. --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 95a9ae9..27ae216 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -101,7 +101,7 @@ macro index \eh "$prefix/libexec/gpg-wks-client --receive | msmtp macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" macro index O "mailsync" "run mailsync to sync all mail" -macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/g for@a; s/\\$/\\\\\\$/g for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" # Sidebar mappings