Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 421D8431FB6 for ; Mon, 17 Dec 2012 13:55:01 -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 gfeJ-RxV94rj for ; Mon, 17 Dec 2012 13:55:00 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 58F91431FAE for ; Mon, 17 Dec 2012 13:55:00 -0800 (PST) Received: by mail-we0-f181.google.com with SMTP id t11so2875994wey.26 for ; Mon, 17 Dec 2012 13:54:57 -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=6BRPqmAXvnnPrCdX9vUsEbm2LRR7pnwW/MCZ+baktqc=; b=NUlo7n1wh0hNnUHozrn6JzLLBYC30k6+AU4P/3m7xqXCpJ2VQw4tSOg0v2uLi13H8v UphxIS4HpNcTtM5PGLLf7J7/1aQf+C0L0skf98ozfkpd3bOgiy489HbqVp0/ACC+jw+A hdknCNAQW5U/oq4l5MpNB2GVp3wLHTlDKqy8CjyqQ+KBYLFpFgggIy6l94ZHGGyH9WMw lSPsTXqLfb1Lc7BZGIifXJ8mVY1ED51JFOFpwjsxzZ/dVHa+1gW3+89UsI9G6iE2zFgx OppeIdLJEURQ4F/jqjHQclsWoyuRvFq5OqbeJadHXx2JYgBn5p6TSsYvn3fhrykbNmrL 5V+w== Received: by 10.194.235.100 with SMTP id ul4mr20109446wjc.7.1355781297838; Mon, 17 Dec 2012 13:54:57 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id cf6sm14591602wib.3.2012.12.17.13.54.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2012 13:54:56 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v4 0/5] Use invisibility to toggle display of all parts including multipart Date: Mon, 17 Dec 2012 21:54:42 +0000 Message-Id: <1355781287-6010-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: Mon, 17 Dec 2012 21:55:01 -0000 This is version 4 of this series (previous version at id:1355559338-14313-1-git-send-email-markwalters1009@gmail.com). The only change should be a bugfix which, for reasons I don't understand, only causes a problem on emacs 24. The problem is that the part invisibility code looks for a part button at the start of the region. This gets confused if there is a part with no part button (this is the case for the first part if it is text/plain) and the part starts with a button (as can happen if the message starts with the reply as in the first test in test/emacs-show). This checks that the button is a part button before creating the part overlay. The diff 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 | 115 ++++++++++++++++++++++++++++++++++++++----------- emacs/notmuch-wash.el | 2 +- 2 files changed, 90 insertions(+), 27 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 5ca6fe2..3816e32 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -865,8 +865,10 @@ message at DEPTH in the current thread." (let* ((button (button-at beg)) (part-beg (and button (1+ (button-end button))))) - ;; If the part contains no text we do not make it toggleable. - (when (and button (/= part-beg end)) + ;; If the part contains no text we do not make it toggleable. We + ;; also need to check that the button is a genuine part button not + ;; a notmuch-wash button. + (when (and button (/= part-beg end) (button-get button :base-label)) (let ((base-label (button-get button :base-label)) (overlay (make-overlay part-beg end)) (message-invis-spec (plist-get msg :message-invis-spec)) -- 1.7.9.1