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 A807A4196F0 for ; Mon, 26 Apr 2010 03:17:05 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 7n+jpZ0C9Bf2 for ; Mon, 26 Apr 2010 03:17:05 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id BFE14431FC1 for ; Mon, 26 Apr 2010 03:17:04 -0700 (PDT) Received: by wyj26 with SMTP id 26so582548wyj.26 for ; Mon, 26 Apr 2010 03:17:03 -0700 (PDT) Received: by 10.216.90.4 with SMTP id d4mr5071881wef.135.1272277023407; Mon, 26 Apr 2010 03:17:03 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id r29sm319738wbv.15.2010.04.26.03.17.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 03:17:02 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id B05E9594135; Mon, 26 Apr 2010 11:17:12 +0100 (BST) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Correct message/header/citation/signature hiding Date: Mon, 26 Apr 2010 11:17:11 +0100 Message-Id: <1272277031-32419-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 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, 26 Apr 2010 10:17:05 -0000 Set `buffer-invisibility-spec' to `nil' (a list) if it is just `t' before inserting any body parts, otherwise removing items from `buffer-invisibility-spec' (which is what `notmuch-show-headers-visible' and `notmuch-show-message-visible' do) is a no-op and has no effect. This caused threads with only matching messages to have those messages hidden initially because `buffer-invisibility-spec' stayed `t'. --- Carl, we need this fix before 0.3 is released. The bug has always existed in the JSON based UI and is now exposed because previously there was always a call to `add-to-invisibility-spec' (for the headers), which transformed `buffer-invisiliblty-spec' from `t' to a list. That doesn't always happen now (only calls to `remove-from-invisibility-spec'), so the variable could get left as `t'. emacs/notmuch-show.el | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index f958a30..f9d6c93 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -382,6 +382,22 @@ current buffer, if possible." (headers-invis-spec (notmuch-show-make-symbol "header")) (message-invis-spec (notmuch-show-make-symbol "message"))) + ;; Set `buffer-invisibility-spec' to `nil' (a list), otherwise + ;; removing items from `buffer-invisibility-spec' (which is what + ;; `notmuch-show-headers-visible' and + ;; `notmuch-show-message-visible' do) is a no-op and has no + ;; effect. This caused threads with only matching messages to have + ;; those messages hidden initially because + ;; `buffer-invisibility-spec' stayed `t'. + ;; + ;; This needs to be set here (rather than just above the call to + ;; `notmuch-show-headers-visible') because some of the part + ;; rendering or body washing functions + ;; (e.g. `notmuch-wash-text/plain-citations') manipulate + ;; `buffer-invisibility-spec'). + (when (eq buffer-invisibility-spec t) + (setq buffer-invisibility-spec nil)) + (setq message-start (point-marker)) (notmuch-show-insert-headerline headers -- 1.7.0