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 arlo.cworth.org (Postfix) with ESMTP id 8DDF86DE0943
\r
6 for <notmuch@notmuchmail.org>; Thu, 20 Aug 2015 06:12:49 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.814 tagged_above=-999 required=5 tests=[AWL=0.881,
\r
12 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,
\r
13 RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001]
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id RvM-p3lJ1M5g for <notmuch@notmuchmail.org>;
\r
18 Thu, 20 Aug 2015 06:12:44 -0700 (PDT)
\r
19 Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com
\r
21 by arlo.cworth.org (Postfix) with ESMTPS id E05EB6DE01F5
\r
22 for <notmuch@notmuchmail.org>; Thu, 20 Aug 2015 06:12:43 -0700 (PDT)
\r
23 Received: by wicne3 with SMTP id ne3so15822271wic.1
\r
24 for <notmuch@notmuchmail.org>; Thu, 20 Aug 2015 06:12:39 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:user-agent:to:subject:from:date:message-id
\r
28 :mime-version:content-type;
\r
29 bh=cW5hWN9yFhifVxvOUCiFsgH5C9AWNafvwLlGjHPc+Hc=;
\r
30 b=VNmu2jPi7/9I6jKJGMmBoXqtyKKjCKyn9bqnIT7hPMg3bTxY+wzgF1uH4NljtfRWCY
\r
31 ttXVJIeXfBmvH61GSpfSZs7rSP2NVNqUARuAhwlqgPLLe4fkqheklEZmYrhCtdeh4lrI
\r
32 U2uTOgZimIEki/CUMi+DMuuWx4VQMQwebHQk5AEXsG8PgpmBvt609w3h9/nywo4wIA+b
\r
33 JOAn/n90c6Zvg5Q0AuDNXIrCWcSfAt5uMITN5gSZMa16ugUg/ZGCoiOu8I8OB0NyuCIy
\r
34 sskFf/LYKUkVeHr1dFxxfEJxh/jjId7LeOlyi/wwyJwqjSqnDA2tht3xv7yjGhHILJvy
\r
37 ALoCoQm2yBl31OB+45rSFPTj2RCpQkIPIdeFeRPJy742IQ3HxabOFtil8TgLhJ2VaA/zrmcnSk4v
\r
38 X-Received: by 10.194.221.4 with SMTP id qa4mr5929577wjc.145.1440076359541;
\r
39 Thu, 20 Aug 2015 06:12:39 -0700 (PDT)
\r
40 Received: from disaster-area.hh.sledj.net
\r
41 ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])
\r
42 by smtp.gmail.com with ESMTPSA id ma4sm5516453wjb.38.2015.08.20.06.12.37
\r
43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
44 Thu, 20 Aug 2015 06:12:38 -0700 (PDT)
\r
45 Received: from localhost (30000@localhost [local]);
\r
46 by localhost (OpenSMTPD) with ESMTPA id b311363a;
\r
47 Thu, 20 Aug 2015 13:12:37 +0000 (UTC)
\r
48 User-Agent: OpenSMTPD enqueuer (Demoostik)
\r
49 To: notmuch@notmuchmail.org
\r
50 Subject: using the fringe to indicate good signatures
\r
51 From: David Edmondson <dme@dme.org>
\r
52 Date: Thu, 20 Aug 2015 14:12:26 +0100
\r
53 Message-ID: <m2mvxmxfwl.fsf@heart-of-gold.hh.sledj.net>
\r
55 Content-Type: multipart/signed; boundary="==-=-=";
\r
56 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.18
\r
60 List-Id: "Use and development of the notmuch mail system."
\r
61 <notmuch.notmuchmail.org>
\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
63 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
65 List-Post: <mailto:notmuch@notmuchmail.org>
\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
68 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
69 X-List-Received-Date: Thu, 20 Aug 2015 13:12:49 -0000
\r
72 Content-Type: multipart/mixed; boundary="=-=-="
\r
75 Content-Type: text/plain
\r
77 After listening to bremner, dkg et al. from Heidelberg, I threw together
\r
78 a quick patch to see how we might indicate signature validity in the
\r
79 fringe. The intention is to prompt more discussion - this code is not
\r
82 The patch is attached. The result looks something like:
\r
83 http://dme.org/data/images/notmuch-signed-fringe.png
\r
89 Content-Type: text/x-patch
\r
90 Content-Disposition: inline; filename=signed-fringe.diff
\r
91 Content-Transfer-Encoding: quoted-printable
\r
93 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
94 index 4dee34b..3d447af 100644
\r
95 =2D-- a/emacs/notmuch-show.el
\r
96 +++ b/emacs/notmuch-show.el
\r
97 @@ -646,25 +646,46 @@ will return nil if the CID is unknown or cannot be re=
\r
99 (indent-rigidly start (point) 1)))
\r
102 =2D(defun notmuch-show-insert-part-multipart/signed (msg part content-type =
\r
104 =2D (button-put button 'face 'notmuch-crypto-part-header)
\r
105 =2D ;; add signature status button if sigstatus provided
\r
106 =2D (if (plist-member part :sigstatus)
\r
107 =2D (let* ((from (notmuch-show-get-header :From msg))
\r
108 =2D (sigstatus (car (plist-get part :sigstatus))))
\r
109 =2D (notmuch-crypto-insert-sigstatus-button sigstatus from))
\r
110 =2D ;; if we're not adding sigstatus, tell the user how they can get it
\r
111 =2D (button-put button 'help-echo "Set notmuch-crypto-process-mime to pr=
\r
112 ocess cryptographic MIME parts."))
\r
113 +;; None of the existing fringe bitmaps are empty.
\r
114 +(define-fringe-bitmap 'notmuch-show--fringe-empty '[])
\r
116 =2D (let ((inner-parts (plist-get part :content))
\r
117 =2D (start (point)))
\r
118 =2D ;; Show all of the parts.
\r
119 =2D (mapc (lambda (inner-part)
\r
120 =2D (notmuch-show-insert-bodypart msg inner-part depth))
\r
122 +(defun notmuch-show--sigstatus-to-fringe-string (status)
\r
123 + (let ((good-bad-ugly (plist-get status :status)))
\r
125 + ((string=3D good-bad-ugly "good")
\r
126 + (propertize "dummy" 'display
\r
127 + '(left-fringe notmuch-show--fringe-empty notmuch-crypto-signature-good=
\r
129 + ;; XXX dme: insert more here.
\r
132 =2D (when notmuch-show-indent-multipart
\r
133 =2D (indent-rigidly start (point) 1)))
\r
134 +(defun notmuch-show-insert-part-multipart/signed (msg part content-type nt=
\r
136 + (let ((start-of-signed (point)))
\r
137 + (button-put button 'face 'notmuch-crypto-part-header)
\r
139 + (let ((sigstatus (car (plist-get part :sigstatus)))
\r
140 + (from (notmuch-show-get-header :From msg)))
\r
141 + ;; Add signature status button if status is provided.
\r
143 + (notmuch-crypto-insert-sigstatus-button sigstatus from)
\r
144 + ;; If we're not adding the status, tell the user how they can
\r
146 + (button-put button 'help-echo "Set notmuch-crypto-process-mime to process=
\r
147 cryptographic MIME parts."))
\r
149 + (let ((inner-parts (plist-get part :content))
\r
151 + (fringe-string (notmuch-show--sigstatus-to-fringe-string sigstatus)))
\r
152 + ;; Show all of the parts.
\r
153 + (mapc (lambda (inner-part)
\r
154 + (notmuch-show-insert-bodypart msg inner-part depth))
\r
157 + (when notmuch-show-indent-multipart
\r
158 + (indent-rigidly start (point) 1))
\r
160 + (when fringe-string
\r
161 + (replace-regexp "^" fringe-string nil start-of-signed (point))))
\r
166 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type=
\r
172 Content-Type: application/pgp-signature; name="signature.asc"
\r
174 -----BEGIN PGP SIGNATURE-----
\r
176 iKYEARECAGYFAlXV0jpfFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl
\r
177 bnBncC5maWZ0aGhvcnNlbWFuLm5ldDc1M0Y5NDJDMEExNjc3MDE4OURGMUYyMDY5
\r
178 RUNEMEFCRjA0OTY1MTYACgkQaezQq/BJZRZIXACfSBOHJK7eXN/DAXDzvmZ6Tnb0
\r
179 UQ4An2zRMSiUKRanCDP6VzmQLk8mouAc
\r
181 -----END PGP SIGNATURE-----
\r