[PATCH (draft) 2/2] emacs: show: make "view part" show hidden parts
authorMark Walters <markwalters1009@gmail.com>
Thu, 25 Oct 2012 08:09:23 +0000 (09:09 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:50:02 +0000 (09:50 -0800)
52/cd1d08960d8249ea559a45ad359ff7524f47eb [new file with mode: 0644]

diff --git a/52/cd1d08960d8249ea559a45ad359ff7524f47eb b/52/cd1d08960d8249ea559a45ad359ff7524f47eb
new file mode 100644 (file)
index 0000000..4af175e
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <markwalters1009@gmail.com>\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 5EE90431FCB\r
+       for <notmuch@notmuchmail.org>; Thu, 25 Oct 2012 01:09:45 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       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 4ecANyDJptn5 for <notmuch@notmuchmail.org>;\r
+       Thu, 25 Oct 2012 01:09:41 -0700 (PDT)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+       [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 915A7431FD0\r
+       for <notmuch@notmuchmail.org>; Thu, 25 Oct 2012 01:09:38 -0700 (PDT)\r
+Received: by mail-we0-f181.google.com with SMTP id u54so795382wey.26\r
+       for <notmuch@notmuchmail.org>; Thu, 25 Oct 2012 01:09:37 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=6lcBIomlH/RgR54ShypwviV26OBCdI0GFJeqXtjgkFY=;\r
+       b=N/T794yrxKIGa+aWQT+cC0g+GoXR5t+aQlQQyR0e0D1RQTXuuWP6PDlZWow4R0E6js\r
+       iT8JTtv1vIxQTKenMAmARGXUvfbWekmt1jD5Ctchse0sGsJsjRnaglQUdyklHg19NZLh\r
+       J99EvPXz9HOSuMy5jOPvFitlfBOKUTd+Nd1mnZulgoXC5nTiUoIEoxaiNRV0C1b/5jKT\r
+       Pj0/oL91vHOSv1Ba9ElyazXNnKGnX9e0cQQd+T9xmpdp5kiO31e5cayGNLFkvKQUFh84\r
+       +gzPwJWkz9mgu8ZJefqctxBz4o+guB83f9NDdSWk1gpH/kqUNpjvgVMc2fu95cfrc7hS\r
+       ZmsA==\r
+Received: by 10.180.96.164 with SMTP id dt4mr8471427wib.10.1351152576843;\r
+       Thu, 25 Oct 2012 01:09:36 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPS id gg4sm9893093wib.6.2012.10.25.01.09.35\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 25 Oct 2012 01:09:35 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH (draft) 2/2] emacs: show: make "view part" show hidden parts\r
+Date: Thu, 25 Oct 2012 09:09:23 +0100\r
+Message-Id: <1351152563-27277-3-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com>\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: Thu, 25 Oct 2012 08:09:45 -0000\r
+\r
+This change means that hidden parts in the show buffer are inserted\r
+into the buffer when the "view command" is called on that part (by\r
+default v on the button).\r
+---\r
+ emacs/notmuch-show.el |    8 ++++++--\r
+ 1 files changed, 6 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 9157669..293456d 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -836,7 +836,8 @@ has overridden the default for this part"\r
+     (when (memq nth user-parts)\r
+       (setq not-shown (not not-shown)))\r
+     (if not-shown\r
+-      (notmuch-show-insert-part-header nth content-type content-type nil " (not shown)")\r
++      (button-put (notmuch-show-insert-part-header nth content-type content-type nil " (not shown)")\r
++                  :part-not-shown 't)\r
+       (notmuch-show-insert-bodypart-internal msg part content-type nth depth content-type)))\r
+   ;; Some of the body part handlers leave point somewhere up in the\r
+   ;; part, so we make sure that we're down at the end.\r
+@@ -1912,7 +1913,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."\r
\r
+ (defun notmuch-show-part-button-view (&optional button)\r
+   (interactive)\r
+-  (notmuch-show-part-button-internal button #'notmuch-show-view-part))\r
++  (let ((button (or button (button-at (point)))))\r
++    (if (and button (button-get button :part-not-shown))\r
++      (notmuch-show-part-button-internal button #'notmuch-show-internally-show-part)\r
++      (notmuch-show-part-button-internal button #'notmuch-show-view-part))))\r
\r
+ (defun notmuch-show-part-button-interactively-view (&optional button)\r
+   (interactive)\r
+-- \r
+1.7.9.1\r
+\r