From 1b483fa10c14622e3ab2dc8a41697a2ad67f4f24 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins Date: Fri, 10 Aug 2012 13:52:47 +1700 Subject: [PATCH] Re: [PATCH] emacs: add function to toggle display of all multipart/alternative parts --- 2f/38240a7b0dc18ca42076e4ec3407a47bdff624 | 115 ++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 2f/38240a7b0dc18ca42076e4ec3407a47bdff624 diff --git a/2f/38240a7b0dc18ca42076e4ec3407a47bdff624 b/2f/38240a7b0dc18ca42076e4ec3407a47bdff624 new file mode 100644 index 000000000..fb000ebdd --- /dev/null +++ b/2f/38240a7b0dc18ca42076e4ec3407a47bdff624 @@ -0,0 +1,115 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id B821D431FAF + for ; Thu, 9 Aug 2012 13:53:06 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.29 +X-Spam-Level: +X-Spam-Status: No, score=-2.29 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3, T_MIME_NO_TEXT=0.01] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id IcUBgqHf7Yuq for ; + Thu, 9 Aug 2012 13:53:06 -0700 (PDT) +Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu + [131.215.239.19]) + by olra.theworths.org (Postfix) with ESMTP id 41A80431FAE + for ; Thu, 9 Aug 2012 13:53:06 -0700 (PDT) +Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) + by fire-doxen-postvirus (Postfix) with ESMTP id 98A2D32802C; + Thu, 9 Aug 2012 13:53:01 -0700 (PDT) +X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new +Received: from finestructure.net (gwave-123.ligo.caltech.edu + [131.215.114.123]) (Authenticated sender: jrollins) by fire-doxen-submit + (Postfix) with ESMTP id BD2FF328012; Thu, 9 Aug 2012 13:52:57 -0700 (PDT) +Received: by finestructure.net (Postfix, from userid 1000) + id 9CF492E8; Thu, 9 Aug 2012 13:52:57 -0700 (PDT) +From: Jameson Graef Rollins +To: Mark Walters , Jani Nikula , + notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: add function to toggle display of all + multipart/alternative parts +In-Reply-To: <87pq8vokmp.fsf@qmul.ac.uk> +References: <1339775751-18002-1-git-send-email-jani@nikula.org> + <87zk80gvmb.fsf@servo.finestructure.net> + <87pq8vokmp.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.13.2+137~ge34ed71 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Thu, 09 Aug 2012 13:52:47 -0700 +Message-ID: <87ipcrvlcw.fsf@servo.finestructure.net> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha256; protocol="application/pgp-signature" +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 09 Aug 2012 20:53:06 -0000 + +--=-=-= + +On Mon, Jun 18 2012, Mark Walters wrote: +> I agree with this cycling approach but I think it needs to be per +> message rather than per buffer. I attach a rather hacky attempt at this +> below: on minimal testing it seems to work. But the lisp is really a bit +> gross. In particular I have no idea if I should be escaping the message +> ids (so this could break in unfortunate/insecure ways) + +Thanks to broken Apple mail clients, I'm getting more and more messages +that have attachments hidden in multipart/"alternatives" to text/plain +parts. So I would really like to revive this patch. + +I just tested it and it still applies to current master, and actually +seems to work great. 'W' cycles through which part is displayed in the +current message. Pretty much exactly what I want. + +Mark seems to think this patch is less than ideal. One issue is that +it's trying to store a setting for a single displayed message in a +variable of full buffer scope. So he's storing a list of message ids +there: + +> +(defvar notmuch-show-message-multipart/alternative nil) +> +(make-variable-buffer-local 'notmuch-show-message-multipart/alternative) +> +(put 'notmuch-show-message-multipart/alternative 'permanent-local t) +... +> + (lax-plist-put notmuch-show-message-multipart/alternative (plist-get msg :id) 0))) + +I can see that might get a little hairy. Can any elisp experts out +there think of a better way to do this? (actually, this is making me +again want a show mode that only displays one message at a time (which I +guess means I need to try pick again)). + +jamie. + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.12 (GNU/Linux) + +iQIcBAEBCAAGBQJQJCMfAAoJEO00zqvie6q8sk4P/3RPLH7RkOj1kag7HKQdfYgN +RbkfPDmigCq3hOYuk4af4WkIMnHt6wK7Hi+vv/DoP1NPjp1azFu52MmrTRxYK01u +OCbfzR4ov8Lt1KD5VOCert7krzZR8wMmsD2wrLiyhLtTfpb/s5YyFSJ1KLlodfPD +Xn725Q86bQPFINYNCY8ClJRvgNPcXEpIgj0t/imXII7T3Tc5/PYhXGR93lnhkIfh +4iIgr0qD3cP+ayYvuGJK8zwZW+DnTVMNaVNPv7XNgxfOdaern/o+MKYwKvdWZ2+q +io1li+POi1RrLwyU18Uzads5z76woGq6sDs8u2oz4bXJc7xh45exAmmUfPjwmoRL +pifyOLytd+RQvlJJ6yQ8PiUzc32TQ37NYcbIBOyVGfJ1eoYmbfH8qc9cH1e+TGXb +XxhnsOSopHrPOhQ25/JrHO5As9gfcc6LdlX5E4e9oHcW71mLkcsnq3+R8BnAGnhD +JtXgI8xEvoOMigs1WjmmYD4kXJDqnagqzH224Fi4al2SmNGuCcD4qIOqHXFZ50nY +/Eoz2z+wjpCvPNLL576j7k9ri1ShnzYObDpjHI232KE0aXF0gJOA9tkj7NwiKRv5 +E8t6mQxuOGSb8JSk+ZNe2/+RM1MGRNDsHNUUwSNFpK37SDZri0Qj2QK6Etn/N6ph +Gw8z7l9WE8Ynr7rR2mYC +=7D/x +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.26.2