From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/50001 Path: main.gmane.org!not-for-mail From: Michael Shields Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Skip over citations and signature (resend) Date: Tue, 11 Feb 2003 04:21:29 +0000 Organization: Mad Science Research Labs Sender: owner-ding@hpc.uh.edu Message-ID: <87smuvh2gm.fsf@mulligatwani.msrl.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1044937282 12230 80.91.224.249 (11 Feb 2003 04:21:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 11 Feb 2003 04:21:22 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18iRuY-00039A-00 for ; Tue, 11 Feb 2003 05:20:46 +0100 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 18iRvf-00024F-00; Mon, 10 Feb 2003 22:21:55 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 10 Feb 2003 22:22:52 -0600 (CST) Original-Received: from sclp3.sclp.com (sclp3.sclp.com [66.230.238.2]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id WAA00798 for ; Mon, 10 Feb 2003 22:22:39 -0600 (CST) Original-Received: (qmail 84515 invoked by alias); 11 Feb 2003 04:21:37 -0000 Original-Received: (qmail 84510 invoked from network); 11 Feb 2003 04:21:37 -0000 Original-Received: from challah.msrl.com (198.137.194.222) by 66.230.238.6 with SMTP; 11 Feb 2003 04:21:37 -0000 Original-Received: (qmail 10011 invoked from network); 11 Feb 2003 04:21:30 -0000 Original-Received: from localhost (HELO mulligatwani.msrl.com) (127.0.0.1) by localhost with SMTP; 11 Feb 2003 04:21:30 -0000 Original-To: ding@gnus.org Original-Lines: 178 User-Agent: Gnus/5.090016 (Oort Gnus v0.16) XEmacs/21.4 (Military Intelligence) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:50001 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:50001 I now have copyright papers on file. This is against the current CVS version. lisp/ChangeLog 2003-02-11 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. texi/ChangeLog 2003-02-11 Michael Shields * gnus.texi (Paging the Article): Document gnus-article-boring-faces. (Choosing Commands): Explain that SPACE in the summary buffer is used for both selecting and scrolling. * gnus.texi (Article Keymap): Say that SPACE and DEL in the summary buffer are the same as switching to the article buffer and using SPACE and DEL; since now that is the case. Index: lisp/gnus-art.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 6.292 diff -u -r6.292 gnus-art.el --- lisp/gnus-art.el 8 Feb 2003 04:51:37 -0000 6.292 +++ lisp/gnus-art.el 11 Feb 2003 04:22:47 -0000 @@ -200,6 +200,15 @@ (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 @@ -4734,6 +4751,27 @@ (beginning-of-buffer (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." Index: lisp/gnus-cite.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-cite.el,v retrieving revision 6.20 diff -u -r6.20 gnus-cite.el --- lisp/gnus-cite.el 30 Jan 2003 02:10:40 -0000 6.20 +++ lisp/gnus-cite.el 11 Feb 2003 04:28:36 -0000 @@ -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 +273,17 @@ :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) Index: lisp/gnus-sum.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 6.306 diff -u -r6.306 gnus-sum.el --- lisp/gnus-sum.el 11 Feb 2003 01:19:37 -0000 6.306 +++ lisp/gnus-sum.el 11 Feb 2003 04:23:05 -0000 @@ -7098,7 +7098,8 @@ (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")) Index: texi/gnus.texi =================================================================== RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v retrieving revision 6.421 diff -u -r6.421 gnus.texi --- texi/gnus.texi 11 Feb 2003 01:36:49 -0000 6.421 +++ texi/gnus.texi 11 Feb 2003 04:23:51 -0000 @@ -4909,6 +4909,10 @@ Select the current article, or, if that one's read already, the next unread article (@code{gnus-summary-next-page}). +If you have an article window open already and you press @kbd{SPACE} +again, the article will be scrolled. This lets you conveniently +@kbd{SPACE} through an entire newsgroup. @pxref{Paging the Article}. + @item G n @itemx n @kindex n (Summary) @@ -5048,6 +5052,14 @@ or, if you have come to the end of the current article, will choose the next article (@code{gnus-summary-next-page}). +@vindex gnus-article-boring-faces +If the rest of the article consists only of citations and signature, +then it will be skipped; the next article will be shown instead. You +can customize what is considered uninteresting with +@code{gnus-article-boring-faces}, or set it to @code{nil} to disable +this feature. You can manually view the article's pages, no matter how +boring, using @kbd{C-v} in the article buffer. + @item DEL @kindex DEL (Summary) @findex gnus-summary-prev-page @@ -10850,11 +10862,13 @@ @kindex SPACE (Article) @findex gnus-article-next-page Scroll forwards one page (@code{gnus-article-next-page}). +This is exactly the same as @kbd{h SPACE h}. @item DEL @kindex DEL (Article) @findex gnus-article-prev-page Scroll backwards one page (@code{gnus-article-prev-page}). +This is exactly the same as @kbd{h DEL h}. @item C-c ^ @kindex C-c ^ (Article) -- Shields.