From: Kai Grossjohann Date: Wed, 12 Feb 2003 15:06:16 +0000 (+0000) Subject: 2003-02-12 Michael Shields X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=e0bec1713d40948e6cf3e60303760cc8c380ada4;p=gnus 2003-02-12 Michael Shields * gnus-art.el (gnus-article-only-boring-p): New. (gnus-article-skip-boring): New. * gnus-cite.el (gnus-article-boring-faces): New. * gnus-sum.el (gnus-summary-next-page): Use gnus-article-only-boring-p. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a759e8e1f..58fcbcd03 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2003-02-12 Michael Shields + + * gnus-art.el (gnus-article-only-boring-p): New. + (gnus-article-skip-boring): New. + * gnus-cite.el (gnus-article-boring-faces): New. + * gnus-sum.el (gnus-summary-next-page): Use + gnus-article-only-boring-p. + 2003-02-12 Teodor Zlatanov * spam.el (spam-mark-spam-as-expired-and-move-routine) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index a06d41ebd..cd23f29c2 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -200,6 +200,15 @@ Possible values in this list are: (const :tag "Multiple To and/or Cc headers." many-to)) :group 'gnus-article-hiding) +(defcustom gnus-article-skip-boring nil + "Skip over text that is not worth reading. +By default, if you set this t, then Gnus will display citations and +signatures, but will never scroll down to show you a page consisting +only of boring text. Boring text is controlled by +`gnus-article-boring-faces'." + :type 'boolean + :group 'gnus-article-hiding) + (defcustom gnus-signature-separator '("^-- $" "^-- *$") "Regexp matching signature separator. This can also be a list of regexps. In that case, it will be checked @@ -4735,6 +4744,27 @@ Argument LINES specifies lines to be scrolled down." (goto-char (point-min)))) (move-to-window-line 0))))) +(defun gnus-article-only-boring-p () + "Decide whether there is only boring text remaining in the article. +Something \"interesting\" is a word of at least two letters that does +not have a face in `gnus-article-boring-faces'." + (when (and gnus-article-skip-boring + gnus-article-boring-faces) + (save-excursion + (catch 'only-boring + (while (re-search-forward "\\b\\w\\w" nil t) + (forward-char -1) + (when (not (gnus-intersection + (cons (plist-get (text-properties-at (point)) + 'face) + (mapcar-extents + '(lambda (extent) + (extent-property extent 'face)) + nil (current-buffer) (point) (point))) + gnus-article-boring-faces)) + (throw 'only-boring nil))) + (throw 'only-boring t))))) + (defun gnus-article-refer-article () "Read article specified by message-id around point." (interactive) diff --git a/lisp/gnus-cite.el b/lisp/gnus-cite.el index f3e53a202..1db19ccc4 100644 --- a/lisp/gnus-cite.el +++ b/lisp/gnus-cite.el @@ -29,7 +29,6 @@ (eval-when-compile (require 'cl)) (require 'gnus) -(require 'gnus-art) (require 'gnus-range) (require 'message) ; for message-cite-prefix-regexp @@ -251,6 +250,17 @@ This should make it easier to see who wrote what." :group 'gnus-cite :type 'boolean) +;; This has to go here because its default value depends on +;; gnus-cite-face-list. +(defcustom gnus-article-boring-faces (cons 'gnus-signature-face + gnus-cite-face-list) + "List of faces that are not worth reading. +If an article has more pages below the one you are looking at, but +nothing on those pages is a word of at least three letters that is not +in a boring face, then the pages will be skipped." + :type '(repeat face) + :group 'gnus-article-hiding) + ;;; Internal Variables: (defvar gnus-cite-article nil) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index cc1d05c3a..392f6936e 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -7098,7 +7098,8 @@ If STOP is non-nil, just stop when reaching the end of the message." (gnus-summary-display-article article) (when article-window (gnus-eval-in-buffer-window gnus-article-buffer - (setq endp (gnus-article-next-page lines))) + (setq endp (or (gnus-article-next-page lines) + (gnus-article-only-boring-p)))) (when endp (cond (stop (gnus-message 3 "End of message"))