changeset 106745:417baf3f58fe

* gnus-util.el (gnus-invisible-p, gnus-next-char-property-change) (gnus-previous-char-property-change): New functions. * gnus-sum.el (gnus-forward-line-ignore-invisible): Use them.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 06 Jan 2010 00:07:08 +0000
parents 2db50e698b85 (current diff) f973aced61a2 (diff)
children e09f67191b6c 47e4680680fe
files
diffstat 3 files changed, 35 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Tue Jan 05 15:11:04 2010 -0700
+++ b/lisp/gnus/ChangeLog	Wed Jan 06 00:07:08 2010 +0000
@@ -1,3 +1,10 @@
+2010-01-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-invisible-p, gnus-next-char-property-change)
+	(gnus-previous-char-property-change): New functions.
+
+	* gnus-sum.el (gnus-forward-line-ignore-invisible): Use them.
+
 2010-01-05  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* gnus-sum.el (gnus-forward-line-ignore-invisible): New function.
--- a/lisp/gnus/gnus-sum.el	Tue Jan 05 15:11:04 2010 -0700
+++ b/lisp/gnus/gnus-sum.el	Wed Jan 06 00:07:08 2010 +0000
@@ -6734,8 +6734,8 @@
     (while (and (> n 0) (not done))
       ;; If the following character is currently invisible,
       ;; skip all characters with that same `invisible' property value.
-      (while (invisible-p (point))
-	(goto-char (next-char-property-change (point))))
+      (while (gnus-invisible-p (point))
+	(goto-char (gnus-next-char-property-change (point))))
       (forward-line 1)
       (if (eobp)
 	  (setq done t)
@@ -6744,9 +6744,9 @@
       (forward-line -1)
       (if (bobp) (setq done t)
 	(setq n (1+ n))
-	(while (and (not (bobp)) (invisible-p (1- (point))))
-	  (goto-char (previous-char-property-change (point))))))))
-    
+	(while (and (not (bobp)) (gnus-invisible-p (1- (point))))
+	  (goto-char (gnus-previous-char-property-change (point))))))))
+
 (defun gnus-summary-recenter ()
   "Center point in the summary window.
 If `gnus-auto-center-summary' is nil, or the article buffer isn't
--- a/lisp/gnus/gnus-util.el	Tue Jan 05 15:11:04 2010 -0700
+++ b/lisp/gnus/gnus-util.el	Wed Jan 06 00:07:08 2010 +0000
@@ -969,6 +969,29 @@
 			  (overlay-get overlay 'face))
 			(overlays-at pos)))))))
 
+(if (fboundp 'invisible-p)
+    (defalias 'gnus-invisible-p 'invisible-p)
+  ;; for Emacs < 22.2, and XEmacs.
+  (defun gnus-invisible-p (pos)
+    "Return non-nil if the character after POS is currently invisible."
+    (let ((prop (get-char-property pos 'invisible)))
+      (if (eq buffer-invisibility-spec t)
+	  prop
+	(or (memq prop buffer-invisibility-spec)
+	    (assq prop buffer-invisibility-spec))))))
+
+;; Note: the optional 2nd argument has a different meaning between
+;; Emacs and XEmacs.
+;; (next-char-property-change POSITION &optional LIMIT)
+;; (next-extent-change        POS      &optional OBJECT)
+(defalias 'gnus-next-char-property-change
+  (if (fboundp 'next-extent-change)
+      'next-extent-change 'next-char-property-change))
+
+(defalias 'gnus-previous-char-property-change
+  (if (fboundp 'previous-extent-change)
+      'previous-extent-change 'previous-char-property-change))
+
 ;;; Protected and atomic operations.  dmoore@ucsd.edu 21.11.1996
 ;; The primary idea here is to try to protect internal datastructures
 ;; from becoming corrupted when the user hits C-g, or if a hook or