From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E01DB431FBC for ; Sun, 24 Jun 2012 11:56:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.098 X-Spam-Level: X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 VSXTpPOBmmAT for ; Sun, 24 Jun 2012 11:56:22 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 06425431FAE for ; Sun, 24 Jun 2012 11:56:22 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Siryp-0006pQ-EB; Sun, 24 Jun 2012 19:56:17 +0100 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Siryp-00045g-5Z; Sun, 24 Jun 2012 19:56:15 +0100 From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: add function to toggle display of all multipart/alternative parts In-Reply-To: <1340136889-2992-1-git-send-email-jani@nikula.org> References: <1339775751-18002-1-git-send-email-jani@nikula.org> <1340136889-2992-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.13.2+63~g548a9bf (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Sun, 24 Jun 2012 19:56:09 +0100 Message-ID: <8762agh73q.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 94.192.233.223 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 75a738151befa2cd1cb7a10af76bebc5 (of first 20000 bytes) X-SpamAssassin-Score: -1.8 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.8 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * 0.5 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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: Sun, 24 Jun 2012 18:56:23 -0000 On Tue, 19 Jun 2012, Jani Nikula wrote: > Add function notmuch-show-toggle-multipart-alternative to toggle the > value of notmuch-show-all-multipart/alternative-parts variable in the > buffer, and redisplay the thread with either all or preferred > alternative parts expanded. > > A small wrinkle is that in order to make the variable survive > notmuch-show-refresh-view (which is required for expanding/collapsing > the parts, but ends up calling kill-all-local-variables through > notmuch-show-mode) it is necessary to give it the permanent-local > property. Hi This patch looks good to me with one small concern: I set the variable notmuch-show-all-multipart/alternative-parts in my an emacs file loaded from my .emacs file rather than through customize using (setq notmuch-show-all-multipart/alternative-parts nil) This no longer works because of the buffer local property (ie I see all parts): I need to use (setq-default notmuch-show-all-multipart/alternative-parts nil) This "change" might be worth flagging up in the news file. I do not think the existence of my semi-patch id:"87pq8vokmp.fsf@qmul.ac.uk" should hold up this patch. My patch is only a draft and I definitely do not know enough lisp to be able to write a correct version (with correct quoting of message-ids etc). Best wishes Mark > --- > emacs/notmuch-show.el | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index 36cad93..4d3f03f 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -98,6 +98,18 @@ any given message." > "Should all parts of multipart/alternative parts be shown?" > :type 'boolean > :group 'notmuch-show) > +(make-variable-buffer-local 'notmuch-show-all-multipart/alternative-parts) > +(put 'notmuch-show-all-multipart/alternative-parts 'permanent-local t) > + > +(defun notmuch-show-toggle-multipart-alternative () > + "Toggle the display of all multipart/alternative parts." > + (interactive) > + (setq notmuch-show-all-multipart/alternative-parts > + (not notmuch-show-all-multipart/alternative-parts)) > + (message (if notmuch-show-all-multipart/alternative-parts > + "Showing all multipart/alternative parts." > + "Showing preferred multipart/alternative part.")) > + (notmuch-show-refresh-view)) > > (defcustom notmuch-show-indent-messages-width 1 > "Width of message indentation in threads. > -- > 1.7.9.5 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch