--- /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 51DBA431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 15 Jun 2012 08:55:56 -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 yR89tORVvnzO for <notmuch@notmuchmail.org>;\r
+ Fri, 15 Jun 2012 08:55:56 -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 B07F3431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 15 Jun 2012 08:55:55 -0700 (PDT)\r
+Received: by lbbgk8 with SMTP id gk8so3243772lbb.26\r
+ for <notmuch@notmuchmail.org>; Fri, 15 Jun 2012 08:55:54 -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:x-gm-message-state;\r
+ bh=4A6+jH/oUcowNZW+KiSAzggSxrWY3b0TWvTdn13Fo1o=;\r
+ b=fHuHSYhOQHApO2ek+O97S1ByrjxDj8rwHntv5HrTV7x68XQpyONw/YS0so0lNQoJOo\r
+ rOwmYtoQs4Mi73ZDjHiHxCR8gj5nfGM6ZIm08AfOW5ddsICodk4mga5kSRbimSk6MC8y\r
+ vMvgKwHa1/rKZ8OxSQGb1UTJpNuD2OIehxgBU+cQrfF22M4ii68Q/p4H5cIWpmONZVzN\r
+ S35DhytBOTHjmW/xKra7VwgycJlZNNo15iUX3mXEG1LLw+vumWCyAN4tO5xXT5vngZ1C\r
+ /caBODQKJir5m2YQq9B/d0oVf1Mo200f54GMDV6HjfdPR8y0EgY9CDBTlxtn3Ye+yEDy\r
+ riCA==\r
+Received: by 10.152.108.178 with SMTP id hl18mr6037898lab.11.1339775754203;\r
+ Fri, 15 Jun 2012 08:55:54 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
+ [80.220.80.68]) by mx.google.com with ESMTPS id\r
+ gi19sm12966622lab.16.2012.06.15.08.55.52\r
+ (version=SSLv3 cipher=OTHER); Fri, 15 Jun 2012 08:55:53 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: add function to toggle display of all\r
+ multipart/alternative parts\r
+Date: Fri, 15 Jun 2012 18:55:51 +0300\r
+Message-Id: <1339775751-18002-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+X-Gm-Message-State:\r
+ ALoCoQng8+ac74X9b8NhpH8Zg4peLY00fhRpVNLAVFNt7uXiNyBBhfneBoJu3CI/qBDSy+Knqcbi\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: Fri, 15 Jun 2012 15:55:56 -0000\r
+\r
+Add function notmuch-show-toggle-multipart-alternative to make\r
+notmuch-show-all-multipart/alternative-parts buffer local, toggle its\r
+value in the buffer, and redisplay the thread with either all or\r
+preferred 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 | 11 +++++++++++\r
+ 1 file changed, 11 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 36cad93..9c177d9 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -99,6 +99,17 @@ any given message."\r
+ :type 'boolean\r
+ :group 'notmuch-show)\r
+ \r
++(defun notmuch-show-toggle-multipart-alternative ()\r
++ "Toggle `notmuch-show-all-multipart/alternative-parts' in the buffer."\r
++ (interactive)\r
++ (unless (local-variable-p 'notmuch-show-all-multipart/alternative-parts)\r
++ (make-local-variable 'notmuch-show-all-multipart/alternative-parts)\r
++ ;; Make it permanently local to survive notmuch-show-refresh-view.\r
++ (put 'notmuch-show-all-multipart/alternative-parts 'permanent-local t))\r
++ (setq notmuch-show-all-multipart/alternative-parts\r
++ (not notmuch-show-all-multipart/alternative-parts))\r
++ (notmuch-show-refresh-view))\r
++\r
+ (defcustom notmuch-show-indent-messages-width 1\r
+ "Width of message indentation in threads.\r
+ \r
+-- \r
+1.7.9.5\r
+\r