# HG changeset patch # User Katsumi Yamaoka # Date 1262736428 0 # Node ID 417baf3f58fee05813802de78fea14c56095757a # Parent 2db50e698b85bcc628c2c8e5f2510105d3fd60c8# Parent f973aced61a2120b1b99cef47c84b69ed72eb56e * 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. diff -r 2db50e698b85 -r 417baf3f58fe lisp/gnus/ChangeLog --- 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 + + * 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 * gnus-sum.el (gnus-forward-line-ignore-invisible): New function. diff -r 2db50e698b85 -r 417baf3f58fe lisp/gnus/gnus-sum.el --- 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 diff -r 2db50e698b85 -r 417baf3f58fe lisp/gnus/gnus-util.el --- 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