Re: [PATCH 3/5] nmbug-status: Add an nmbug-status(5) man page
[notmuch-archives.git] / 70 / ac8f4cf7e4e2e35e263aab3a305a31cc265f64
1 Return-Path: <aclements@csail.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 B97CB431FC0\r
6         for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 21:17:04 -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 Dx5UpesgqxJg for <notmuch@notmuchmail.org>;\r
16         Fri, 14 Dec 2012 21:17:02 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
18         [18.9.25.14])\r
19         by olra.theworths.org (Postfix) with ESMTP id 5ADD3429E2E\r
20         for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 21:16:53 -0800 (PST)\r
21 X-AuditID: 1209190e-b7f516d0000008e4-9b-50cc07c49763\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id B8.8A.02276.4C70CC05; Sat, 15 Dec 2012 00:16:52 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id qBF5Gqt3021678; \r
27         Sat, 15 Dec 2012 00:16:52 -0500\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\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 qBF5Gplj011585\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Sat, 15 Dec 2012 00:16:52 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <aclements@csail.mit.edu>)\r
36         id 1Tjk7G-0006zU-PF; Sat, 15 Dec 2012 00:16:50 -0500\r
37 Date: Sat, 15 Dec 2012 00:16:50 -0500\r
38 From: Austin Clements <aclements@csail.mit.edu>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH 2/3] emacs: show: add overlays for each part\r
41 Message-ID: <20121215051650.GE6187@mit.edu>\r
42 References: <1354663662-20524-1-git-send-email-markwalters1009@gmail.com>\r
43         <1354663662-20524-3-git-send-email-markwalters1009@gmail.com>\r
44         <87txrtnssb.fsf@awakening.csail.mit.edu>\r
45         <87obhy72o1.fsf@qmul.ac.uk>\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=us-ascii\r
48 Content-Disposition: inline\r
49 In-Reply-To: <87obhy72o1.fsf@qmul.ac.uk>\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)\r
51 X-Brightmail-Tracker:\r
52  H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hRV1j3CfibAYPldG4vVc3ksrt+cyezA\r
53         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZey8soOlYKtSRffXXYwNjPOluxg5OSQETCTm\r
54         rF/MCmGLSVy4t56ti5GLQ0hgH6PE8q0LWCGcDYwS0xr+QDkXmSRm3VvIDuGsZpRYdm8nWD+L\r
55         gKrE7WWT2EBsNgF9iRVrJ4HFRQR0JG4fWsAOYjMLSEt8+93MBGILCzhIzJ+2ECzOK6AtceNY\r
56         IwvE0EuMEv1n57BAJAQlTs58wgLRrCVx499LoGYOsEHL/3GAmJwCGhKdb1JAKkQFVCSmnNzG\r
57         NoFRaBaS5llImmchNC9gZF7FKJuSW6Wbm5iZU5yarFucnJiXl1qka6yXm1mil5pSuokRHNaS\r
58         fDsYvx5UOsQowMGoxMO7I+J0gBBrYllxZe4hRkkOJiVR3lsMZwKE+JLyUyozEosz4otKc1KL\r
59         DzFKcDArifCKbQEq501JrKxKLcqHSUlzsCiJ815JuekvJJCeWJKanZpakFoEk5Xh4FCS4P3B\r
60         BjRUsCg1PbUiLTOnBCHNxMEJMpwHaPh+kBre4oLE3OLMdIj8KUZFKXHeqyAJAZBERmkeXC8s\r
61         7bxiFAd6RZg3GqSKB5iy4LpfAQ1mAhocd+k4yOCSRISUVAOjK4sV09OWV2XSa2uP73m6wdhe\r
62         Odsz5lDNUtcsdbadNnc2cccvqVzE+MPkwwfu320bFx/xLC7Keq489erMd3d2Ffe8EHN/evtm\r
63         54pVazYF/PprF7D9x6VXr/auNHO/cs3//9sPN/v0Tz/Yrvb8RJurrVdxrvtlPTH3XY5b7Nwk\r
64         Et+4B76afZNxlRJLcUaioRZzUXEiAOeiYrwWAwAA\r
65 X-Mailman-Approved-At: Fri, 14 Dec 2012 23:21:25 -0800\r
66 Cc: notmuch@notmuchmail.org\r
67 X-BeenThere: notmuch@notmuchmail.org\r
68 X-Mailman-Version: 2.1.13\r
69 Precedence: list\r
70 List-Id: "Use and development of the notmuch mail system."\r
71         <notmuch.notmuchmail.org>\r
72 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
75 List-Post: <mailto:notmuch@notmuchmail.org>\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
77 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
78         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
79 X-List-Received-Date: Sat, 15 Dec 2012 05:17:05 -0000\r
80 \r
81 Quoth Mark Walters on Dec 13 at  8:54 am:\r
82 > >> +                                               (string= chosen-type inner-type))))))\r
83 > >\r
84 > > You could let-bind the (not (or ..)) to some variable ("hide" perhaps)\r
85 > > in the let above to avoid this crazy line length.\r
86 > >\r
87 > >>      inner-parts)\r
88 > >>  \r
89 > >>      (when notmuch-show-indent-multipart\r
90 > >> @@ -840,17 +839,52 @@ message at DEPTH in the current thread."\r
91 > >>        (setq handlers (cdr handlers))))\r
92 > >>    t)\r
93 > >>  \r
94 > >> -(defun notmuch-show-insert-bodypart (msg part depth)\r
95 > >> -  "Insert the body part PART at depth DEPTH in the current thread."\r
96 > >> +(defun notmuch-show-insert-part-overlays (msg beg end not-shown)\r
97 > >\r
98 > > s/not-shown/hide/?  Or hidden?\r
99 > >\r
100 > >> +  "Add an overlay to the part between BEG and END"\r
101 > >> +  (let* ((button (button-at beg))\r
102 > >> +   (part-beg (and button (1+ (button-end button)))))\r
103 > >> +\r
104 > >> +    ;; If the part contains no text we do not make it toggleable.\r
105 > >> +    (unless (or (not button) (eq part-beg end))\r
106 > >\r
107 > > (when (and button (/= part-beg end)) ...) ?\r
108 > >\r
109 > >> +      (let ((base-label (button-get button :base-label))\r
110 > >> +      (overlay (make-overlay part-beg end))\r
111 > >> +      (message-invis-spec (plist-get msg :message-invis-spec))\r
112 > >> +      (invis-spec (make-symbol "notmuch-part-region")))\r
113 > >> +\r
114 > >> +  (overlay-put overlay 'invisible (list invis-spec message-invis-spec))\r
115 > >\r
116 > > Non-trivial buffer invisibility specs are really bad for performance\r
117 > > (Emacs' renderer does the obvious O(n^2) thing when rendering a buffer\r
118 > > with an invisibility spec).  Unfortunately, because of notmuch-wash and\r
119 > > the way overlays with trivial 'invisible properties combine with\r
120 > > overlays with list-type 'invisible properties combine, I don't think it\r
121 > > can be avoided.  But if we get rid of buffer invisibility specs from\r
122 > > notmuch-wash, this code can also get much simpler.\r
123\r
124 > How do you plan to get rid of the invisibility properties from notmuch\r
125 > wash? \r
126 \r
127 Not the invisibility properties.  The invisibility specs.  The\r
128 performance impact and difficult composition comes from using buffer\r
129 invisibility specs, but the 'invisible text property can be simply nil\r
130 or t.  These are just as easy to manipulate as the generated\r
131 invisibility symbols we use all over the place (you just manipulate\r
132 the property directly instead of the buffer invisibility spec).  They\r
133 also compose like you'd want (if any overlay over some text has\r
134 'invisible set to t, then that text is invisible).\r
135 \r
136 > >> +  (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show)\r
137 > >\r
138 > > This will leave the "(not shown)" in the part header if isearch unfolds\r
139 > > the part.\r
140 > >\r
141 > > Do we even want isearch to unfold parts?  It's not clear we do for\r
142 > > multipart/alternative.  If we do, probably the right thing is something\r
143 > > like\r
144\r
145 > I don't think we want to search hidden bodyparts so I just deleted this\r
146 > line.\r
147\r
148 > >\r
149 > > (overlay-put overlay 'notmuch-show-part-button button)\r
150 > > (overlay-put overlay 'isearch-open-invisible #'notmuch-show-part-isearch-open)\r
151 > >\r
152 > > (defun notmuch-show-part-isearch-open (overlay)\r
153 > >   (notmuch-show-toggle-invisible-part-action\r
154 > >    (overlay-get overlay 'notmuch-show-part-button)))\r
155 > >\r
156 > >> +  (overlay-put overlay 'priority 10)\r
157 > >> +  (overlay-put overlay 'type "part")\r
158 > >> +  ;; Now we have to add invis-spec to every overlay this\r
159 > >> +  ;; overlay contains, otherwise these inner overlays will\r
160 > >> +  ;; override this one.\r
161 > >\r
162 > > Interesting.  In the simple case of using nil or t for 'invisible, the\r
163 > > specs do combine as one would expect, but you're right that, with a\r
164 > > non-trivial invisibility-spec, the highest priority overlay wins.  It's\r
165 > > too bad we don't know the depth of the part or we could just set the\r
166 > > overlay priority.  This is another thing that would go away if we didn't\r
167 > > use buffer invisibility-specs.\r
168\r
169 > I don't think priorities get it right. As far as I could tell if you\r
170 > have two overlays at different priorities both with invisibility\r
171 > properties then the higher priority overlay decides visibility by\r
172 > itself: that is if it says invisible then the text is invisible, and if\r
173 > it says visible then the text is visible.\r
174 \r
175 Yes.  I think I was confused when I claimed we could use priorities,\r
176 since I can't reconstruct how I thought we could do that.\r