* [PATCH] Skip over citations and signature (resend)
@ 2003-02-11 4:21 Michael Shields
2003-02-12 14:58 ` Kai Großjohann
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Michael Shields @ 2003-02-11 4:21 UTC (permalink / 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.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-11 4:21 [PATCH] Skip over citations and signature (resend) Michael Shields
@ 2003-02-12 14:58 ` Kai Großjohann
2003-02-12 17:55 ` Michael Shields
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Kai Großjohann @ 2003-02-12 14:58 UTC (permalink / raw)
Committed. Finally. Sorry it took so long.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-11 4:21 [PATCH] Skip over citations and signature (resend) Michael Shields
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-02-12 20:26 ` Kai Großjohann
2003-02-12 22:08 ` Frank Haun
3 siblings, 2 replies; 13+ messages in thread
From: Michael Shields @ 2003-02-12 17:55 UTC (permalink / raw)
This patch goes with it also. I forget if it's required for my
skip-boring patch, but it seems like a good idea anyway.
2003-02-12 Michael Shields <shields@msrl.com>
* gnus-sum.el (gnus-article-goto-next-page,
gnus-article-goto-prev-page): Call gnus-summary-*-page, instead of
relying on the summary bindings of `n' and `p'.
Index: lisp/gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 6.293
diff -u -r6.293 gnus-art.el
--- lisp/gnus-art.el 12 Feb 2003 15:06:16 -0000 6.293
+++ lisp/gnus-art.el 12 Feb 2003 18:03:15 -0000
@@ -4686,15 +4695,14 @@
(defun gnus-article-goto-next-page ()
"Show the next page of the article."
(interactive)
- (when (gnus-article-next-page)
- (goto-char (point-min))
- (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))))
+ (gnus-eval-in-buffer-window gnus-summary-buffer
+ (gnus-summary-next-page)))
(defun gnus-article-goto-prev-page ()
"Show the next page of the article."
(interactive)
- (if (bobp) (gnus-article-read-summary-keys nil (gnus-character-to-event ?p))
- (gnus-article-prev-page nil)))
+ (gnus-eval-in-buffer-window gnus-summary-buffer
+ (gnus-summary-prev-page)))
(defun gnus-article-next-page (&optional lines)
"Show the next page of the current article.
--
Shields.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-12 17:55 ` Michael Shields
@ 2003-02-12 20:21 ` Kai Großjohann
2003-04-09 21:42 ` Jesper Harder
1 sibling, 0 replies; 13+ messages in thread
From: Kai Großjohann @ 2003-02-12 20:21 UTC (permalink / raw)
Committed.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
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
1 sibling, 1 reply; 13+ messages in thread
From: Jesper Harder @ 2003-04-09 21:42 UTC (permalink / raw)
Michael Shields <shields@msrl.com> writes:
> This patch goes with it also. I forget if it's required for my
> skip-boring patch, but it seems like a good idea anyway.
>
> 2003-02-12 Michael Shields <shields@msrl.com>
>
> * gnus-sum.el (gnus-article-goto-next-page,
> gnus-article-goto-prev-page): Call gnus-summary-*-page, instead of
> relying on the summary bindings of `n' and `p'.
Michael, could you check if it's really required -- this change breaks
gnus-pick-mode.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-04-09 21:42 ` Jesper Harder
@ 2003-04-09 23:23 ` Michael Shields
2003-04-10 0:06 ` Jesper Harder
0 siblings, 1 reply; 13+ messages in thread
From: Michael Shields @ 2003-04-09 23:23 UTC (permalink / raw)
In article <m3fzor5ovz.fsf@defun.localdomain>,
Jesper Harder <harder@myrealbox.com> wrote:
>> 2003-02-12 Michael Shields <shields@msrl.com>
>>
>> * gnus-sum.el (gnus-article-goto-next-page,
>> gnus-article-goto-prev-page): Call gnus-summary-*-page, instead of
>> relying on the summary bindings of `n' and `p'.
>
> Michael, could you check if it's really required -- this change breaks
> gnus-pick-mode.
In what way does it break? It looks to me that gnus-pick-mode does not
change the bindings of `n' or `p'; they are not in gnus-pick-mode-map.
--
Shields.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-04-09 23:23 ` Michael Shields
@ 2003-04-10 0:06 ` Jesper Harder
0 siblings, 0 replies; 13+ messages in thread
From: Jesper Harder @ 2003-04-10 0:06 UTC (permalink / raw)
Michael Shields <shields@msrl.com> writes:
> Jesper Harder <harder@myrealbox.com> wrote:
>>> 2003-02-12 Michael Shields <shields@msrl.com>
>>>
>>> * gnus-sum.el (gnus-article-goto-next-page,
>>> gnus-article-goto-prev-page): Call gnus-summary-*-page, instead of
>>> relying on the summary bindings of `n' and `p'.
>>
>> Michael, could you check if it's really required -- this change breaks
>> gnus-pick-mode.
>
> In what way does it break? It looks to me that gnus-pick-mode does not
> change the bindings of `n' or `p'; they are not in gnus-pick-mode-map.
It displays the summary buffer. The point of pick-mode is that you only
want to see the article buffer after selecting the articles to read.
There's also some code in `gnus-article-read-summary-keys' that appears
to deal with pick-mode specially -- stuff like
(let (gnus-pick-mode)
I'm not sure exactly what the purpose is :-)
I also get an error after reading the last selected article and exiting
the group
gnus-article-goto-next-page: Wrong type argument: window-live-p,#<window 3>
Both problems disappear after reverting the patch.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-11 4:21 [PATCH] Skip over citations and signature (resend) Michael Shields
2003-02-12 14:58 ` Kai Großjohann
2003-02-12 17:55 ` Michael Shields
@ 2003-02-12 20:26 ` Kai Großjohann
2003-02-12 23:30 ` Michael Shields
2003-02-12 22:08 ` Frank Haun
3 siblings, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2003-02-12 20:26 UTC (permalink / raw)
Michael Shields <shields@msrl.com> writes:
> 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.
Could you write a NEWS (GNUS-NEWS) entry for this? I think that's
useful -- it's a user-level change.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-12 20:26 ` Kai Großjohann
@ 2003-02-12 23:30 ` Michael Shields
2003-02-13 11:29 ` Kai Großjohann
0 siblings, 1 reply; 13+ messages in thread
From: Michael Shields @ 2003-02-12 23:30 UTC (permalink / raw)
Cc: ding
In article <84vfzpgs96.fsf@lucy.is.informatik.uni-duisburg.de>,
kai.grossjohann@uni-duisburg.de (Kai Großjohann) wrote:
> Could you write a NEWS (GNUS-NEWS) entry for this? I think that's
> useful -- it's a user-level change.
** gnus-article-skip-boring
If you set `gnus-article-skip-boring' to t, then Gnus will not scroll
down to show you a page that contains only boring text, which by
default means cited text and signature. You can customize what is
skippable using `gnus-article-boring-faces'.
This feature is especially useful if you read many articles that
consist of a little new content at the top with a long, untrimmed
message cited below.
--
Shields.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-11 4:21 [PATCH] Skip over citations and signature (resend) Michael Shields
` (2 preceding siblings ...)
2003-02-12 20:26 ` Kai Großjohann
@ 2003-02-12 22:08 ` Frank Haun
2003-02-13 0:34 ` Katsumi Yamaoka
3 siblings, 1 reply; 13+ messages in thread
From: Frank Haun @ 2003-02-12 22:08 UTC (permalink / raw)
Michael Shields <shields@msrl.com> writes:
> + (mapcar-extents
It seems this is XEmacs only.
If I set gnus-article-skip-boring to t, I get
"byte-code: Symbol's function definition is void: mapcar-extents"
Frank
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] Skip over citations and signature (resend)
2003-02-12 22:08 ` Frank Haun
@ 2003-02-13 0:34 ` Katsumi Yamaoka
2003-02-13 1:07 ` Frank Haun
0 siblings, 1 reply; 13+ messages in thread
From: Katsumi Yamaoka @ 2003-02-13 0:34 UTC (permalink / raw)
Cc: ding
Hi,
>>>>> In <u65rpb1a7.fsf@pille.fhaun.de>
>>>>> Frank Haun <pille3003@fhaun.de> wrote:
> Michael Shields <shields@msrl.com> writes:
>> + (mapcar-extents
> It seems this is XEmacs only.
Yes. And overlays-at doesn't work in XEmacs.
> If I set gnus-article-skip-boring to t, I get
> "byte-code: Symbol's function definition is void: mapcar-extents"
> Frank
I've made the new macro `gnus-faces-at' in gnus-util.el and
fixed the problem using it.
--
Katsumi Yamaoka <yamaoka@jpl.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2003-04-10 0:06 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 4:21 [PATCH] Skip over citations and signature (resend) Michael Shields
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
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).