From af22e7044d07639f4cd303dc4ee7e126559677ef Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 25 Aug 2000 13:12:06 +0000 Subject: [PATCH] * lisp/gnus-vers.el (gnus-revision-number): Increment to 04. * lisp/nntp.el (nntp-list-options, nntp-options-subscribe, nntp-options-not-subscribe): New server variables. (nntp-request-list): Use them. * text/gnus.texi, texi/gnus-ja.texi: Update for them. --- ChangeLog | 12 ++++++++++ lisp/gnus-vers.el | 2 +- lisp/nntp.el | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++- texi/gnus-ja.texi | 43 +++++++++++++++++++++++++++++++++ texi/gnus.texi | 43 +++++++++++++++++++++++++++++++++ 5 files changed, 166 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9798fd9..4341a06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-08-25 Katsumi Yamaoka + + * lisp/gnus-vers.el (gnus-revision-number): Increment to 04. + +2000-08-25 Yagi Tatsuya + Katsumi Yamaoka + + * lisp/nntp.el (nntp-list-options, nntp-options-subscribe, + nntp-options-not-subscribe): New server variables. + (nntp-request-list): Use them. + * text/gnus.texi, texi/gnus-ja.texi: Update for them. + 2000-08-23 Katsumi Yamaoka * lisp/gnus.el (gnus-group-startup-message): Use `image-size' to diff --git a/lisp/gnus-vers.el b/lisp/gnus-vers.el index cfaabbb..7613c12 100644 --- a/lisp/gnus-vers.el +++ b/lisp/gnus-vers.el @@ -31,7 +31,7 @@ (require 'product) (provide 'gnus-vers) -(defconst gnus-revision-number "03" +(defconst gnus-revision-number "04" "Revision number for this version of gnus.") ;; Product information of this gnus. diff --git a/lisp/nntp.el b/lisp/nntp.el index 846b61f..046c785 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -42,6 +42,40 @@ (defvoo nntp-port-number "nntp" "Port number on the physical nntp server.") +(defvoo nntp-list-options nil + "List of newsgroup name used for a option of the LIST command to +restrict the listing output to only the specified newsgroups. +Each newsgroup name can be a shell-style wildcard, for instance, +\"fj.*\", \"japan.*\", etc. Fortunately, if the server can accept +such a option, it will probably make gnus run faster. You may +use it as a server variable as follows: + +\(setq gnus-select-method + '(nntp \"news.somewhere.edu\" + (nntp-list-options (\"fj.*\" \"japan.*\"))))") + +(defvoo nntp-options-subscribe nil + "Regexp matching the newsgroup names which will be subscribed +unconditionally. It may be effective as well as `nntp-list-options' +even though the server could not accept a shell-style wildcard as a +option of the LIST command. You may use it as a server variable as +follows: + +\(setq gnus-select-method + '(nntp \"news.somewhere.edu\" + (nntp-options-subscribe \"^fj\\\\.\\\\|^japan\\\\.\")))") + +(defvoo nntp-options-not-subscribe nil + "Regexp matching the newsgroup names which will not be subscribed +unconditionally. It may be effective as well as `nntp-list-options' +even though the server could not accept a shell-style wildcard as a +option of the LIST command. You may use it as a server variable as +follows: + +\(setq gnus-select-method + '(nntp \"news.somewhere.edu\" + (nntp-options-not-subscribe \"\\\\.binaries\\\\.\")))") + (defvoo nntp-server-opened-hook '(nntp-send-mode-reader) "*Hook used for sending commands to the server at startup. The default value is `nntp-send-mode-reader', which makes an innd @@ -742,8 +776,40 @@ noticing asynchronous data.") (nntp-kill-buffer (process-buffer process))))) (deffoo nntp-request-list (&optional server) + "List active groups. If `nntp-list-options' is non-nil, the listing +output from the server will be restricted to the specified newsgroups. +If `nntp-options-subscribe' is non-nil, remove newsgroups that do not +match the regexp. If `nntp-options-not-subscribe' is non-nil, remove +newsgroups that match the regexp." (nntp-possibly-change-group nil server) - (nntp-send-command-and-decode "\r?\n\\.\r?\n" "LIST")) + (with-current-buffer nntp-server-buffer + (prog1 + (if (not nntp-list-options) + (nntp-send-command-and-decode "\r?\n\\.\r?\n" "LIST") + (let ((options (if (consp nntp-list-options) + nntp-list-options + (list nntp-list-options))) + (ret t)) + (erase-buffer) + (while options + (goto-char (point-max)) + (narrow-to-region (point) (point)) + (setq ret (and ret + (nntp-send-command-nodelete + "\r?\n\\.\r?\n" + (format "LIST ACTIVE %s" (car options)))) + options (cdr options)) + (nntp-decode-text)) + (widen) + ret)) + (when (and (stringp nntp-options-subscribe) + (not (string-equal "" nntp-options-subscribe))) + (goto-char (point-min)) + (keep-lines nntp-options-subscribe)) + (when (and (stringp nntp-options-not-subscribe) + (not (string-equal "" nntp-options-not-subscribe))) + (goto-char (point-min)) + (flush-lines nntp-options-subscribe))))) (deffoo nntp-request-list-newsgroups (&optional server) (nntp-possibly-change-group nil server) diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 7807df4..663c4fd 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -10188,6 +10188,49 @@ W3 $B$NG[I[$+$i(B) $B$,I,MW$K$J$j$^$9(B)$B!#$=$l$+$i%5!<%P!<$r$N%j%9%H$G$9!#$=$l$>$l(B +$B$N%K%e!<%9%0%k!<%WL>$K$O(B @dfn{fj.*} $B$d(B @dfn{japan.*} $B$N$h$&$J!"%7%'%k7A(B +$B<0$N%o%$%k%I%+!<%I$r;H$&$3$H$,$G$-$^$9!#$b$79,1?$K$b%5!<%P!<$,$=$N$h$&$J(B +$B%*%W%7%g%s$rr7o$G9VFI$9$k%K%e!<%9%0%k!<%WL>$N@55,I=8=$G$9!#@55,I=8=$NJ8(B +$B;zNs$G$O(B @dfn{$} $B$NBe$o$j$K(B @dfn{ } $B$r;H$C$F2<$5$$!#%5!<%P!<$,(B LIST $B%3%^(B +$B%s%I$N%*%W%7%g%s$K%7%'%k7A<0$N%o%$%k%I%+!<%I$rl9g$G$b!"(B +@code{nntp-list-options} $B$HF1MM$N8z2L$,$"$k$G$7$g$&!#$3$l$O!"0J2<$N$h$&(B +$B$K%5!<%P!r7o$G9VFI$9$k%K%e!<%9%0%k!<%WL>$N@55,I=8=$G$9!#@55,I=(B +$B8=$NJ8;zNs$G$O(B @dfn{$} $B$NBe$o$j$K(B @dfn{ } $B$r;H$C$F2<$5$$!#%5!<%P!<(B +$B$,(B LIST $B%3%^%s%I$N%*%W%7%g%s$K%7%'%k7A<0$N%o%$%k%I%+!<%I$rl9g$G$b!"(B@code{nntp-list-options} $B$HF1MM$N8z2L$,$"$k$G$7$g$&!#$3$l(B +$B$O!"0J2<$N$h$&$K%5!<%P!c$,$A$G$"$k$H$-$K$3$l$r(B @code{nil} $B$G$J$$CM(B diff --git a/texi/gnus.texi b/texi/gnus.texi index 6b7915a..631c376 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -10590,6 +10590,49 @@ The address of the remote system running the @sc{nntp} server. Port number to connect to when using the @code{nntp-open-network-stream} connect function. +@item nntp-list-options +@vindex nntp-list-options +List of newsgroup name used for a option of the LIST command to restrict +the listing output to only the specified newsgroups. Each newsgroup name +can be a shell-style wildcard, for instance, @dfn{fj.*}, @dfn{japan.*}, +etc. Fortunately, if the server can accept such a option, it will +probably make gnus run faster. You may use it as a server variable as +follows: + +@lisp +(setq gnus-select-method + '(nntp "news.somewhere.edu" + (nntp-list-options ("fj.*" "japan.*")))) +@end lisp + +@item nntp-options-subscribe +@vindex nntp-options-subscribe +Regexp matching the newsgroup names which will be subscribed +unconditionally. Use @dfn{ } instead of @dfn{$} for a regexp string. +It may be effective as well as @code{nntp-list-options} even though the +server could not accept a shell-style wildcard as a option of the LIST +command. You may use it as a server variable as follows: + +@lisp +(setq gnus-select-method + '(nntp "news.somewhere.edu" + (nntp-options-subscribe "^fj\\.\\|^japan\\."))) +@end lisp + +@item nntp-options-not-subscribe +@vindex nntp-options-not-subscribe +Regexp matching the newsgroup names which will not be subscribed +unconditionally. Use @dfn{ } instead of @dfn{$} for a regexp string. +It may be effective as well as @code{nntp-list-options} even though the +server could not accept a shell-style wildcard as a option of the LIST +command. You may use it as a server variable as follows: + +@lisp +(setq gnus-select-method + '(nntp "news.somewhere.edu" + (nntp-options-not-subscribe "\\.binaries\\."))) +@end lisp + @item nntp-buggy-select @vindex nntp-buggy-select Set this to non-@code{nil} if your select routine is buggy. -- 1.7.10.4