summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-01-06 00:00:28 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-01-06 00:00:28 +0000
commit770d9a1f454d31c79dd2a6e2d99477322f43a618 (patch)
tree53a53c6405541546e57902560ddea4f9cae5db71 /lisp/gnus
parentfd579fdca5cb3a71cdb24bace02c335d838a6922 (diff)
Merge from mainline.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/gnus-sum.el10
-rw-r--r--lisp/gnus/gnus-util.el23
3 files changed, 35 insertions, 5 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 1b418e3275a..177b0a032f8 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -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.
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index cd56cd1f4bb..86244a9ca8f 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6734,8 +6734,8 @@ Like forward-line, but skip over (and don't count) invisible lines."
(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 @@ Like forward-line, but skip over (and don't count) invisible lines."
(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
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 28a8c5dbed4..f5679ee850f 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -969,6 +969,29 @@ If there's no subdirectory, delete DIRECTORY as well."
(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