unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH (draft) 2/2] emacs: show: make "view part" show hidden parts
Date: Thu, 25 Oct 2012 09:09:23 +0100	[thread overview]
Message-ID: <1351152563-27277-3-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1351152563-27277-1-git-send-email-markwalters1009@gmail.com>

This change means that hidden parts in the show buffer are inserted
into the buffer when the "view command" is called on that part (by
default v on the button).
---
 emacs/notmuch-show.el |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 9157669..293456d 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -836,7 +836,8 @@ has overridden the default for this part"
     (when (memq nth user-parts)
       (setq not-shown (not not-shown)))
     (if not-shown
-	(notmuch-show-insert-part-header nth content-type content-type nil " (not shown)")
+	(button-put (notmuch-show-insert-part-header nth content-type content-type nil " (not shown)")
+		    :part-not-shown 't)
       (notmuch-show-insert-bodypart-internal msg part content-type nth depth content-type)))
   ;; Some of the body part handlers leave point somewhere up in the
   ;; part, so we make sure that we're down at the end.
@@ -1912,7 +1913,10 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."
 
 (defun notmuch-show-part-button-view (&optional button)
   (interactive)
-  (notmuch-show-part-button-internal button #'notmuch-show-view-part))
+  (let ((button (or button (button-at (point)))))
+    (if (and button (button-get button :part-not-shown))
+	(notmuch-show-part-button-internal button #'notmuch-show-internally-show-part)
+      (notmuch-show-part-button-internal button #'notmuch-show-view-part))))
 
 (defun notmuch-show-part-button-interactively-view (&optional button)
   (interactive)
-- 
1.7.9.1

  parent reply	other threads:[~2012-10-25  8:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  8:09 [PATCH (draft) 0/2] Allow emacs to toggle display of all parts including multipart Mark Walters
2012-10-25  8:09 ` [PATCH (draft) 1/2] emacs: allow the user to toggle the visibility of multipart/alternative parts Mark Walters
2012-10-28  0:08   ` Ethan Glasser-Camp
2012-10-28  8:00     ` Mark Walters
2012-10-25  8:09 ` Mark Walters [this message]
2012-12-02 19:48 ` [PATCH (draft) 0/2] Allow emacs to toggle display of all parts including multipart Jani Nikula
2012-12-03 17:15   ` Jameson Graef Rollins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351152563-27277-3-git-send-email-markwalters1009@gmail.com \
    --to=markwalters1009@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).