* [PATCH] notmuch-mutt: improve robustness of mutt macros
@ 2013-02-15 0:12 Kevin J. McCarthy
2013-02-16 16:04 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Kevin J. McCarthy @ 2013-02-15 0:12 UTC (permalink / raw)
To: notmuch; +Cc: Stefano Zacchiroli
[-- Attachment #1: Type: text/plain, Size: 4678 bytes --]
Details:
- $pipe_decode is turned off, to prevent message-id from being
filtered out by "ignore" settings in the muttrc.
- Original values for $pipe_decode and $wait_key are saved and restored.
- The macros, being much longer now, are line wrapped for improved
readability.
---
This patch would be in addition to the one sent by Stefano in
id:20130214083713.GA4123@upsilon.cc
His patch improves notmuch-mutt itself. This patch improves the macros
to invoke notmuch-mutt.
contrib/notmuch-mutt/notmuch-mutt | 16 +++++++++++++---
contrib/notmuch-mutt/notmuch-mutt.rc | 16 +++++++++++++---
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt
index bc97908..00c5ef8 100755
--- a/contrib/notmuch-mutt/notmuch-mutt
+++ b/contrib/notmuch-mutt/notmuch-mutt
@@ -270,13 +270,23 @@ the following in your Mutt configuration (usually one of: F<~/.muttrc>,
F</etc/Muttrc>, or a configuration snippet under F</etc/Muttrc.d/>):
macro index <F8> \
- "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt -r --prompt search<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter>" \
+ "<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+ <shell-escape>notmuch-mutt -r --prompt search<enter>\
+ <change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+ <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: search mail"
+
macro index <F9> \
- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt -r thread<enter><change-folder-readonly>~/.cache/notmuch/mutt/results<enter><enter-command>set wait_key<enter>" \
+ "<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+ <pipe-message>notmuch-mutt -r thread<enter>\
+ <change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+ <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: reconstruct thread"
+
macro index <F6> \
- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag -- -inbox<enter>" \
+ "<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+ <pipe-message>notmuch-mutt tag -- -inbox<enter>\
+ <enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: remove message from inbox"
The first macro (activated by <F8>) prompts the user for notmuch search terms
diff --git a/contrib/notmuch-mutt/notmuch-mutt.rc b/contrib/notmuch-mutt/notmuch-mutt.rc
index ddc4b48..6b299dc 100644
--- a/contrib/notmuch-mutt/notmuch-mutt.rc
+++ b/contrib/notmuch-mutt/notmuch-mutt.rc
@@ -1,9 +1,19 @@
macro index <F8> \
- "<enter-command>unset wait_key<enter><shell-escape>notmuch-mutt -r --prompt search<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>" \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<shell-escape>notmuch-mutt -r --prompt search<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: search mail"
+
macro index <F9> \
- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt -r thread<enter><change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter><enter-command>set wait_key<enter>" \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt -r thread<enter>\
+<change-folder-readonly>`echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: reconstruct thread"
+
macro index <F6> \
- "<enter-command>unset wait_key<enter><pipe-message>notmuch-mutt tag -- -inbox<enter>" \
+"<enter-command>set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key<enter>\
+<pipe-message>notmuch-mutt tag -- -inbox<enter>\
+<enter-command>set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key<enter>" \
"notmuch: remove message from inbox"
--
1.7.10.4
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] notmuch-mutt: improve robustness of mutt macros
2013-02-15 0:12 [PATCH] notmuch-mutt: improve robustness of mutt macros Kevin J. McCarthy
@ 2013-02-16 16:04 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2013-02-16 16:04 UTC (permalink / raw)
To: Kevin J. McCarthy, notmuch; +Cc: Stefano Zacchiroli
"Kevin J. McCarthy" <kevin@8t8.us> writes:
> Details:
> - $pipe_decode is turned off, to prevent message-id from being
> filtered out by "ignore" settings in the muttrc.
> - Original values for $pipe_decode and $wait_key are saved and restored.
> - The macros, being much longer now, are line wrapped for improved
> readability.
> ---
>
> This patch would be in addition to the one sent by Stefano in
> id:20130214083713.GA4123@upsilon.cc
Pushed both, thanks for the quick fixes.
d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-16 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 0:12 [PATCH] notmuch-mutt: improve robustness of mutt macros Kevin J. McCarthy
2013-02-16 16:04 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).