summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmondson <dme@dme.org>2010-04-26 11:17:11 +0100
committerCarl Worth <cworth@cworth.org>2010-04-26 08:07:17 -0700
commit75b9b028ea4d611841441b744291e1181b37548f (patch)
treef1b083725ddc31458261177441272d857575e7ef
parent969f1c46213e0cca6be28ffd066f80fa8353d5c9 (diff)
emacs: Correct message/header/citation/signature hiding
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'.
-rw-r--r--emacs/notmuch-show.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index aa8041c..814ab65 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -399,6 +399,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