--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 42A96431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Jun 2012 13:14:55 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Alx-zELtqPMD for <notmuch@notmuchmail.org>;\r
+ Tue, 19 Jun 2012 13:14:54 -0700 (PDT)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+ [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 744E8431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Jun 2012 13:14:54 -0700 (PDT)\r
+Received: by lbbgk8 with SMTP id gk8so6786557lbb.26\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Jun 2012 13:14:52 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+ :x-gm-message-state;\r
+ bh=Rjfd322FkZCVE9MnR+g7+SZFA33ssiG23saK2d9TwsQ=;\r
+ b=oIDKynQhmrPVpBmS7dYlA5rKZzGJGa0hLbY60GHPCEgdZhb4VxGUoN7XKbUqAjdsLC\r
+ TPAYFxt9kSirAOmImrwnvf3ZYCwDIbKFkWHblv0IFB4H+ZMYX/UWkD2BuDfq0grobP5h\r
+ 18HZ6U6CTVYIs9xBgJI2tM6ylKlvL59ypXYDZb13R3jB24H5Siib7NG8xlxI8DxCnL4u\r
+ 5HMXDq3HwkIAnYrqfEse8HL7eI40AkCgot49PPgmCe0kJeurgSoHdBNKsRUDZpVEAXn6\r
+ dtBVTNv0g4uUi/avs9/mPumHYiXUYI55Rc2FW899n2iUW/SFvPr8K6Zt7mwlxX4kOZtL\r
+ Jz8g==\r
+Received: by 10.152.146.67 with SMTP id ta3mr19641474lab.27.1340136892696;\r
+ Tue, 19 Jun 2012 13:14:52 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
+ [80.220.80.68])\r
+ by mx.google.com with ESMTPS id fy10sm35354196lab.0.2012.06.19.13.14.50\r
+ (version=SSLv3 cipher=OTHER); Tue, 19 Jun 2012 13:14:51 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] emacs: add function to toggle display of all\r
+ multipart/alternative parts\r
+Date: Tue, 19 Jun 2012 23:14:49 +0300\r
+Message-Id: <1340136889-2992-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <1339775751-18002-1-git-send-email-jani@nikula.org>\r
+References: <1339775751-18002-1-git-send-email-jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnYwwvFIGHEaq4LQAZV+lSUFpcaFpgUZomw3HYrnnZbJx8/FiNlAhmYuyQkiAOZ3+dBXSjI\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 19 Jun 2012 20:14:55 -0000\r
+\r
+Add function notmuch-show-toggle-multipart-alternative to toggle the\r
+value of notmuch-show-all-multipart/alternative-parts variable in the\r
+buffer, and redisplay the thread with either all or preferred\r
+alternative parts expanded.\r
+\r
+A small wrinkle is that in order to make the variable survive\r
+notmuch-show-refresh-view (which is required for expanding/collapsing\r
+the parts, but ends up calling kill-all-local-variables through\r
+notmuch-show-mode) it is necessary to give it the permanent-local\r
+property.\r
+---\r
+ emacs/notmuch-show.el | 12 ++++++++++++\r
+ 1 file changed, 12 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 36cad93..4d3f03f 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -98,6 +98,18 @@ any given message."\r
+ "Should all parts of multipart/alternative parts be shown?"\r
+ :type 'boolean\r
+ :group 'notmuch-show)\r
++(make-variable-buffer-local 'notmuch-show-all-multipart/alternative-parts)\r
++(put 'notmuch-show-all-multipart/alternative-parts 'permanent-local t)\r
++\r
++(defun notmuch-show-toggle-multipart-alternative ()\r
++ "Toggle the display of all multipart/alternative parts."\r
++ (interactive)\r
++ (setq notmuch-show-all-multipart/alternative-parts\r
++ (not notmuch-show-all-multipart/alternative-parts))\r
++ (message (if notmuch-show-all-multipart/alternative-parts\r
++ "Showing all multipart/alternative parts."\r
++ "Showing preferred multipart/alternative part."))\r
++ (notmuch-show-refresh-view))\r
+ \r
+ (defcustom notmuch-show-indent-messages-width 1\r
+ "Width of message indentation in threads.\r
+-- \r
+1.7.9.5\r
+\r