From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A7EBD431FC0 for ; Sat, 15 Dec 2012 00:15:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 2.7 X-Spam-Level: ** X-Spam-Status: No, score=2.7 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SjKk8EhuPj6P for ; Sat, 15 Dec 2012 00:15:43 -0800 (PST) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id EE7CF431FBF for ; Sat, 15 Dec 2012 00:15:42 -0800 (PST) Received: by mail-wi0-f175.google.com with SMTP id hm11so957239wib.2 for ; Sat, 15 Dec 2012 00:15:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=6niYTkAdxn498nkQxkeiFymEWEm/wePW/VA8nUHMhzg=; b=avc6IsAUDwSVE/2BJoUjalx1EY4aFY7ZBhrPRHT+A1DA+DHPdoaTFVCJ4VEql74bgS K/RcNLbqIcCdJNCrmmEt50oTtRsnqhos23VL8UNyFzaJypP6oEnJV3UoZLdVmLOo8upz 2/0D5rn15wAGY5bBK5p5e/oQ8o2XqmJHJANrjCMMjQZAkRBBwQBtCTIdbwOgwlRc07IK 2+dNYcy8Nz0Y+UkGwlAW1O0VpJI1e7IU/sgQSgER75vVvV0YKwH65FFgouLu2HztfPZG JLe6EH7Kr8L4UjYcicJ9wChUN1RdI/8rhmrATV9t2TRVONcvtbTe15soY97qNyJVZgGP SG7g== Received: by 10.194.76.137 with SMTP id k9mr7500166wjw.29.1355559341621; Sat, 15 Dec 2012 00:15:41 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id d9sm1249361wiw.0.2012.12.15.00.15.39 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2012 00:15:40 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v3 0/5] Use invisibility to toggle display of all parts including multipart Date: Sat, 15 Dec 2012 08:15:32 +0000 Message-Id: <1355559338-14313-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 08:15:43 -0000 This is version 3 of this set: version 2 is at id:1355389924-3718-1-git-send-email-markwalters1009@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)