From: Michael Shields <shields@msrl.com>
Subject: [PATCH] Skip over citations and signature (resend)
Date: Tue, 11 Feb 2003 04:21:29 +0000 [thread overview]
Message-ID: <87smuvh2gm.fsf@mulligatwani.msrl.com> (raw)
I now have copyright papers on file. This is against the current
CVS version.
lisp/ChangeLog
2003-02-11 Michael Shields <shields@msrl.com>
* 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 <shields@msrl.com>
* 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.
next reply other threads:[~2003-02-11 4:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-11 4:21 Michael Shields [this message]
2003-02-12 14:58 ` Kai Großjohann
2003-02-12 17:55 ` Michael Shields
2003-02-12 20:21 ` Kai Großjohann
2003-04-09 21:42 ` Jesper Harder
2003-04-09 23:23 ` Michael Shields
2003-04-10 0:06 ` Jesper Harder
2003-02-12 20:26 ` Kai Großjohann
2003-02-12 23:30 ` Michael Shields
2003-02-13 11:29 ` Kai Großjohann
2003-02-12 22:08 ` Frank Haun
2003-02-13 0:34 ` Katsumi Yamaoka
2003-02-13 1:07 ` Frank Haun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87smuvh2gm.fsf@mulligatwani.msrl.com \
--to=shields@msrl.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).