Re: [PATCH v1 1/1] lib: make find_message{, by_filename) report errors
[notmuch-archives.git] / e5 / f9810652d50b4ad7b874703bf7b85fe1fc46e1
1 Return-Path: <prvs=jrosenthal=633347451@jhu.edu>\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 E0E20431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 24 Jan 2010 13:22:37 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.284\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.284 tagged_above=-999 required=5 tests=[AWL=1.715,\r
12         BAYES_50=0.001, RCVD_IN_DNSWL_MED=-4] autolearn=ham\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 DH3UUEZ8UQQ8 for <notmuch@notmuchmail.org>;\r
16         Sun, 24 Jan 2010 13:22:37 -0800 (PST)\r
17 X-Greylist: delayed 3602 seconds by postgrey-1.32 at olra;\r
18         Sun, 24 Jan 2010 13:22:37 PST\r
19 Received: from ipex4.johnshopkins.edu (ipex4.johnshopkins.edu\r
20         [128.220.161.141])\r
21         by olra.theworths.org (Postfix) with ESMTP id 4028B431FAE\r
22         for <notmuch@notmuchmail.org>; Sun, 24 Jan 2010 13:22:37 -0800 (PST)\r
23 X-IronPort-Anti-Spam-Filtered: true\r
24 X-IronPort-Anti-Spam-Result:\r
25  AuwEAP46XEuA3DZF/2dsb2JhbACQEQG4KAIBg1+Hb4JMAYFuBA\r
26 X-IronPort-AV: E=Sophos;i="4.49,335,1262581200"; d="scan'208";a="329006367"\r
27 Received: from watt.gilman.jhu.edu ([128.220.54.69])\r
28         by ipex4.johnshopkins.edu with ESMTP/TLS/ADH-AES256-SHA;\r
29         24 Jan 2010 15:22:34 -0500\r
30 Received: by watt.gilman.jhu.edu (Postfix, from userid 502)\r
31         id 188C03E9815; Sun, 24 Jan 2010 15:22:33 -0500 (EST)\r
32 From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
33 To: notmuch@notmuchmail.org\r
34 Date: Sun, 24 Jan 2010 15:22:33 -0500\r
35 Message-ID: <m1my03gsmu.fsf@watt.gilman.jhu.edu>\r
36 MIME-Version: 1.0\r
37 Content-Type: text/plain; charset=us-ascii\r
38 Subject: [notmuch] [PATCH] notmuch.el: quote args in notmuch-show to\r
39         facilitate remote use\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Sun, 24 Jan 2010 21:22:38 -0000\r
53 \r
54 \r
55 Put single-quotes around the argument of the `show --entire-thread' command\r
56 in notmuch-show. This change should have no effect on normal usage.\r
57 However, it allows us to use the notmuch.el client with a remote notmuch\r
58 binary and database over ssh (by, e.g., setting `notmuch-command' to a\r
59 simple shell script). Without the quotes, ssh will not send the command\r
60 properly.\r
61 \r
62 One very simple example script is as follows. (Note that it requires\r
63 keypair login to the ssh server.)\r
64 \r
65         #!/bin/sh\r
66 \r
67         SSH_BIN="/path/to/local/ssh"\r
68         NOTMUCH_HOST="my.remote.server"\r
69         NOTMUCH_REMOTE_PATH="/path/to/remote/notmuch"\r
70 \r
71         $SSH_BIN $NOTMUCH_HOST $NOTMUCH_REMOTE_PATH $@\r
72 \r
73 ---\r
74  notmuch.el |    6 ++++--\r
75  1 files changed, 4 insertions(+), 2 deletions(-)\r
76 \r
77 diff --git a/notmuch.el b/notmuch.el\r
78 index e333f24..e6eef46 100644\r
79 --- a/notmuch.el\r
80 +++ b/notmuch.el\r
81 @@ -953,8 +953,10 @@ matching this search term are shown if non-nil. "\r
82        (erase-buffer)\r
83        (goto-char (point-min))\r
84        (save-excursion\r
85 -       (let* ((basic-args (list notmuch-command nil t nil "show" "--entire-thread" thread-id))\r
86 -               (args (if query-context (append basic-args (list "and (" query-context ")")) basic-args)))\r
87 +       (let* ((basic-args (list notmuch-command nil t nil "show" "--entire-thread" "\'" thread-id))\r
88 +               (args (if query-context\r
89 +                         (append basic-args (list "and (" query-context ")\'"))\r
90 +                       (append basic-args (list "\'")))))\r
91           (apply 'call-process args)\r
92           (when (and (eq (buffer-size) 0) query-context)\r
93             (apply 'call-process basic-args)))\r
94 -- \r
95 1.6.5.3\r
96 \r