[PATCH v3 0/5] Use invisibility to toggle display of all parts including multipart

Mark Walters markwalters1009 at gmail.com
Sat Dec 15 00:15:32 PST 2012


This is version 3 of this set: version 2 is at
id:1355389924-3718-1-git-send-email-markwalters1009 at gmail.com

This fixes the things Austin pointed out in the previous version.

Diff from v2 is below the diffstat.

Best wishes 

Mark

Mark Walters (5):
  emacs: show: modify insert-part-header to save the button text
  emacs: show: add overlays for each part
  emacs: show: add invisibility button action
  emacs: wash: fix fake-diff part to include msg parameter
  emacs: show: set default show-all-multipart/alternatives to nil

 emacs/notmuch-show.el |  113 +++++++++++++++++++++++++++++++++++++-----------
 emacs/notmuch-wash.el |    2 +-
 2 files changed, 88 insertions(+), 27 deletions(-)



diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index c43dd32..457f84a 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -478,7 +478,6 @@ message at DEPTH in the current thread."
     (define-key map "v" 'notmuch-show-part-button-view)
     (define-key map "o" 'notmuch-show-part-button-interactively-view)
     (define-key map "|" 'notmuch-show-part-button-pipe)
-    (define-key map "t" 'notmuch-show-toggle-invisible-part-action)
     map)
   "Submap for button commands")
 (fset 'notmuch-show-part-button-map notmuch-show-part-button-map)
@@ -556,7 +555,7 @@ message at DEPTH in the current thread."
       (mm-pipe-part handle))))
 
 ;; This is taken from notmuch-wash: maybe it should be unified?
-(defun notmuch-show-toggle-invisible-part-action (&optional button)
+(defun notmuch-show-toggle-part-invisibility (&optional button)
   (interactive)
   (let* ((button (or button (button-at (point))))
 	 (overlay (button-get button 'overlay))
@@ -861,7 +860,7 @@ message at DEPTH in the current thread."
       (setq handlers (cdr handlers))))
   t)
 
-(defun notmuch-show-insert-part-overlays (msg beg end hide)
+(defun notmuch-show-create-part-overlays (msg beg end hide)
   "Add an overlay to the part between BEG and END"
   (let* ((button (button-at beg))
 	 (part-beg (and button (1+ (button-end button)))))
@@ -875,7 +874,6 @@ message at DEPTH in the current thread."
 
 	(overlay-put overlay 'invisible (list invis-spec message-invis-spec))
 	(overlay-put overlay 'priority 10)
-	(overlay-put overlay 'type "part")
 	;; Now we have to add invis-spec to every overlay this
 	;; overlay contains, otherwise these inner overlays will
 	;; override this one.
@@ -892,7 +890,7 @@ message at DEPTH in the current thread."
       ;; button label right.
       (save-excursion
 	(when hide
-	  (notmuch-show-toggle-invisible-part-action button))))))
+	  (notmuch-show-toggle-part-invisibility button))))))
 
 (defun notmuch-show-insert-bodypart (msg part depth &optional hide)
   "Insert the body part PART at depth DEPTH in the current thread.
@@ -909,7 +907,7 @@ If HIDE is non-nil then initially hide this part."
     ;; Ensure that the part ends with a carriage return.
     (unless (bolp)
       (insert "\n"))
-    (notmuch-show-insert-part-overlays msg beg (point) hide)))
+    (notmuch-show-create-part-overlays msg beg (point) hide)))
 
 (defun notmuch-show-insert-body (msg body depth)
   "Insert the body BODY at depth DEPTH in the current thread."
@@ -2023,7 +2021,7 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."
   (interactive)
   (let ((button (or button (button-at (point)))))
     (if (button-get button 'invisibility-spec)
-	(notmuch-show-toggle-invisible-part-action button)
+	(notmuch-show-toggle-part-invisibility button)
       (notmuch-show-part-button-internal button notmuch-show-part-button-default-action))))
 
 (defun notmuch-show-part-button-save (&optional button)






More information about the notmuch mailing list