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

Aaron Ecay aaronecay at gmail.com
Thu Dec 22 06:24:20 PST 2011


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



More information about the notmuch mailing list