1 Return-Path: <dme@dme.org>
\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 0E62E431FC3
\r
6 for <notmuch@notmuchmail.org>; Fri, 9 May 2014 01:22:33 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 ydzyAsbgTA0J for <notmuch@notmuchmail.org>;
\r
16 Fri, 9 May 2014 01:22:28 -0700 (PDT)
\r
17 Received: from mail-we0-f172.google.com (mail-we0-f172.google.com
\r
18 [74.125.82.172]) (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 1C9D0431FBF
\r
21 for <notmuch@notmuchmail.org>; Fri, 9 May 2014 01:22:27 -0700 (PDT)
\r
22 Received: by mail-we0-f172.google.com with SMTP id k48so3659841wev.31
\r
23 for <notmuch@notmuchmail.org>; Fri, 09 May 2014 01:22:27 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
\r
28 bh=pOt6MlVxSy5HEZc0EkJj/0lL7DaZvjSTy6J7j7613ac=;
\r
29 b=IEPBCT+LM47Nf67ewjrpYJvOAwNMgTQouVSsO2vi0k8U1X7YHiPMECjf1BYMY2x2Ci
\r
30 +VaUyq4J5yNsuSylcH/HsZ2P1zJBZryqQfHtvsYPw2AIq165ciutPv0RpBBa0FHsfnUa
\r
31 zZB8sG005KIK2pBmgKAjCTZ+aqyjDMOz4uv53NV6QH7xF4AgXOlubY6Xhp7PgciewUQY
\r
32 h/QxnEgyH63wLwVldharV09zn4jCogw35ajtAHCkn9UoEQ0fibYE6sPxsFKTuWgInlyB
\r
33 7GkEoabIVrmE9c8XyD5WDd/sDg9tx5ipQKPpcJQZEFFJZ5FtbLwfH1f1zsXYlz/vRv7O
\r
36 ALoCoQmoPpy9jLq5ml5GpJJy1iECGxiU/iMaSdUWMlXGgu5YJqCGMbXRMIdTLDMWXpC26rxzi0yy
\r
37 X-Received: by 10.194.92.7 with SMTP id ci7mr7330736wjb.7.1399623745891;
\r
38 Fri, 09 May 2014 01:22:25 -0700 (PDT)
\r
39 Received: from hotblack-desiato.hh.sledj.net
\r
40 ([2a01:348:1a2:1:a288:b4ff:fe8a:77d8])
\r
41 by mx.google.com with ESMTPSA id ct2sm4527426wjb.33.2014.05.09.01.22.24
\r
42 for <notmuch@notmuchmail.org>
\r
43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
44 Fri, 09 May 2014 01:22:24 -0700 (PDT)
\r
45 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
46 id 14B1910920E; Fri, 9 May 2014 09:22:23 +0100 (BST)
\r
47 From: David Edmondson <dme@dme.org>
\r
48 To: notmuch@notmuchmail.org
\r
49 Subject: [PATCH v1 2/3] emacs: Minor re-work of `notmuch-show-pipe-message'
\r
50 Date: Fri, 9 May 2014 09:22:22 +0100
\r
51 Message-Id: <1399623743-30478-3-git-send-email-dme@dme.org>
\r
52 X-Mailer: git-send-email 2.0.0.rc0
\r
53 In-Reply-To: <1399623743-30478-1-git-send-email-dme@dme.org>
\r
54 References: <1399623743-30478-1-git-send-email-dme@dme.org>
\r
55 X-BeenThere: notmuch@notmuchmail.org
\r
56 X-Mailman-Version: 2.1.13
\r
58 List-Id: "Use and development of the notmuch mail system."
\r
59 <notmuch.notmuchmail.org>
\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
63 List-Post: <mailto:notmuch@notmuchmail.org>
\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
67 X-List-Received-Date: Fri, 09 May 2014 08:22:33 -0000
\r
69 Stylistic only - no functional change.
\r
71 emacs/notmuch-show.el | 59 +++++++++++++++++++++++++--------------------------
\r
72 1 file changed, 29 insertions(+), 30 deletions(-)
\r
74 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
75 index 2ed221a..62c0be6 100644
\r
76 --- a/emacs/notmuch-show.el
\r
77 +++ b/emacs/notmuch-show.el
\r
78 @@ -1784,36 +1784,35 @@ If ENTIRE-THREAD is non-nil (or when invoked with a prefix
\r
79 argument), COMMAND will receive all open messages in the current
\r
80 thread (formatted as an mbox) rather than only the current
\r
82 - (interactive (let ((query-string (if current-prefix-arg
\r
83 - "Pipe all open messages to command: "
\r
84 - "Pipe message to command: ")))
\r
85 - (list current-prefix-arg (read-string query-string))))
\r
86 - (let (shell-command)
\r
88 - (setq shell-command
\r
89 - (concat notmuch-command " show --format=mbox --exclude=false "
\r
90 - (shell-quote-argument
\r
91 - (mapconcat 'identity (notmuch-show-get-message-ids-for-open-messages) " OR "))
\r
93 - (setq shell-command
\r
94 - (concat notmuch-command " show --format=raw "
\r
95 - (shell-quote-argument (notmuch-show-get-message-id)) " | " command)))
\r
96 - (let ((cwd default-directory)
\r
97 - (buf (get-buffer-create (concat "*notmuch-pipe*"))))
\r
98 - (with-current-buffer buf
\r
99 - (setq buffer-read-only nil)
\r
101 - ;; Use the originating buffer's working directory instead of
\r
102 - ;; that of the pipe buffer.
\r
104 - (let ((exit-code (call-process-shell-command shell-command nil buf)))
\r
105 - (goto-char (point-max))
\r
106 - (set-buffer-modified-p nil)
\r
107 - (setq buffer-read-only t)
\r
108 - (unless (zerop exit-code)
\r
109 - (switch-to-buffer-other-window buf)
\r
110 - (message (format "Command '%s' exited abnormally with code %d"
\r
111 - shell-command exit-code))))))))
\r
112 + (interactive (let ((prompt (if current-prefix-arg
\r
113 + "Pipe all open messages to command: "
\r
114 + "Pipe message to command: ")))
\r
115 + (list current-prefix-arg (read-string prompt))))
\r
117 + (let ((shell-command
\r
118 + (concat notmuch-command " show"
\r
119 + (if entire-thread
\r
120 + (concat " --format=mbox --exclude=false "
\r
121 + (mapconcat #'shell-quote-argument (notmuch-show-get-message-ids-for-open-messages) " OR "))
\r
122 + (concat " --format=raw "
\r
123 + (shell-quote-argument (notmuch-show-get-message-id))))
\r
125 + (cwd default-directory)
\r
126 + (buf (get-buffer-create (concat "*notmuch-pipe*"))))
\r
127 + (with-current-buffer buf
\r
128 + (setq buffer-read-only nil)
\r
130 + ;; Use the originating buffer's working directory instead of
\r
131 + ;; that of the pipe buffer.
\r
133 + (let ((exit-code (call-process-shell-command shell-command nil buf)))
\r
134 + (goto-char (point-max))
\r
135 + (set-buffer-modified-p nil)
\r
136 + (setq buffer-read-only t)
\r
137 + (unless (zerop exit-code)
\r
138 + (switch-to-buffer-other-window buf)
\r
139 + (message (format "Command '%s' exited abnormally with code %d"
\r
140 + shell-command exit-code)))))))
\r
142 (defun notmuch-show-tag-message (&rest tag-changes)
\r
143 "Change tags for the current message.
\r