Re: [PATCH v4 08/16] reorganize indexing of multipart/signed and multipart/encrypted
[notmuch-archives.git] / 9c / 569c53d1f3a3502fd35b02aa8cab86a23c4e24
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 44935421197\r
6         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 12:26:21 -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 6OJW2kmElcET for <notmuch@notmuchmail.org>;\r
16         Tue, 17 Jan 2012 12:26:17 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
18         [18.9.25.12])\r
19         by olra.theworths.org (Postfix) with ESMTP id 364C0421192\r
20         for <notmuch@notmuchmail.org>; Tue, 17 Jan 2012 12:26:17 -0800 (PST)\r
21 X-AuditID: 1209190c-b7fad6d000000920-a6-4f15d968fb20\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 78.83.02336.869D51F4; Tue, 17 Jan 2012 15:26:16 -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 q0HKQGWD025458; \r
27         Tue, 17 Jan 2012 15:26:16 -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 q0HKQFWT015170\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Tue, 17 Jan 2012 15:26:16 -0500 (EST)\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1RnFbY-00085M-0U; Tue, 17 Jan 2012 15:26:04 -0500\r
37 Date: Tue, 17 Jan 2012 15:26:03 -0500\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH 1/1] Make buttons for attachments allow viewing as well\r
41         as saving\r
42 Message-ID: <20120117202603.GP16740@mit.edu>\r
43 References: <1326629796-11436-1-git-send-email-markwalters1009@gmail.com>\r
44         <1326629796-11436-2-git-send-email-markwalters1009@gmail.com>\r
45         <87wr8r5trv.fsf@servo.finestructure.net>\r
46         <87lip7fhkc.fsf@qmul.ac.uk> <20120117022330.GE16740@mit.edu>\r
47         <8739beitq4.fsf@qmul.ac.uk>\r
48 MIME-Version: 1.0\r
49 Content-Type: text/plain; charset=us-ascii\r
50 Content-Disposition: inline\r
51 In-Reply-To: <8739beitq4.fsf@qmul.ac.uk>\r
52 User-Agent: Mutt/1.5.21 (2010-09-15)\r
53 X-Brightmail-Tracker:\r
54  H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsUixCmqrJtxU9Tf4NtTfYvVc3ksrt+cyezA\r
55         5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZey++JSt4IJgRcvi+6wNjG18XYycHBICJhJL\r
56         en6zQ9hiEhfurWfrYuTiEBLYxyjx4/FSJghnA6PE7etzGSGck0wSE88tYYVwljBKzL/eyAbS\r
57         zyKgKvHm810WEJtNQENi2/7ljCC2iICOxO1DC8B2MAtIS3z73cwEYgsLhEvcuQMR5wWquXLq\r
58         DDPE0MlMEqf6t7NBJAQlTs58wgLRrCVx499LoGYOsEHL/3GAhDmBdk1efQdsl6iAisSUk9vY\r
59         JjAKzULSPQtJ9yyE7gWMzKsYZVNyq3RzEzNzilOTdYuTE/PyUot0DfVyM0v0UlNKNzGCA1uS\r
60         Zwfjm4NKhxgFOBiVeHglNoj6C7EmlhVX5h5ilORgUhLlnXUDKMSXlJ9SmZFYnBFfVJqTWnyI\r
61         UYKDWUmE99JloBxvSmJlVWpRPkxKmoNFSZxXReudn5BAemJJanZqakFqEUxWhoNDSYL3MshQ\r
62         waLU9NSKtMycEoQ0EwcnyHAeoOEnQWp4iwsSc4sz0yHypxh1OU6uvXKOUYglLz8vVUqcdxlI\r
63         kQBIUUZpHtwcWEJ6xSgO9JYw7ymQKh5gMoOb9ApoCRPQkpxWIZAlJYkIKakGxqYHS4yl1XxM\r
64         Dqxf++1W8gHzGyy7FDe6fVvCOq9W8QX/TLXIgAzZk6sWO8hqnJn8VE9OzDpeWdj+7e787XPj\r
65         /s6rdo3/GnCFoV2t4Z3QGsbs/XvF/30tbmyVb/ZLreVUc7kk0SY6Z1rnL/UH+9iWzrjyyuak\r
66         4lkzxVf75lSuWKIdnZgpZlIjq8RSnJFoqMVcVJwIACdMdXAjAwAA\r
67 Cc: notmuch@notmuchmail.org\r
68 X-BeenThere: notmuch@notmuchmail.org\r
69 X-Mailman-Version: 2.1.13\r
70 Precedence: list\r
71 List-Id: "Use and development of the notmuch mail system."\r
72         <notmuch.notmuchmail.org>\r
73 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
75 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
76 List-Post: <mailto:notmuch@notmuchmail.org>\r
77 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
78 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
79         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
80 X-List-Received-Date: Tue, 17 Jan 2012 20:26:21 -0000\r
81 \r
82 Quoth Mark Walters on Jan 17 at  9:06 am:\r
83\r
84 > > > I wonder if the "problem" comes from me doing things in a non-lispy\r
85 > > > fashion (I am completely new to lisp). Thus\r
86 > > > notmuch-show-part-button-default-action is a variable that gets passed\r
87 > > > around rather than a function.\r
88 > > \r
89 > > Sorry, I should have looked at the bigger context in this patch.  I\r
90 > > think Jameson was implying that notmuch-show-part-button-default\r
91 > > should change to\r
92 > > \r
93 > > (defun notmuch-show-part-button-default (&optional button)\r
94 > >   (interactive)\r
95 > >   (funcall notmuch-show-part-button-default-action button))\r
96 > > \r
97 > > I would go one step further and say that each action should probably\r
98 > > be a separate function.  That is, break notmuch-show-part-action into\r
99 > > separate functions and simply invoke the appropriate function, rather\r
100 > > than performing a fixed data dispatch.  This would be more flexible\r
101 > > and Lispy.  It may be that your approach works out better, but I'd at\r
102 > > least give this a shot.\r
103\r
104 > I am happy to make that change. My original patch in the summer was more\r
105 > like that:\r
106 > id:"CALUdzSWAto+4mCUOOMk+8vFs+Pog-xUma6u-Aqx2M6-sbyQROg@mail.gmail.com"\r
107 \r
108 Is this the right id?  I couldn't find it in the list archive.\r
109 \r
110 > Is that more what you had in mind? (Only in broad terms: Obviously I\r
111 > would need to add in the customization and default function etc). I\r
112 > decided that I didn't like the code duplication (but I am completely new\r
113 > to lisp) which is why I changed it for this submission.\r
114 \r
115 Yes, I wondered about this, too.  It seems like at worst the\r
116 notmuch-show-process-crypto stuff would be duplicated.  This might be\r
117 little enough that it's not worth worrying about, or it might be worth\r
118 introducing something like\r
119 \r
120 (defun notmuch-with-temp-part-buffer (message-id nth action)\r
121   (let ((process-crypto notmuch-show-process-crypto))\r
122     (with-temp-buffer\r
123       (setq notmuch-show-process-crypto process-crypto)\r
124       ;; Always acquires the part via `notmuch part', even if it is\r
125       ;; available in the JSON output.\r
126       (insert (notmuch-show-get-bodypart-internal message-id nth))\r
127       (funcall action))))\r
128 \r
129 You could also do this as a macro, but that definitely seems like\r
130 overkill.\r