[PATCH v4 6/7] On deletion, replace with ghost when other active messages in thread
[notmuch-archives.git] / 2e / 51f2b61a3277095d17ac7da5e938fb35ed2566
1 Return-Path: <taylor@codecafe.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1F666431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 17:29:58 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id g67iQUM2Xv6G for <notmuch@notmuchmail.org>;\r
16         Wed, 11 Apr 2012 17:29:56 -0700 (PDT)\r
17 Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com\r
18         [209.85.214.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 803DE431FAE\r
21         for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 17:29:56 -0700 (PDT)\r
22 Received: by obbwd20 with SMTP id wd20so2187452obb.26\r
23         for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 17:29:56 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=date:from:to:subject:message-id:mime-version:content-type\r
27         :content-disposition:user-agent:x-gm-message-state;\r
28         bh=dUU69oB4BOWR6CEKJ5ItjAJygKSVJo3v7m/Ja6ISXSg=;\r
29         b=UvWXqlSm5rgB1uMyRlhZExK/1wgc+eSKsQCDxKku/Aq4CYGx+/9oVgAwN4VJGFVrqz\r
30         d/3Mox1PC9MzVkiwk8tQZJCP51QJzesZ99rt4hzP0AsfKX6ZLYBOjxIT/M5/fqtlOfnZ\r
31         4swY5msK4amX4VowtZAbJ4juHXe/wbuQkAuf+RqWz9r1H3lCp06EbxSAg/68zcAM6Fav\r
32         0+OS2OjbLsRZU7KaHR/egpipdbVM0FrTu8RHtPafQPPqxYbeuGChe69CmQAQytIlXexf\r
33         l7R66XMdEXiT6KJjpFO4bgQfb8oEC+aYUQ9nSm8EkDAGJJEQootnrfP1E3XqL7ME6yaF\r
34         ZWzA==\r
35 Received: by 10.182.122.36 with SMTP id lp4mr455656obb.64.1334190595936;\r
36         Wed, 11 Apr 2012 17:29:55 -0700 (PDT)\r
37 Received: from localhost (cpe-173-174-57-204.austin.res.rr.com.\r
38         [173.174.57.204])\r
39         by mx.google.com with ESMTPS id yw3sm4676970obb.7.2012.04.11.17.29.54\r
40         (version=TLSv1/SSLv3 cipher=OTHER);\r
41         Wed, 11 Apr 2012 17:29:55 -0700 (PDT)\r
42 Date: Wed, 11 Apr 2012 19:29:53 -0500\r
43 From: Taylor Carpenter <taylor@codecafe.com>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH] notmuch-mutt: replace gnu sed and xargs with perl\r
46 Message-ID: <20120412002953.GA27056@codecafe.com>\r
47 MIME-Version: 1.0\r
48 Content-Type: text/plain; charset=us-ascii\r
49 Content-Disposition: inline\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)\r
51 X-Gm-Message-State:\r
52  ALoCoQl4ZQ5paBJUzlpikzBVgYeIZyzynqG6mvzWhCelq4VMXO3L2uEKbvAAfevjVNAwM5dbjsGN\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Thu, 12 Apr 2012 00:29:58 -0000\r
66 \r
67 External software dependencies removed: sed and xargs.\r
68 \r
69 Sed shell escaping is handled automatically with perl symlink function.\r
70 \r
71 The xargs usage is specific to gnu xargs (fails on bsd xargs, etc).\r
72 \r
73 NOTE: The current query pulls the list of files into an array all at\r
74 once.  The larger the list the more memory used.\r
75 ---\r
76  contrib/notmuch-mutt/notmuch-mutt |    9 ++++++---\r
77  1 files changed, 6 insertions(+), 3 deletions(-)\r
78 \r
79 diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt\r
80 index 424f9a3..c995022 100755\r
81 --- a/contrib/notmuch-mutt/notmuch-mutt\r
82 +++ b/contrib/notmuch-mutt/notmuch-mutt\r
83 @@ -12,6 +12,7 @@ use strict;\r
84  use warnings;\r
85  \r
86  use File::Path;\r
87 +use File::Basename;\r
88  use Getopt::Long qw(:config no_getopt_compat);\r
89  use Mail::Internet;\r
90  use Mail::Box::Maildir;\r
91 @@ -41,9 +42,11 @@ sub search($$) {\r
92      $query = shell_quote($query);\r
93  \r
94      empty_maildir($maildir);\r
95 -    system("notmuch search --output=files $query"\r
96 -          . " | sed -e 's: :\\\\ :g'"\r
97 -          . " | xargs --no-run-if-empty ln -s -t $maildir/cur/");\r
98 +    my @filelist = `notmuch search --output=files $query`;\r
99 +    foreach(@filelist) {\r
100 +        chomp;\r
101 +        symlink($_, "$maildir/cur/" . basename($_));\r
102 +    }\r
103  }\r
104  \r
105  sub prompt($$) {\r
106 -- \r
107 1.7.7.4\r
108 \r