[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Aaron Ecay
Text properties change between characters; prev-s-c-property-change
returns the position after the change.  Thus, it is still inside the
invisible region.
---
 emacs/notmuch-show.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f52f233..905c9ec 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1169,8 +1169,9 @@ current window), advance to the next open message."
 (ret nil))
 (while (invisible-p visible-end-of-this-message)
   (setq visible-end-of-this-message
-   (previous-single-char-property-change visible-end-of-this-message
- 'invisible)))
+   (max (point-min)
+(1- (previous-single-char-property-change
+ visible-end-of-this-message 'invisible)
 (cond
  ;; Ideally we would test `end-of-this-message' against the result
  ;; of `window-end', but that doesn't account for the fact that
-- 
1.7.8



[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Xavier Maillard
Hey Aaron,

On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

This patch works for me (at least on all the messages I tested it
on). Thank you very much !

/Xavier


[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Jameson Graef Rollins
On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

Thanks Aaron!  I just tested this and it does seem to fix the issue.

Definitely +1 for this.

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



[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread David Bremner
On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

Pushed, 

d


[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread Dmitry Kurochkin
Hi Aaron.

Thanks for the fix.

Would be nice to have a test for it :)

Regards,
  Dmitry


[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread Dmitry Kurochkin
Hi Aaron.

Thanks for the fix.

Would be nice to have a test for it :)

Regards,
  Dmitry


[PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Aaron Ecay
Text properties change between characters; prev-s-c-property-change
returns the position after the change.  Thus, it is still inside the
invisible region.
---
 emacs/notmuch-show.el |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f52f233..905c9ec 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1169,8 +1169,9 @@ current window), advance to the next open message."
 (ret nil))
 (while (invisible-p visible-end-of-this-message)
   (setq visible-end-of-this-message
-   (previous-single-char-property-change visible-end-of-this-message
- 'invisible)))
+   (max (point-min)
+(1- (previous-single-char-property-change
+ visible-end-of-this-message 'invisible)
 (cond
  ;; Ideally we would test `end-of-this-message' against the result
  ;; of `window-end', but that doesn't account for the fact that
-- 
1.7.8

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


Re: [PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Xavier Maillard
Hey Aaron,

On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

This patch works for me (at least on all the messages I tested it
on). Thank you very much !

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


Re: [PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-22 Thread Jameson Graef Rollins
On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

Thanks Aaron!  I just tested this and it does seem to fix the issue.

Definitely +1 for this.

jamie.


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


Re: [PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread David Bremner
On Thu, 22 Dec 2011 09:24:20 -0500, Aaron Ecay  wrote:
> Text properties change between characters; prev-s-c-property-change
> returns the position after the change.  Thus, it is still inside the
> invisible region.

Pushed, 

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


Re: [PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread Dmitry Kurochkin
Hi Aaron.

Thanks for the fix.

Would be nice to have a test for it :)

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


Re: [PATCH] emacs: fix off-by-one bug in notmuch-show-archive

2011-12-23 Thread Dmitry Kurochkin
Hi Aaron.

Thanks for the fix.

Would be nice to have a test for it :)

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