Re: Error with contrib/notmuch-pick
[notmuch-archives.git] / 77 / 4b7be3a0c94072d31a5fdd5315edb4186421c5
1 Return-Path: <dmitry.kurochkin@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 543FC429E21\r
6         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 14:23:54 -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: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id I9h7bUy0d3S1 for <notmuch@notmuchmail.org>;\r
17         Fri, 25 Nov 2011 14:23:53 -0800 (PST)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id AE040431FB6\r
22         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 14:23:53 -0800 (PST)\r
23 Received: by bkaq10 with SMTP id q10so5375723bka.26\r
24         for <notmuch@notmuchmail.org>; Fri, 25 Nov 2011 14:23:52 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=from:to:subject:date:message-id:x-mailer;\r
27         bh=IkSGewtB/f2twH3DulvDsVOL9lvF59tlzGAFhV5qICE=;\r
28         b=mpn5ziqd1dIW2JjAsh96D7tRZzEPbwQw7CsBZAjNOYyZLlR6ecuBcvNV3S1Tsjt+tc\r
29         xYv5lnPcBIBTyTCboprZCQ+eodTwuwLezzMy9FJUCQmHeDDaTvFJRGGZC96NO1r035DQ\r
30         h9VnrjAm8sqyUtlN5iPpC1AKSdX8+ufUh0MBQ=\r
31 Received: by 10.204.128.208 with SMTP id l16mr16383999bks.14.1322259832313;\r
32         Fri, 25 Nov 2011 14:23:52 -0800 (PST)\r
33 Received: from localhost ([91.144.186.21])\r
34         by mx.google.com with ESMTPS id fa8sm11909829bkc.14.2011.11.25.14.23.50\r
35         (version=TLSv1/SSLv3 cipher=OTHER);\r
36         Fri, 25 Nov 2011 14:23:51 -0800 (PST)\r
37 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 1/2] emacs: remove some code duplication in notmuch-show\r
40 Date: Sat, 26 Nov 2011 02:23:30 +0400\r
41 Message-Id: <1322259811-10834-1-git-send-email-dmitry.kurochkin@gmail.com>\r
42 X-Mailer: git-send-email 1.7.7.3\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Fri, 25 Nov 2011 22:23:54 -0000\r
56 \r
57 Add optional props argument to `notmuch-show-get-header'.  Use it to\r
58 get headers in `notmuch-show-insert-part-multipart/signed' and\r
59 `notmuch-show-insert-part-multipart/encrypted'.\r
60 ---\r
61  emacs/notmuch-show.el |   10 ++++------\r
62  1 files changed, 4 insertions(+), 6 deletions(-)\r
63 \r
64 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
65 index 7be88f8..bcc436f 100644\r
66 --- a/emacs/notmuch-show.el\r
67 +++ b/emacs/notmuch-show.el\r
68 @@ -450,8 +450,7 @@ current buffer, if possible."\r
69      (button-put button 'face '(:foreground "blue"))\r
70      ;; add signature status button if sigstatus provided\r
71      (if (plist-member part :sigstatus)\r
72 -       (let* ((headers (plist-get msg :headers))\r
73 -              (from (plist-get headers :From))\r
74 +       (let* ((from (notmuch-show-get-header :From msg))\r
75                (sigstatus (car (plist-get part :sigstatus))))\r
76           (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
77        ;; if we're not adding sigstatus, tell the user how they can get it\r
78 @@ -477,8 +476,7 @@ current buffer, if possible."\r
79           (notmuch-crypto-insert-encstatus-button encstatus)\r
80           ;; add signature status button if sigstatus specified\r
81           (if (plist-member part :sigstatus)\r
82 -             (let* ((headers (plist-get msg :headers))\r
83 -                    (from (plist-get headers :From))\r
84 +             (let* ((from (notmuch-show-get-header :From msg))\r
85                      (sigstatus (car (plist-get part :sigstatus))))\r
86                 (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
87        ;; if we're not adding encstatus, tell the user how they can get it\r
88 @@ -1079,9 +1077,9 @@ All currently available key bindings:\r
89    "Return the filename of the current message."\r
90    (notmuch-show-get-prop :filename))\r
91  \r
92 -(defun notmuch-show-get-header (header)\r
93 +(defun notmuch-show-get-header (header &optional props)\r
94    "Return the named header of the current message, if any."\r
95 -  (plist-get (notmuch-show-get-prop :headers) header))\r
96 +  (plist-get (notmuch-show-get-prop :headers props) header))\r
97  \r
98  (defun notmuch-show-get-cc ()\r
99    (notmuch-show-get-header :Cc))\r
100 -- \r
101 1.7.7.3\r
102 \r