[PATCH 1/2] cli: S/MIME verification/decryption support
[notmuch-archives.git] / c5 / 6626a05eb7f0ee3a7b07a9f9fe4229e84ad9f1
1 Return-Path: <pieter@praet.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 84B9F429E3E\r
6         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:25: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.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 4WLoW017kxOM for <notmuch@notmuchmail.org>;\r
16         Thu, 12 Jan 2012 09:25:53 -0800 (PST)\r
17 Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
18         [209.85.212.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 86F4F429E3D\r
21         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:25:50 -0800 (PST)\r
22 Received: by mail-wi0-f181.google.com with SMTP id hr12so1515830wib.26\r
23         for <notmuch@notmuchmail.org>; Thu, 12 Jan 2012 09:25:50 -0800 (PST)\r
24 Received: by 10.180.85.4 with SMTP id d4mr7860696wiz.0.1326389150131;\r
25         Thu, 12 Jan 2012 09:25:50 -0800 (PST)\r
26 Received: from localhost ([109.131.126.209])\r
27         by mx.google.com with ESMTPS id fc6sm2084399wbb.16.2012.01.12.09.25.49\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Thu, 12 Jan 2012 09:25:49 -0800 (PST)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: Jameson Graef Rollins <jrollins@finestructure.net>\r
32 Subject: [PATCH 3/3] emacs: colorize buttonized 'id:' links depending on the\r
33         target message's state\r
34 Date: Thu, 12 Jan 2012 18:23:45 +0100\r
35 Message-Id: <1326389025-18877-3-git-send-email-pieter@praet.org>\r
36 X-Mailer: git-send-email 1.7.8.1\r
37 In-Reply-To: <1326389025-18877-1-git-send-email-pieter@praet.org>\r
38 References: <874nw0ltwz.fsf@praet.org>\r
39         <1326389025-18877-1-git-send-email-pieter@praet.org>\r
40 Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
41 X-BeenThere: notmuch@notmuchmail.org\r
42 X-Mailman-Version: 2.1.13\r
43 Precedence: list\r
44 List-Id: "Use and development of the notmuch mail system."\r
45         <notmuch.notmuchmail.org>\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
49 List-Post: <mailto:notmuch@notmuchmail.org>\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
53 X-List-Received-Date: Thu, 12 Jan 2012 17:25:54 -0000\r
54 \r
55 * emacs/notmuch-show.el (notmuch-show-buttonized-link-present),\r
56 * emacs/notmuch-show.el (notmuch-show-buttonized-link-present-and-unread),\r
57 * emacs/notmuch-show.el (notmuch-show-buttonized-link-missing):\r
58   new faces for buttonized id: links.\r
59 \r
60 * emacs/notmuch-show.el (notmuch-show-found-target-p): add optional arg\r
61   VERIFY-UNREAD which causes results to be filtered by "tag:unread".\r
62 \r
63 * emacs/notmuch-show.el (notmuch-show-buttonize-links): use different\r
64   face property depending on the result of `notmuch-show-found-target-p',\r
65   causing buttons to present, present-and-unread and missing messages to\r
66   be displayed in a different color.\r
67 ---\r
68  emacs/notmuch-show.el |   32 +++++++++++++++++++++++++++++---\r
69  1 files changed, 29 insertions(+), 3 deletions(-)\r
70 \r
71 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
72 index 8f12955..25330c4 100644\r
73 --- a/emacs/notmuch-show.el\r
74 +++ b/emacs/notmuch-show.el\r
75 @@ -797,6 +797,27 @@ current buffer, if possible."\r
76  (defvar notmuch-show-buffer-name nil)\r
77  (make-variable-buffer-local 'notmuch-show-buffer-name)\r
78  \r
79 +(defface notmuch-show-buttonized-link-present\r
80 +  '((t (:inherit goto-address-mail-face :foreground "blue")))\r
81 +  "Face used for buttonized links to messages which are present\r
82 +in the mail store."\r
83 +  :group 'notmuch-show\r
84 +  :group 'notmuch-appearance)\r
85 +\r
86 +(defface notmuch-show-buttonized-link-present-and-unread\r
87 +  '((t (:inherit goto-address-mail-face :foreground "green")))\r
88 +  "Face used for buttonized links to messages which are present\r
89 +in the mail store, and are tagged `unread'."\r
90 +  :group 'notmuch-show\r
91 +  :group 'notmuch-appearance)\r
92 +\r
93 +(defface notmuch-show-buttonized-link-missing\r
94 +  '((t (:inherit goto-address-mail-face :foreground "red")))\r
95 +  "Face used for buttonized links to messages which are NOT\r
96 +present in in the mail store."\r
97 +  :group 'notmuch-show\r
98 +  :group 'notmuch-appearance)\r
99 +\r
100  (defun notmuch-show-buttonize-links (start end)\r
101    "Buttonize URLs and mail addresses between START and END.\r
102  \r
103 @@ -816,7 +837,12 @@ a corresponding notmuch search."\r
104                                    (notmuch-show-if-found ,message-id))\r
105                         'follow-link t\r
106                         'help-echo "Mouse-1, RET: search for this message"\r
107 -                       'face goto-address-mail-face))))\r
108 +                       'face (cond\r
109 +                              ((notmuch-show-found-target-p message-id t)\r
110 +                               'notmuch-show-buttonized-link-present-and-unread)\r
111 +                              ((notmuch-show-found-target-p message-id)\r
112 +                               'notmuch-show-buttonized-link-present)\r
113 +                              (t 'notmuch-show-buttonized-link-missing)))))))\r
114  \r
115  ;;;###autoload\r
116  (defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name crypto-switch)\r
117 @@ -909,8 +935,8 @@ thread id.  If a prefix is given, crypto processing is toggled."\r
118      (notmuch-kill-this-buffer)\r
119      (notmuch-show-worker thread-id parent-buffer query-context buffer-name process-crypto)))\r
120  \r
121 -(defun notmuch-show-found-target-p (target)\r
122 -  (let ((args `("count" ,target)))\r
123 +(defun notmuch-show-found-target-p (target &optional verify-unread)\r
124 +  (let ((args `("count" ,target ,(if verify-unread "and tag:unread" ""))))\r
125      (> (string-to-number (substring\r
126        (with-output-to-string\r
127          (apply 'call-process notmuch-command nil standard-output nil args))\r
128 -- \r
129 1.7.8.1\r
130 \r