[PATCH 1/2] cli: S/MIME verification/decryption support
[notmuch-archives.git] / c5 / 8252c5d79858f594ed5cd2a46ee15bfd7e0651
1 Return-Path: <amdragon@mit.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 72263431FC2\r
6         for <notmuch@notmuchmail.org>; Tue,  3 Jul 2012 15:21:18 -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: -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 CQKy3Fx1JZ5Q for <notmuch@notmuchmail.org>;\r
16         Tue,  3 Jul 2012 15:21:17 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
18         [18.9.25.13])\r
19         by olra.theworths.org (Postfix) with ESMTP id EE190431FD0\r
20         for <notmuch@notmuchmail.org>; Tue,  3 Jul 2012 15:21:06 -0700 (PDT)\r
21 X-AuditID: 1209190d-b7fd56d000000933-d2-4ff37052ae2b\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 63.F1.02355.25073FF4; Tue,  3 Jul 2012 18:21:06 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q63ML46X010807; \r
27         Tue, 3 Jul 2012 18:21:04 -0400\r
28 Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q63ML19w023220\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 3 Jul 2012 18:21:02 -0400 (EDT)\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SmBSu-0007fM-W9; Tue, 03 Jul 2012 18:21:00 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH 2/8] emacs: Separate search line parsing and display\r
40 Date: Tue,  3 Jul 2012 18:20:53 -0400\r
41 Message-Id: <1341354059-29396-3-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10\r
43 In-Reply-To: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
44 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
45 X-Brightmail-Tracker:\r
46  H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsUixG6nrhtU8NnfYP9rDosje2axWyw985/Z\r
47         4vrNmcwWb1bOY3Vg8dg56y67x+GvC1k8nq26xezR9GMxawBLFJdNSmpOZllqkb5dAlfGp70z\r
48         2QqWile8vvyBvYHxtlAXIweHhICJxOLfyV2MnECmmMSFe+vZuhi5OIQE9jFKnLnzkgXCWc8o\r
49         8X3/TXYI5ySTxMlt36CcuYwSV6+vZgHpZxPQkNi2fzkjiC0iIC2x8+5sVhCbWSBX4mzrYUaQ\r
50         dcICLhIf7kuBmCwCqhKnj6aAVPAKOEh8/32IEeIKeYmn9/vYQGxOAUeJFTfPgk0XAqrZ9qGD\r
51         dQIj/wJGhlWMsim5Vbq5iZk5xanJusXJiXl5qUW6Rnq5mSV6qSmlmxhB4cYpybuD8d1BpUOM\r
52         AhyMSjy8iQqf/YVYE8uKK3MPMUpyMCmJ8l7JAwrxJeWnVGYkFmfEF5XmpBYfYpTgYFYS4V2d\r
53         BJTjTUmsrEotyodJSXOwKInzXkm56S8kkJ5YkpqdmlqQWgSTleHgUJLgPZAP1ChYlJqeWpGW\r
54         mVOCkGbi4AQZzgM0fBlIDW9xQWJucWY6RP4Uo6KUOO9OkIQASCKjNA+uF5YOXjGKA70izHsU\r
55         pIoHmErgul8BDWYCGpy3+BPI4JJEhJRUA+PF/1c7RBfe9hP9Oyt7edzp5z+aQ0TzfApPfQ3R\r
56         FpxXY8HgeZej/Y7UnO2h8+RWrxC/WtR/NWOixmLFJ0wC9z2n/vQLFiu/9VR8Qc0Zln0XeCYn\r
57         STqqZ9euuLCt+9Sl2+oTSi4sX2Wodyq4Q75mubnOFk71JXF9fvHHv39+IWfN6rdoft2dvY5K\r
58         LMUZiYZazEXFiQBXzuK04gIAAA==\r
59 Cc: tomi.ollila@iki.fi\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Tue, 03 Jul 2012 22:21:18 -0000\r
73 \r
74 Previously, much of the display of search lines was done in the same\r
75 function that parsed the CLI's output.  Now the parsing function only\r
76 parses, and notmuch-search-show-result fully inserts the search result\r
77 in the search buffer.\r
78 ---\r
79  emacs/notmuch.el |   33 +++++++++++++++++----------------\r
80  1 file changed, 17 insertions(+), 16 deletions(-)\r
81 \r
82 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
83 index be217a2..dadc6d6 100644\r
84 --- a/emacs/notmuch.el\r
85 +++ b/emacs/notmuch.el\r
86 @@ -726,11 +726,19 @@ non-authors is found, assume that all of the authors match."\r
87      (insert\r
88       (format format (propertize tags 'font-lock-face 'notmuch-tag-face))))))\r
89  \r
90 -(defun notmuch-search-show-result (date count authors subject tags)\r
91 -  (dolist (format notmuch-search-result-format)\r
92 -    (notmuch-search-insert-field (car format) (cdr format)\r
93 -                                date count authors subject tags))\r
94 -  (insert "\n"))\r
95 +(defun notmuch-search-show-result (thread-id date count authors subject tags)\r
96 +  ;; Ignore excluded matches\r
97 +  (unless (eq (aref count 1) ?0)\r
98 +    (let ((beg (point))\r
99 +         (tags-str (mapconcat 'identity tags " ")))\r
100 +      (dolist (format notmuch-search-result-format)\r
101 +       (notmuch-search-insert-field (car format) (cdr format)\r
102 +                                    date count authors subject tags-str))\r
103 +      (insert "\n")\r
104 +      (notmuch-search-color-line beg (point) tags)\r
105 +      (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
106 +      (put-text-property beg (point) 'notmuch-search-authors authors)\r
107 +      (put-text-property beg (point) 'notmuch-search-subject subject))))\r
108  \r
109  (defun notmuch-search-process-filter (proc string)\r
110    "Process and filter the output of \"notmuch search\""\r
111 @@ -758,17 +766,10 @@ non-authors is found, assume that all of the authors match."\r
112                       (goto-char (point-max))\r
113                       (if (/= (match-beginning 1) line)\r
114                           (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
115 -                     ;; We currently just throw away excluded matches.\r
116 -                     (unless (eq (aref count 1) ?0)\r
117 -                       (let ((beg (point)))\r
118 -                         (notmuch-search-show-result date count authors subject tags)\r
119 -                         (notmuch-search-color-line beg (point) tag-list)\r
120 -                         (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
121 -                         (put-text-property beg (point) 'notmuch-search-authors authors)\r
122 -                         (put-text-property beg (point) 'notmuch-search-subject subject)\r
123 -                         (when (string= thread-id notmuch-search-target-thread)\r
124 -                           (set 'found-target beg)\r
125 -                           (set 'notmuch-search-target-thread "found"))))\r
126 +                     (when (string= thread-id notmuch-search-target-thread)\r
127 +                       (set 'found-target (point))\r
128 +                       (set 'notmuch-search-target-thread "found"))\r
129 +                     (notmuch-search-show-result thread-id date count authors subject tag-list)\r
130                       (set 'line (match-end 0)))\r
131                   (set 'more nil)\r
132                   (while (and (< line (length string)) (= (elt string line) ?\n))\r
133 -- \r
134 1.7.10\r
135 \r