diff options
| author | Paul Wise <pabs3@bonedaddy.net> | 2023-04-09 12:41:43 +0800 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2023-05-27 14:26:43 -0300 |
| commit | 93d936c5ae2c694d7fcc310503a182b6bbd603ee (patch) | |
| tree | 61388cf0fb7207c805bb067637fa5d152eb41749 /contrib | |
| parent | 6d383d404982c6e12dd68dcdf94b3490e3de4645 (diff) | |
notmuch-mutt: replace extra command with notmuch thread search feature
This should be be slightly faster since it avoids forking a shell
and is less code in and less dependencies for the script.
Since String::ShellQuote isn't used elsewhere, drop mention of it.
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/notmuch-mutt/README | 2 | ||||
| -rwxr-xr-x | contrib/notmuch-mutt/notmuch-mutt | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/contrib/notmuch-mutt/README b/contrib/notmuch-mutt/README index 26996c4a..c7520228 100644 --- a/contrib/notmuch-mutt/README +++ b/contrib/notmuch-mutt/README @@ -39,8 +39,6 @@ To *run* notmuch-mutt you will need Perl with the following libraries: (Debian package: libmail-box-perl) - Mail::Header <https://metacpan.org/pod/Mail::Header> (Debian package: libmailtools-perl) -- String::ShellQuote <https://metacpan.org/pod/String::ShellQuote> - (Debian package: libstring-shellquote-perl) - Term::ReadLine::Gnu <https://metacpan.org/pod/Term::ReadLine::Gnu> (Debian package: libterm-readline-gnu-perl) diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt index b38258f5..01db6908 100755 --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -17,7 +17,6 @@ use Getopt::Long qw(:config no_getopt_compat); use Mail::Header; use Mail::Box::Maildir; use Pod::Usage; -use String::ShellQuote; use Term::ReadLine; use Digest::SHA; @@ -126,13 +125,9 @@ sub thread_action($$@) { } $mid =~ s/ //g; # notmuch strips spaces before storing Message-Id - $mid =~ s/"/""/g; # escape all double quote characters - - my $search_cmd = 'notmuch search --output=threads ' . shell_quote(qq{id:"$mid"}); - my $tid = `$search_cmd`; # get thread id - chomp($tid); + $mid =~ s/"/""""/g; # escape all double quote characters twice - search($results_dir, $remove_dups, $tid); + search($results_dir, $remove_dups, qq{thread:"{id:""$mid""}"}); } sub tag_action(@) { |
