]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-mutt: replace extra command with notmuch thread search feature
authorPaul Wise <pabs3@bonedaddy.net>
Sun, 9 Apr 2023 04:41:43 +0000 (12:41 +0800)
committerDavid Bremner <david@tethera.net>
Sat, 27 May 2023 17:26:43 +0000 (14:26 -0300)
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.

contrib/notmuch-mutt/README
contrib/notmuch-mutt/notmuch-mutt
debian/control

index 26996c4ab2ccd1136b56e71e0c9d8c86c21a295a..c7520228782b2cacaf48e3b661c593013741e1ba 100644 (file)
@@ -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)
 
index b38258f5772a7808889e5f1c1c9cd0ea61c76187..01db6908702293b19435548076abdd297f90f973 100755 (executable)
@@ -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(@) {
index 2dcb8cc72f7caef524b07031323b98f3fc639e55..135eb7ced2bfe9e62829dbc44cfab047253869a7 100644 (file)
@@ -227,7 +227,6 @@ Architecture: all
 Depends:
  libmail-box-perl,
  libmailtools-perl,
- libstring-shellquote-perl,
  libterm-readline-gnu-perl,
  notmuch (>= 0.4),
  ${misc:Depends},