Re: [PATCH v2 1/7] cli: allow query to come from stdin
[notmuch-archives.git] / 20 / c47557b7f7b051d5a229b4db9bc368c9a78857
1 Return-Path: <markwalters1009@gmail.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 77CB7429E29\r
6         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:07:31 -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: 1.424\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.424 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_ENVFROM_END_DIGIT=2.223, FREEMAIL_FROM=0.001,\r
14         RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id TLnxrG83CmhU for <notmuch@notmuchmail.org>;\r
18         Thu, 26 May 2011 09:07:30 -0700 (PDT)\r
19 Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
20  [74.125.82.45])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
21  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
22  4D302429E27    for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:07:29 -0700\r
23  (PDT)\r
24 Received: by mail-ww0-f45.google.com with SMTP id 36so763098wwi.2\r
25         for <notmuch@notmuchmail.org>; Thu, 26 May 2011 09:07:29 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
28         :in-reply-to:references;\r
29         bh=7hBWceQmfSLFV9lQaRL5P4zA23Z7TlH9Met++zI8KSk=;\r
30         b=bS40aRSCi68nbXXf8Q0lSuhqwNC8c8VGb0ntuhDLUaOcBpLXOgeCSbfBNoANAtu9gu\r
31         Y2PFuYlYCYkQkS6RPqKrDlTspTPMfV2nD8VUxmEEW2vfFHkcpUIFxwDH2gcJVvmzDF2n\r
32         NkSFRu564tX9mvCEjSyVaBLF0hYHHknI4DJao=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
34         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
35         b=otIOBY8Qr92uq6+P0SMEZFdXyPsK0h9J4wwCUZPqiErxRJTa9hjZ/3Rff5iL8SXhbv\r
36         x44l9wWWcuNofuXw1jNr2o9DcDAb4zj0KBE26Az6oYAmIU0jLT6KtfqXCcG5iKhdMp88\r
37         s3JVPNFPamJgM77bbtw798GqdLVNbQnBZ2zw0=\r
38 Received: by 10.216.59.81 with SMTP id r59mr1015999wec.40.1306426048957;\r
39         Thu, 26 May 2011 09:07:28 -0700 (PDT)\r
40 Received: from localhost.localdomain (93-97-25-209.zone5.bethere.co.uk\r
41         [93.97.25.209])\r
42         by mx.google.com with ESMTPS id k70sm457497weq.6.2011.05.26.09.07.27\r
43         (version=TLSv1/SSLv3 cipher=OTHER);\r
44         Thu, 26 May 2011 09:07:28 -0700 (PDT)\r
45 From: Mark Walters <markwalters1009@gmail.com>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH 2/2] Emacs changes for reply to sender\r
48 Date: Thu, 26 May 2011 17:06:52 +0100\r
49 Message-Id: <1306426012-8176-3-git-send-email-markwalters1009@gmail.com>\r
50 X-Mailer: git-send-email 1.7.2.5\r
51 In-Reply-To: <1306426012-8176-1-git-send-email-markwalters1009@gmail.com>\r
52 References: <1306426012-8176-1-git-send-email-markwalters1009@gmail.com>\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, 26 May 2011 16:07:31 -0000\r
66 \r
67 Reply to sender is currently bound to R\r
68 ---\r
69  emacs/notmuch-mua.el  |    6 ++++--\r
70  emacs/notmuch-show.el |    6 ++++++\r
71  2 files changed, 10 insertions(+), 2 deletions(-)\r
72 \r
73 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
74 index dc7b386..4b8590f 100644\r
75 --- a/emacs/notmuch-mua.el\r
76 +++ b/emacs/notmuch-mua.el\r
77 @@ -69,13 +69,15 @@ list."\r
78             (push header message-hidden-headers)))\r
79         notmuch-mua-hidden-headers))\r
80  \r
81 -(defun notmuch-mua-reply (query-string)\r
82 +(defun notmuch-mua-reply (query-string &optional option-string)\r
83    (let (headers body)\r
84      ;; This make assumptions about the output of `notmuch reply', but\r
85      ;; really only that the headers come first followed by a blank\r
86      ;; line and then the body.\r
87      (with-temp-buffer\r
88 -      (call-process notmuch-command nil t nil "reply" query-string)\r
89 +      (if option-string\r
90 +         (call-process notmuch-command nil t nil "reply" option-string query-string)\r
91 +       (call-process notmuch-command nil t nil "reply" query-string))\r
92        (goto-char (point-min))\r
93        (if (re-search-forward "^$" nil t)\r
94           (save-excursion\r
95 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
96 index 9a38d9c..5dbc103 100644\r
97 --- a/emacs/notmuch-show.el\r
98 +++ b/emacs/notmuch-show.el\r
99 @@ -795,6 +795,7 @@ function is used. "\r
100         (define-key map "m" 'notmuch-mua-mail)\r
101         (define-key map "f" 'notmuch-show-forward-message)\r
102         (define-key map "r" 'notmuch-show-reply)\r
103 +       (define-key map "R" 'notmuch-show-reply-one)\r
104         (define-key map "|" 'notmuch-show-pipe-message)\r
105         (define-key map "w" 'notmuch-show-save-attachments)\r
106         (define-key map "V" 'notmuch-show-view-raw-message)\r
107 @@ -1103,6 +1104,11 @@ any effects from previous calls to\r
108    (interactive)\r
109    (notmuch-mua-reply (notmuch-show-get-message-id)))\r
110  \r
111 +(defun notmuch-show-reply-one ()\r
112 +  "Reply to the current message."\r
113 +  (interactive)\r
114 +  (notmuch-mua-reply (notmuch-show-get-message-id) "--format=one"))\r
115 +\r
116  (defun notmuch-show-forward-message ()\r
117    "Forward the current message."\r
118    (interactive)\r
119 -- \r
120 1.7.2.5\r
121 \r