[PATCH] emacs: Correct message/header/citation/signature hiding

2010-04-26 Thread David Edmondson
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



[PATCH] emacs: Correct message/header/citation/signature hiding

2010-04-26 Thread Carl Worth
On Mon, 26 Apr 2010 11:17:11 +0100, David Edmondson  wrote:
> 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'.

Thanks for the regression fix, David! You've done a great job ensuring
that our 0.3 release will ready today. And I appreciate that.

> Carl, we need this fix before 0.3 is released.

Pushed now. It's quite nice to have this bug gone.

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



[PATCH] emacs: Correct message/header/citation/signature hiding

2010-04-26 Thread David Edmondson
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

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: Correct message/header/citation/signature hiding

2010-04-26 Thread Carl Worth
On Mon, 26 Apr 2010 11:17:11 +0100, David Edmondson d...@dme.org wrote:
 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'.

Thanks for the regression fix, David! You've done a great job ensuring
that our 0.3 release will ready today. And I appreciate that.

 Carl, we need this fix before 0.3 is released.

Pushed now. It's quite nice to have this bug gone.

-Carl


pgp9DggnOt4Q3.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch