[comp.emacs] GNUS 3.12

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

At the request of the author, whose posting attempts last week didn't
make it across the Japan-US news link, I'm about to post GNUS 3.12 to
gnu.emacs.gnus and comp.emacs.  It consists of an introductory note
and ten shell archives.

This software will also be available via anonymous FTP from
tut.cis.ohio-state.edu, and via anonymous UUCP from osu-cis.  Write
for UUCP instructions if you need them for your first time, or get
osu-cis!~/GNU.how-to-get for updated details.

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

This is a new version of GNUS, an NNTP-based newsreader for GNU Emacs.

This release includes many bug fixes and improvements.  The second
edition of the Texinfo manual of GNUS is also included.  Please read
the installation guide INSTALL.GNUS carefully before getting started
with GNUS.  If you upgrade from version 3.11, please read
Changes.GNUS, too.  Incompatible changes are documented in it.

New features of GNUS version 3.12:

* GNUS windows are configurable.

* kill/yank commands for newsgroups are available in Group Mode.

* FCC: field can be used to save author copies.

* New followup command (F) and reply command (R) are added in Subject Mode.

* New catch up commands which preserve marks are added.

* The function gnus-kill skips any marked articles by default.

* Article save name generator can be specified for each saver.

* Non-full window mode is available.

* User level extension and customization become easier.

* gnus.el is split into three files: gnus.el, gnuspost.el, and gnusmisc.el

* mhspool.el can co-exist with nntp.el/nnspool.el

For more information, consult Changes.GNUS.

Please send questions, bug fixes, and extensions to:

	info-gnus-english@tut.cis.ohio-state.edu, or
	USENET newsgroup `gnu.emacs.gnus'

Masanobu UMEDA
umerin@flab.Fujitsu.JUNET
umerin%flab.Fujitsu.JUNET@uunet.uu.NET

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# shar:	Shell Archiver  (v1.22)
#
# This is part 1 of a multipart archive                                    
# do not concatenate these parts, unpack them in order with /bin/sh        
#
#	Run the following text with /bin/sh to create:
#	  Makefile
#	  INSTALL.GNUS
#	  Changes.GNUS
#	  gnus-user-sxa.el
#	  gnus-user-tale.el
#	  gnus.el
#	  gnusmisc.el
#	  gnuspost.el
#	  mhspool.el
#	  nnspool.el
#	  nntp.el
#	  tcp.el
#	  tcp.c
#	  gnus.texinfo
#
if test -r s2_seq_.tmp
then echo "Must unpack archives in sequence!"
     next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
     exit 1; fi
sed 's/^X//' << 'SHAR_EOF' > Makefile &&
X# Makefile for GNUS newsreader
X# Written by Masanobu UMEDA for version 3.12
X
XELISP= gnus.elc gnuspost.elc gnusmisc.elc nntp.elc nnspool.elc mhspool.elc tcp.elc
X
XTCP= tcp
X
X# Specify the byte-compiler
XELC= emacs -batch -f batch-byte-compile
X
X# Specify the byte-compiler for SX/A Emacs (or Version 17.64).
X#ELC= emacs -batch -l gnus-user-sxa.el -f batch-byte-compile
X
XCFLAGS = -O
X
X.SUFFIXES: .elc .el
X
X.el.elc:
X	$(ELC) $<
X
Xall: $(ELISP)
X
Xgnus.elc: nntp.elc
Xgnuspost.elc: nntp.elc
Xgnusmisc.elc: nntp.elc
X
X# Make the tcp module by yourself according to the operating system
X# and machine.  If your emacs has the function open-network-stream, it
X# is unnecessary.
X
X# For BSD system (do you really need it?)
Xbsdtcp:
X	$(CC) -o $(TCP) $(CFLAGS) tcp.c
X
X# For USG system
Xusgtcp:
X	$(CC) -o $(TCP) $(CFLAGS) tcp.c -DUSG
X
X# For Fujitsu UTS system
Xutstcp:
X	$(CC) -o $(TCP) $(CFLAGS) tcp.c -DFUJITSU_UTS -lu -lsocket
SHAR_EOF
chmod 0644 Makefile || echo "restore of Makefile fails"
set `wc -c Makefile`;Sum=$1
if test "$Sum" != "901"
then echo original size 901, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > INSTALL.GNUS &&
XThis is a copy of one chapter from the Info file gnus-1.  For full
Xinformation on installing GNUS, refer to the GNUS manual.
X
X
XInstalling GNUS
X***************
X
X  Installation of GNUS and some initialization of your computing
Xenvironment are described in this chapter.  Please read the following
Xsections carefully before getting started with GNUS.
X
X* Menu:
X
X* Files of GNUS::       How many files of GNUS are there?
X* Compilation::         How to byte-compile lisp sources.
X* Autoloading::         How to define autoload entries.
X* Environment::         How to define your environment.
X* Texinfo Manual::      How to install an Info file and print the manual.
X
X
XFiles of GNUS
X=============
X
X  Unpacking the shar files will produce the following files.  They are
Xthe Emacs lisp sources, a C source, a Texinfo manual of GNUS, and a
XMakefile.
X
X`gnus.el'
X     Main part of GNUS newsreader.
X
X`gnuspost.el'
X     Post news commands.
X
X`gnusmisc.el'
X     Miscellaneous commands.
X
X`nntp.el'
X     NNTP package.
X
X`nnspool.el'
X     A package accessing local news spool like NNTP.
X
X`mhspool.el'
X     A package accessing private directory like NNTP.
X
X`tcp.el'
X     Patches to some versions of GNU Emacs which do not have the
X     function `open-network-stream'.
X
X`tcp.c'
X     C program for external TCP/IP implementation.  This is used with
X     `tcp.el'.
X
X`gnus.texinfo'
X     Texinfo manual of GNUS.
X
X`Makefile'
X     Makefile to byte-compile the lisp files using the `make' command.
X
X
XByte-Compilation
X================
X
X  Move the lisp files, the C file, and `Makefile' to the appropriate
Xdirectory in the search path defined by the variable `load-path'.
XBefore actually byte-compiling the lisp files, make sure there are no
Xbyte-compiled files of older versions of GNUS in that directory.  Remove
Xor rename such files as the byte-compiler may be confused by old macro
Xdefinitions.  If you can use the `make' command, you don't have to take
Xcare of the dependencies.
X
X  The C file `tcp.c' should be compiled with a C compiler and installed
Xin a directory in the search path defined by the variable `exec-path',
Xif this is required.
X
X  If you can use the `make' command, just type `make' in a Unix shell.
XAll the lisp files will be byte-compiled.  Otherwise, byte-compile lisp
Xfiles in the following order according to your computing environment by
Xyourself:
X
X  1. Byte-compile `nntp.el', `gnus.el', `gnuspost.el', and `gnusmisc.el'
X     in this order.
X
X  2. Byte-compile `nnspool.el' if you want to use the local news spool
X     of your machine instead of NNTP (*Note Local News Spool::).
X
X  3. Byte-compile `mhspool.el' if you want to read articles or mail in
X     your private directory using GNUS (*Note Private Directory::).
X
X  4. Compile and install `tcp.el' and `tcp.c' if TCP/IP is not supported
X     by Emacs but is supported by your operating system.
X
X  `tcp.el' defines the function `open-network-stream', and `tcp.c' is an
Xemulation program for the stream used by the function.  If you modified
X`tcp.c' for your system, please send the author the diffs.  Some of them
Xwill be included in the future releases of GNUS.
X
X
XAutoloading
X===========
X
X  It is useful to define autoload entries in `.emacs', `site-init.el' or
X`default.el' as follows:
X
X     (autoload 'gnus "gnus" "Read network news." t)
X     (autoload 'gnus-post-news "gnuspost" "Post a new news." t)
X
X
XEnvironment
X===========
X
X  The NNTP server and its service name, your domain and organization,
Xand other important definitions of your computing environment are
Xdescribed in this section.  Since these definitions depend heavily on
Xyour environment, you'd better be familiar with the operating system you
Xare using. Knowledge of the USENET software is also important.
X
X* Menu:
X
X* Server:  NNTP Server.         How to define NNTP server.
X* Service: NNTP Service.        How to define NNTP service.
X* Domain::                      How to define your domain and organization.
X* GENERICFROM::                 How to use GENERICFROM feature.
X* GENERICPATH::                 How to use GENERICPATH feature.
X* Startup File::                About the startup files of GNUS.
X
X
XNNTP Server
X-----------
X
X  The variable `gnus-nntp-server' specifies the default NNTP server.  To
Xdefine the server `flab', put the following code in `.emacs',
X`site-init.el' or `default.el':
X
X     (setq gnus-nntp-server "flab")
X
X  The variable `gnus-nntp-server' is initialized from the `NNTPSERVER'
Xenvironment variable.  To define the server using the `NNTPSERVER'
Xenvironment variable, put the following code in `.login':
X
X     setenv NNTPSERVER "flab"
X
X  If an NNTP server is preceded by a colon such as `:Mail', the user's
Xprivate directory `~/Mail' is used as the news spool.  This makes it
Xpossible to read mail stored in MH folders or articles saved by GNUS.
X*Note Private Directory::, for more information.
X
X  GNUS will ask you for the NNTP server at start up time unless it is
Xdefined.  Even if the default server is defined, it is possible to
Xchoose another server by invoking GNUS with a prefix argument like `C-u
XM-x gnus' (*Note Getting Started::).
X
X
XNNTP Service
X------------
X
X  The default service name of NNTP is `"nntp"'.  You may, however, have
Xto define the service name as the number `119' as follows:
X
X     (setq gnus-nntp-service 119)
X
X  If you'd like to use a local news spool of your machine directly
Xinstead of NNTP, set the variable to `nil' as follows:
X
X     (setq gnus-nntp-service nil)
X
XIn this case, the NNTP server must be a local host name returned by the
Xfunction `system-name' (*Note Local News Spool::).
X
X
XDomain and Organization
X-----------------------
X
X  "Domain" and "organization" must be defined before you post your first
Xarticle, because they are included in all articles you post and will be
Xused for identifying who you are.
X
X  "Domain" is the domain part of your mail address excluding the local
Xhost name.  For example, if your mail address is
X`umerin@photon.stars.flab.Fujitsu.CO.JP' and the local host name is
X`photon', your domain is `stars.flab.Fujitsu.CO.JP'.  If the function
X`system-name' of your Emacs returns the full Internet name, you do not
Xhave to define the domain.
X
X  "Organization" is the organization you belong to.  It must be defined
Xunless it is defined in the file `/usr/lib/news/organization'.
X
X  To define the domain `stars.flab.Fujitsu.CO.JP' and the organization
X`Fujitsu Laboratories Ltd., Kawasaki, Japan.' using lisp variables, put
Xthe following code in `.emacs', `site-init.el' or `default.el'.  If you
Xare a system administrator and are installing GNUS for other users,
X`site-init.el' is the best place to define this because the domain and
Xorganization are common to all users of the system.
X
X     (setq gnus-your-domain "stars.flab.Fujitsu.CO.JP")
X     (setq gnus-your-organization
X           "Fujitsu Laboratories Ltd., Kawasaki, Japan.")
X
X  The `DOMAINNAME' and `ORGANIZATION' environment variables are used
Xinstead, if defined.  To define these variables, put the following code
Xin `.login'.
X
X     setenv DOMAINNAME   "stars.flab.Fujitsu.CO.JP"
X     setenv ORGANIZATION "Fujitsu Laboratories Ltd., Kawasaki, Japan."
X
X  If the value of the `ORGANIZATION' environment variable or the
Xvariable `gnus-your-organization' begins with a slash, it is taken as
Xthe name of a file whose contents are read for the value.  If neither of
Xthese is defined, and a file `~/.organization-DISTRIBUTION' or
X`~/.organization' exists, the contents of that file are used.  If
Xneither of them does not exist, and the file
X`/usr/lib/news/organization' exists, its contents are used.
X
X
XGENERICFROM
X-----------
X
X  If the variable `gnus-use-generic-from' is non-`nil', the local host
Xname of your machine will not appear in the `From:' field of article
Xheaders you post.  This is called the "GENERICFROM" feature in the Bnews
Xsystem.  This may be useful if there are many workstations connected to
Xeach other in a local area network, and aliases service or automatic
Xforwarding of mail is supported between the workstations.
X
X  To use the GENERICFROM, put the following code in `.emacs',
X`site-init.el' or `default.el'.  If you are a system administrator and
Xare installing GNUS for other users, `site-init.el' is the best place to
Xdefine it because the definition is common to all users of the system
Xhaving the same domain and organization (*Note Domain and Organization:
XDomain.).
X
X     (setq gnus-use-generic-from t)
X
X  As a special case of the GENERICFROM feature, if the variable
X`gnus-use-generic-from' is a string, it is used as your domain instead
Xof the definition of the environment variable `DOMAINNAME' or the
Xvariable `gnus-your-domain' (*Note Domain and Organization: Domain.).
X
X
XGENERICPATH
X-----------
X
X  If the variable `gnus-use-generic-path' is `nil', the NNTP server name
Xfollowed by the user login name is used in the `Path:' field of article
Xheaders you post.  If it is a string, the string followed by the user
Xlogin name is used instead.  Otherwise, if it is non-`nil', only the
Xuser login name is used.  This is called the "GENERICPATH" feature in
Xthe Bnews system.
X
X  For example, to define the generic path `flab', put the following
Xcodes in `.emacs', `site-init.el' or `default.el'.  If you are a system
Xadministrator and are installing GNUS for other users, `site-init.el' is
Xthe best place to define it because the definition is common to all
Xusers of the system having the same domain and organization (*Note
XDomain and Organization: Domain.).
X
X     (setq gnus-use-generic-path "flab")
X
XIn this case, the `Path:' field will be generated as `Path: flab!USER'.
X
X
XStartup File
X------------
X
X  "Startup file" is a file recording information on articles you have
Xalready read.  GNUS uses `.newsrc' for the startup file as in the Bnews
Xsystem.  If you think you will talk to exactly one NNTP server, you can
Xuse it without any problems.  Otherwise, if you want to talk to several
XNNTP servers, you'd better use server specific startup files since
Xstartup files are not portable between servers.  The server specific
Xstartup file for an NNTP server on a machine SERVER is a file named
X`.newsrc-SERVER'.  For example, `.newsrc-photon' is for an NNTP server
Xon a machine named `photon'.  The primary name of the startup file,
X`.newsrc', is specified by the variable `gnus-startup-file' (*Note
XVariables::).
X
X  GNUS automatically adds newly created newsgroups to a startup file
Xwhen getting started.  To prevent adding the newsgroups under some
Xnewsgroup hierarchies, you can use the options line in the startup file.
XOption `-n' of the options line in the startup file is recognized
Xproperly the same as for the Bnews system.  For example, if the options
Xline is `options -n !talk talk.rumors', newsgroups under the `talk'
Xhierarchy except for `talk.rumors' are ignored while checking new
Xnewsgroups.  These ignored newsgroups can be added manually using the
Xcommand `U' (`gnus-Group-unsubscribe-group') in the Newsgroup buffer.
XUse the command `C-k' (`gnus-Group-kill-group') to kill newsgroups from
Xthe startup file per a newsgroup basis.  *Note Maintenance::, for more
Xinformation.
X
X  Once a startup file is updated by GNUS, the "quick startup file" of
Xwhich the file name is generated by appending `.el' to that of the raw
Xstartup file is also created.  The quick startup file can be read by
XEmacs faster than the raw startup file since all information in the file
Xis in lisp form.  If there is a quick startup file and it is newer than
Xthe raw startup file, the quick startup file is loaded instead of the
Xraw startup file.  If the raw startup file is newer, it is normally read
Xafter loading the quick startup file.  You should not remove the quick
Xstartup file because it contains additional information.  Instead, make
Xthe raw startup file newer than that by touching it or force GNUS to
Xread it by using the command `R' (`gnus-Group-restart') in the Newsgroup
Xbuffer if you want to reflect the changes of the raw startup file to
XGNUS.
X
X
XTexinfo Manual
X==============
X
X  `gnus.texinfo' is a manual of GNUS written in Texinfo format.  This
Xfile can be printed using TeX, and also can be read using Info Mode of
XEmacs.
X
X  *Note Creating an Info File: (texinfo)Creating an Info File, to create
Xan on-line Info file from the Texinfo manual.  If you are not allowed to
Xcreate the Info file in the standard Info directory specified by the
Xvariable `Info-directory', create it in your private directory and set
Xthe variable `gnus-Info-directory' to the directory.
X
X  If this Info file is installed, you can read the documentation of GNUS
Xaccording to the current major mode of GNUS.  The command
X`gnus-Info-find-node' for reading appropriate Info nodes of the Info
Xfile is assigned to `C-c C-i' in all major modes of GNUS.
X
X  *Note Printing Hardcopy: (texinfo)Printing Hardcopy, to print a
Xhardcopy of the manual.
SHAR_EOF
chmod 0444 INSTALL.GNUS || echo "restore of INSTALL.GNUS fails"
set `wc -c INSTALL.GNUS`;Sum=$1
if test "$Sum" != "12819"
then echo original size 12819, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > Changes.GNUS &&
X		    Changes from GNUS Version 3.11
X
X			    Masanobu UMEDA
X		      umerin@flab.Fujitsu.JUNET
X		     Mon Jun 19 13:19:46 JST 1989
X
X* GNUS windows are configurable.
X
XIn addition to conventional two window mode, yet another two window
Xmode and three window mode are available by customizing the variable
Xgnus-window-configuration.
X
X* gnus.el is split into three files: gnus.el, gnuspost.el, and gnusmisc.el
X
XSince gnus.el is smaller, startup will be faster.  In addition, it may
Xbecome easier to understand GNUS software.
X
X* kill/yank commands for newsgroups are available in Group Mode.
X
XIt is possible to kill newsgroups from both Newsgroup buffer and
X.newsrc, and they can be yanked back afterwards.  These commands can
Xbe used for reordering newsgroups in Group Mode.
X
X* mhspool.el can co-exist with nntp.el/nnspool.el
X
XYou don't have to load nntp.el or nnspool.el after using mhspoo.el.
X
X* FCC: field can be used to save author copies.
X
XIf gnus-author-copy (was gnus-author-copy-file) is non-nil, its value
Xis inserted in FCC: field, and it is processed when posting news.
XTherefore, you can change the name of the file or disable copying when
Xcomposing news.
X
X* New followup command (F) and reply command (R) are added in Subject Mode.
X
XThey insert original message automatically just like `F' and `R'
Xcommands of rn.
X
X* New catch up commands which preserve marks are added.
X
X* The function gnus-kill skips any marked articles by default.
X
XThe function gnus-expunge is also introduced (which is , in fact, the
Xfunction gnus-Subject-delete-marked-with).
X
X* Article save name generator can be specified for each saver.
X
XThe variable gnus-rmail-save-name, gnus-mail-save-name,
Xgnus-folder-save-name, and gnus-file-save-name are for specifying
Xdefault save name generator for each saver function.  The variable
Xgnus-article-save-name is obsoleted.
X
X* Non-full window mode is available.
X
XIf gnus-use-full-window is nil, GNUS will not take up the entire
Xscreen of Emacs.
X
X* User level extension and customization become easier.
X
XFor example, you can define a new variable which can be saved in
X.newsrc.el.
X
X* Some user variables and functions are renamed or deleted.
X** Variables
X
Xgnus-author-copy-file		->	gnus-author-copy
Xgnus-keep-subject-centered	->	gnus-auto-center-subject
Xgnus-article-default-saver	->	gnus-default-article-saver
Xgnus-article-save-name		->	gnus-rmail-save-name
X					gnus-mail-save-name
X					gnus-folder-save-name
X					gnus-file-save-name
Xgnus-article-mh-folder		->	(obsolete)
Xgnus-subject-lines-height	->	(obsolete)
X
X** Functions
X
Xgnus-Kill-file-apply		->	gnus-apply-kill-file
Xgnus-Kill-file-name		->	gnus-newsgroup-kill-file
Xgnus-article-save-name		->	gnus-numeric-save-name
X					gnus-Numeric-save-name
X					gnus-plain-save-name
X					gnus-Plain-save-name
X					gnus-folder-save-name
X					gnus-Folder-save-name
X
X* Internal variables and functions are renamed or deleted.
X
XIf you customize GNUS using these, you may have to modify your
Xprogram.
X
X* All compatibility variables and functions are removed.
SHAR_EOF
chmod 0644 Changes.GNUS || echo "restore of Changes.GNUS fails"
set `wc -c Changes.GNUS`;Sum=$1
if test "$Sum" != "3022"
then echo original size 3022, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnus-user-sxa.el &&
X;;; User Contributed Software for GNUS newsreader
X;; Copyright (C) 1989 Masanobu UMEDA
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;; The program in this file is contributed by Sakaeda
X;; <saka@mickey.trad.pf.fujitsu.junet>, and is not part of the
X;; standard distribution of GNUS.  This may be included in the future
X;; releases of GNUS.  Please do not send me any flame on it.
X
X;;Return-Path: <saka@mickey.trad.pfu.fujitsu.junet>
X;;To: umerin@photon.stars.flab.fujitsu.junet (Masanobu UMEDA)
X;;Subject: Re: GNUS 3.11 on SX/A EMACS. 
X;;In-Reply-To: Your message of Mon, 03 Apr 89 12:43:11 +0900.
X;;             <8904030343.AA00729@photon.stars.flab.fujitsu.junet> 
X;;Date: Thu, 06 Apr 89 11:32:41 JST
X;;From: Sakaeda <saka@mickey.trad.pf.fujitsu.junet>
X
X;; This file contains patches for very old version of GNU Emacs such
X;; as SX/A Emacs (17.64!).
X
X(provide 'gnus-user-sxa)
X
X;; To load SX/A specific patches, use the following hooks:
X;;(setq gnus-Group-mode-hook
X;;      '(lambda ()
X;;	 (require 'gnus-user-sxa)))
X;;
X;; To show NNTP server name in mode line, use the following hook:
X;;(setq gnus-Startup-hook
X;;      '(lambda ()
X;;	 (gnus-user-sxa-show-server-name)))
X
X(defun gnus-user-sxa-show-server-name ()
X  "Show NNTP server name in mode line."
X  (setq mode-name (concat mode-name mode-line-process)))
X
X(defun gnus-Subject-set-mode-line ()
X  "Set Subject mode line string."
X  ;; For ooold GNU Emacs such as SX/A Emacs. by Yas.Itoh at PFU '88.11.24
X  (setq mode-line-format 
X	(format "--- GNUS: %17s %%[(%%m)%%]----%%3p-%%-"
X		(if gnus-current-headers
X		    (nntp-header-subject gnus-current-headers)
X		  gnus-newsgroup-name)))
X  (set-buffer-modified-p t))
X
X(defun gnus-Article-set-mode-line ()
X  "Set Article mode line string."
X  (let ((unmarked
X	 (- (length gnus-newsgroup-unreads) (length gnus-newsgroup-marked))))
X    (setq mode-line-format 
X 	  (concat "--- GNUS:"
X 		  (format "%17s"
X			  (format " %s{%d} %s"
X				  gnus-newsgroup-name
X				  gnus-current-article
X				  ;; This is proposed by tale@pawl.rpi.edu.
X				  (if (zerop unmarked)
X				      "      "
X				    (format "%d more" unmarked))
X				  ))
X		  " %[(%m)%]----%3p-%-")))
X  (set-buffer-modified-p t))
X
X
X;; The following definitions are only for compatibility with *OOOOOLD*
X;; Emacs, especially SX/A Emacs (a variant of GNU Emacs).
X;; By Yasunari,Itoh and Sakaeda at PFU limited.
X
X(defvar news-inews-program "inews"
X  "Function to post news.")
X(defvar news-path "/usr/spool/news/"
X  "The root directory below which all news files are stored.")
X
X(fset 'load-library (symbol-function 'load))
X(fset 'process-send-string (symbol-function 'send-string))
X(fset 'process-send-region (symbol-function 'send-region))
X
X;; Save original funcitons.
X(or (fboundp 'load-org)
X    (fset 'load-org (symbol-function 'load)))
X(or (fboundp 'bury-buffer-org)
X    (fset 'bury-buffer-org (symbol-function 'bury-buffer)))
X(or (fboundp 'apply-org)
X    (fset 'apply-org (symbol-function 'apply)))
X
X(load "backquote")
X
X(defun one-window-p (&optional win)
X  (if (or (not win)(eq win t)) (setq win (selected-window)))
X  (eq (selected-window)(next-window win)))
X
X(defun bury-buffer (&optional buffer)
X  (let ((buf (or buffer (current-buffer))))
X    (bury-buffer-org buf)
X    ;; By Sakaeda and Itoh at PFU '89.02.28
X    (or buffer (switch-to-buffer (other-buffer)))
X    nil
X    ))
X
X(defun apply (func &rest args)
X  (let* ((last (car (reverse args)))
X	 (before (reverse (cdr (reverse args))))
X	 (org-arg (append before last)))
X    (apply-org func org-arg)))
X
X(defun file-name-as-directory (filename &optional expand-filename)
X  (let* ((expanded 
X	  (if expand-filename (expand-file-name filename)
X	    filename))
X	 (tail-ix (1- (length expanded))))
X    (if (and (> tail-ix 0)
X	     (= (aref expanded tail-ix) ?/)) expanded
X      (concat expanded "/"))))
X
X(defun load (file &optional missing-ok nomessage dum)
X  "Load FILE."
X  (interactive "sLoad file: ")
X  (load-org file missing-ok nomessage))
X
X(defun insert-char (chr count)
X  "Insert COUNT (second arg) copies of CHAR (first arg).
XBoth arguments are required."
X  (while (> count 0)
X    (insert chr)
X    (setq count (1- count))))
SHAR_EOF
chmod 0644 gnus-user-sxa.el || echo "restore of gnus-user-sxa.el fails"
set `wc -c gnus-user-sxa.el`;Sum=$1
if test "$Sum" != "4917"
then echo original size 4917, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnus-user-tale.el &&
X;;; User Contributed Software for GNUS newsreader
X;; Copyright (C) 1989 Masanobu UMEDA
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;; The program in this file is contributed by tale@pawl.rpi.edu (David
X;; C Lawrence), and is not part of the standard distribution of GNUS.
X;; This may be included in the future releases of GNUS.  Please do not
X;; send me any flame on it.
X
X;;Date: 28 Feb 89 02:41:31 GMT
X;;From: tale@pawl.rpi.edu (David C Lawrence)
X;;Organization: The Octagon Room
X;;Subject: A different article mode-line
X;;To: info-gnus-english@cis.ohio-state.edu
X;;
X;;Well, I've seen at least three other people ask for something like
X;;this and I've also wanted it, so I went in and made some changes.
X;;Basically, this is what the following code does:
X;;
X;; o One new function is added; others merely have their current
X;;definitions modified to accept the new function.
X;;
X;; o The exception to the first point is gnus-Article-set-mode-line.
X;;The way I have defined it is to show a modeline similar to this:
X;;
X;;--- GNUS: comp.theory.cell-automata  2 more  5:32pm 2.27[0]  (GNUS Article)--46%
X;;
X;;Note that comp.theory.cell-automata is one of the longest group names
X;;and everything fits into the modeline happily; only one or two group
X;;would break that.  
X;;
X;; o The display-time-string is there so because I like it for both
X;;telling time and getting my mail notification.
X;; 
X;; o The percentage displayed on the mode line is how many lines of the
X;;total buffer size are not beyond the bottom of the window, like more(1).
X;;
X;; o The "2 more" refers to how many unmarked articles remain in the
X;;group. Spaces are printed if there are no more unmarked articles.
X;;
X;;I did the "2 more" thing rather than paging because knowing that the
X;;range is {1191-2010} and that I am at 2009 is mostly useless to me;
X;;since I follow subjects, which particular article I am on in the group
X;;is meaningless as far as helping me predict when I'll be on my way to
X;;the next group.
X;;
X;;This was only given non-rigourous, but seemingly adequate, testing.
X;;If you find a problem with it, please let me know so I can improve it.
X;;
X;;Dave
X
X(provide 'gnus-user-tale)
X
X(setq gnus-Article-mode-hook
X      '(lambda ()
X         (make-local-variable 'gnus-Article-head-to-window-bottom)
X         (kill-local-variable 'global-mode-string)
X         (setq mode-line-format
X               (list (purecopy "")
X                     'mode-line-modified 'mode-line-buffer-identification
X                     (purecopy "  ")
X                     'global-mode-string
X                     (purecopy "  %[(")
X                     'mode-name 'minor-mode-alist "%n"
X                     (purecopy ")%]--")
X                     'gnus-Article-head-to-window-bottom
X                     (purecopy "-%-")))))
X
X(defun gnus-Article-set-percent (&optional new-article)
X  "Set gnus-Article-head-to-window-bottom as a string which represents the
Xpercentage of total Article lines that are before the bottom of the window.
XAlso forces mode-line update.  Optional NEW-ARTICLE is necessary when a new
Xarticle is selected."
X  (save-excursion
X    (save-restriction
X      (setq gnus-Article-head-to-window-bottom
X            (if new-article
X                (progn
X;;                  (vertical-motion (- (screen-height)
X;;                                      gnus-subject-lines-height 3))
X                  (vertical-motion (- (screen-height)
X				      (save-excursion
X					(set-buffer gnus-Subject-buffer)
X					(window-height))
X				      3))
X                  ;; The next bit is in case the last real line is
X                  ;; (will be) visible on the screen.
X                  (move-to-column (- (screen-width) 3))
X                  (if (not (eobp)) (forward-char 1))
X                  ;; Might only be at end-of-page
X                  (widen)
X                  (if (eobp) "All"
X                    (concat (/ (* 100 (count-lines (point-min) (point)))
X                               (count-lines (point-min) (point-max))) "%")))
X              (move-to-window-line (- (window-height) 2))
X              ;; Same deal as above
X              (move-to-column (- (window-width) 3))
X              (if (not (eobp)) (forward-char 1))
X              ;; Might only be at end-of-page
X              (widen)
X              (if (eobp) "Bot"
X                (concat (/ (* 100 (count-lines (point-min) (point)))
X                           (count-lines (point-min) (point-max))) "%"))))))
X  (set-buffer-modified-p t))
X
X(defun gnus-Article-set-mode-line ()
X  "Set Article mode line string."
X  (setq mode-line-buffer-identification
X	(list 17
X	      (format "GNUS: %s  %s"
X		      gnus-newsgroup-name
X                      (let ((unmarked (length (gnus-set-difference
X                                               gnus-newsgroup-unreads
X                                               gnus-newsgroup-marked))))
X                        (if (= 0 unmarked) "      "
X                          (concat unmarked " more"))))))
X  ;; Even if we did this when narrowing to page, do it again as a
X  ;; new article.
X  (gnus-Article-set-percent 1)
X  (set-buffer-modified-p t))
X
X(defun gnus-Article-next-page (lines)
X  "Show next page of current article.
XIf end of article, return non-nil. Otherwise return nil.
XArgument LINES specifies lines to be scrolled up."
X  (interactive "P")
X  (move-to-window-line -1)
X  (if (eobp)
X      (if (or (not gnus-break-pages)
X              (string-match "All\\|Bot" gnus-Article-head-to-window-bottom)
X	      (save-restriction (widen) (eobp))) ;Real end-of-buffer?
X	  t
X	(gnus-narrow-to-page 1)		;Go to next page.
X	nil
X	)
X    (scroll-up lines)
X    (gnus-Article-set-percent)
X    nil
X    ))
X
X(defun gnus-Article-prev-page (lines)
X  "Show previous page of current article.
XArgument LINES specifies lines to be scrolled down."
X  (interactive "P")
X  (move-to-window-line 0)
X  (if (and gnus-break-pages
X	   (bobp)
X	   (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
X      (progn
X	(gnus-narrow-to-page -1) ;Go to previous page.
X	(goto-char (point-max))
X	(recenter -1))
X    (scroll-down lines)
X    (gnus-Article-set-percent)))
X
X;; I don't want to copy the whole function to my gnus-etc.el, so just
X;; rebind it here.  The only change the original function needs,
X;; however is to include (gnus-Article-set-percent) as the last 
X;; function called by gnus-narrow-to-page.
X(or (fboundp 'original-gnus-narrow-to-page)
X    (fset 'original-gnus-narrow-to-page
X          (symbol-function 'gnus-narrow-to-page)))
X
X(defun gnus-narrow-to-page (&optional arg)
X  "Make text outside current page invisible except for page delimiter.
XA numeric arg specifies to move forward or backward by that many pages,
Xthus showing a page other than the one point was originally in.
XNOTE: This function has been modified to also update the Article buffer
Xmode-line after narrowing."
X  (interactive "P")
X  (setq arg (if arg (prefix-numeric-value arg) 0))
X  (original-gnus-narrow-to-page arg)
X  (gnus-Article-set-percent))
SHAR_EOF
chmod 0644 gnus-user-tale.el || echo "restore of gnus-user-tale.el fails"
set `wc -c gnus-user-tale.el`;Sum=$1
if test "$Sum" != "7771"
then echo original size 7771, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnus.el &&
X;;; GNUS: an NNTP-based News Reader for GNU Emacs
X;; Copyright (C) 1987, 1988, 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1987, 1988, 1989 Masanobu UMEDA
X;; $Header: gnus.el,v 3.12 89/06/19 13:36:31 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;; How to Install GNUS:
X;; (0) First of all, remove GNUS related OLD *.elc files (at least nntp.elc).
X;; (1) Unshar gnus.el, gnuspost.el, gnusmisc.el, and nntp.el.
X;; (2) byte-compile-file nntp.el, gnus.el, gnuspost.el, and gnusmisc.el.
X;;     If you have a local news spool, byte-compile-file nnspool.el, too.
X;; (3) Define three environment variables in .login file as follows:
X;;
X;;     setenv	NNTPSERVER	flab
X;;     setenv	DOMAINNAME	"stars.flab.Fujitsu.CO.JP"
X;;     setenv	ORGANIZATION	"Fujitsu Laboratories Ltd., Kawasaki, Japan."
X;;
X;;     Or instead, define lisp variables in your .emacs, site-init.el,
X;;     or default.el as follows:
X;;
X;;     (setq gnus-nntp-server "flab")
X;;     (setq gnus-your-domain "stars.flab.Fujitsu.CO.JP")
X;;     (setq gnus-your-organization "Fujitsu Laboratories Ltd., ...")
X;;
X;;     If the function (system-name) returns the full internet name,
X;;     you don't have to define the domain.
X;;
X;; (4) You may have to define NNTP service name as number 119.
X;;
X;;     (setq gnus-nntp-service 119)
X;;
X;;     Or, if you'd like to use a local news spool directly in stead
X;;     of NNTP, install nnspool.el and set the variable to nil as
X;;     follows:
X;;
X;;     (setq gnus-nntp-service nil)
X;;
X;; (5) If you'd like to use the GENERICFROM feature like the Bnews,
X;;     define the variable as follows:
X;;
X;;     (setq gnus-use-generic-from t)
X;;
X;; (6) Define autoload entries in .emacs file as follows:
X;;
X;;     (autoload 'gnus "gnus" "Read network news." t)
X;;     (autoload 'gnus-post-news "gnuspost" "Post a news." t)
X;;
X;; (7) Read nntp.el if you have problems with NNTP or kanji handling.
X;;
X;; (8) Install mhspool.el, tcp.el, and tcp.c if it is necessary.
X;;
X;;     mhspool.el is a package for reading articles or mail in your
X;;     private directory using GNUS.
X;;
X;;     tcp.el and tcp.c are necessary if and only if your Emacs does
X;;     not have the function `open-network-stream' which is used for
X;;     communicating with NNTP server inside Emacs.
X;;
X;; (9) Install an Info file generated from the texinfo manual gnus.texinfo.
X;;
X;;     If you are not allowed to create the Info file to the standard
X;;     Info-directory, create it in your private directory and set the
X;;     variable gnus-Info-directory to that directory.
X
X;; GNUS Mailing List:
X;; There are two mailing lists for GNUS lovers in the world:
X;;
X;;	info-gnus@flab.fujitsu.co.jp, and
X;;	info-gnus-english@tut.cis.ohio-state.edu.
X;;
X;; They are intended to exchange useful information about GNUS, such
X;; as bug fixes, useful hooks, and extensions.  The major difference
X;; between the lists is what the official language is.  Both Japanese
X;; and English are available in info-gnus, while English is only
X;; available in info-gnus-english. There is no need to subscribe to
X;; info-gnus if you cannot read Japanese messages, because most of the
X;; discussion and important announcements will be sent to
X;; info-gnus-english. Moreover, if you can read gnu.emacs.gnus
X;; newsgroup of USENET, you need not, either. info-gnus-english and
X;; gnu.emacs.gnus are linked each other.
X;;
X;; Please send subscription request to:
X;;
X;; 	info-gnus-request@flab.fujitsu.co.jp, or
X;;	info-gnus-english-request@cis.ohio-state.edu
X
X;; TO DO:
X;; (1) Incremental update of active info.
X;; (2) GNUS own poster and programmable interface to various mailers.
X;; (3) Multi-GNUS (Talking to many hosts same time).
X;; (4) Asynchronous transmission of large messages.
X
X(provide 'gnus)
X(require 'nntp)
X(require 'mail-utils)
X
X(defvar gnus-nntp-server (getenv "NNTPSERVER")
X  "*The name of the host running NNTP server.
XIf it is a string such as `:DIRECTORY', the user's private DIRECTORY
Xis used as a news spool.
XInitialized from the NNTPSERVER environment variable.")
X
X(defvar gnus-nntp-service "nntp"
X  "*NNTP service name (\"nntp\" or 119).
XGo to a local news spool if its value is nil.")
X
X(defvar gnus-startup-file "~/.newsrc"
X  "*Your .newsrc file. Use `.newsrc-SERVER' instead if exists.")
X
X(defvar gnus-signature-file "~/.signature"
X  "*Your .signature file. Use `.signature-DISTRIBUTION' instead if exists.")
X
X(defvar gnus-large-newsgroup 50
X  "*The number of articles which indicates a large newsgroup.
XIf the number of articles in a newsgroup is greater than the value,
Xconfirmation is required for selecting the newsgroup.")
X
X(defvar gnus-author-copy (getenv "AUTHORCOPY")
X  "*File name saving a copy of an article posted using FCC: field.
XInitialized from the AUTHORCOPY environment variable.
X
XArticles are saved in Unix mail format if the value is a file name.
XInstead, if the first character of the name is `|', the contents of
Xthe article is piped out to the named program. It is possible to save
Xan article in an MH folder as follows:
X
X(setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")")
X
X(defvar gnus-use-long-file-name t
X  "*Non-nil means that a newsgroup name is used as a default file name
Xto save articles to. If it's nil, the directory form of a newsgroup is
Xused instead.")
X
X(defvar gnus-default-article-saver (function gnus-Subject-save-in-rmail)
X  "*A function to save articles in your favorite format.
XThe function must be interactively callable (in other words, it must
Xbe an Emacs command).
X
XGNUS provides the following functions:
X	gnus-Subject-save-in-rmail (in Rmail format)
X	gnus-Subject-save-in-mail (in Unix mail format)
X	gnus-Subject-save-in-folder (in an MH folder)
X	gnus-Subject-save-in-file (in article format).")
X
X(defvar gnus-rmail-save-name (function gnus-plain-save-name)
X  "*A function generating a file name to save articles in Rmail format.
XThe function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
X
X(defvar gnus-mail-save-name (function gnus-plain-save-name)
X  "*A function generating a file name to save articles in Unix mail format.
XThe function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
X
X(defvar gnus-folder-save-name (function gnus-folder-save-name)
X  "*A function generating a file name to save articles in MH folder.
XThe function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.")
X
X(defvar gnus-file-save-name (function gnus-numeric-save-name)
X  "*A function generating a file name to save articles in article format.
XThe function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
X
X(defvar gnus-article-save-directory (getenv "SAVEDIR")
X  "*A directory name to save articles to (default to ~/News).
XInitialized from the SAVEDIR environment variable.")
X
X(defvar gnus-kill-file-name "KILL"
X  "*File name of a KILL file.")
X
X(defvar gnus-default-distribution "local"
X  "*Use this value as distribution if no distribution is specified.")
X
X(defvar gnus-novice-user t
X  "*Non-nil means that you are a novice to USENET.  If non-nil,
Xverbose messages may be displayed or your confirmations may be required.")
X
X(defvar gnus-interactive-post t
X  "*Newsgroup, subject, and distribution will be asked for if non-nil.")
X
X(defvar gnus-user-login-name nil
X  "*The login name of the user.
XGot from the USER and LOGNAME environment variable if undefined.")
X
X(defvar gnus-user-full-name nil
X  "*The full name of the user.
XGot from the NAME environment variable if undefined.")
X
X(defvar gnus-ignored-headers
X  "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:"
X  "*All random fields within the header of a message.")
X
X(defvar gnus-show-all-headers nil
X  "*Show all headers of an article if non-nil.")
X
X(defvar gnus-save-all-headers nil
X  "*Save all headers of an article if non-nil.")
X
X(defvar gnus-optional-headers (function gnus-optional-lines-and-from)
X  "*A function generating a optional string displayed in GNUS Subject
Xmode buffer.  The function is called with an article HEADER. The
Xresult must be a string excluding `[' and `]'.")
X
X(defvar gnus-auto-select-first t
X  "*Select the first unread article automagically if non-nil.
XIf you want to prevent automatic selection of the first unread article
Xin some newsgroups, set the variable to nil in gnus-Select-group-hook
Xor gnus-Apply-kill-hook.")
X
X(defvar gnus-auto-select-next t
X  "*Select the next newsgroup automagically if non-nil.
XIf the value is t and the next newsgroup is empty, GNUS will exit
XSubject mode and go back to Group mode.  If the value is neither nil
Xnor t, GNUS will select the following unread newsgroup. Especially, if
Xthe value is the symbol `quietly', the next unread newsgroup will be
Xselected without any confirmations.")
X
X(defvar gnus-auto-select-same nil
X  "*Select the next article with the same subject automagically if non-nil.")
X
X(defvar gnus-auto-center-subject t
X  "*Always center the current subject in GNUS Subject mode window if non-nil.")
X
X(defvar gnus-break-pages t
X  "*Break an article into pages if non-nil.
XPage delimiter is specified by the variable `gnus-page-delimiter'. A
Xmessage shown at the end of pages is specified by the variable
X`gnus-more-message'.")
X
X(defvar gnus-page-delimiter "^\^L"
X  "*Regexp describing line-beginnings that separate pages of news article.")
X
X(defvar gnus-more-message "*** More ***"
X  "*The message shown at the end of pages in page break mode.")
X
X(defvar gnus-digest-show-summary t
X  "*Show a summary of undigestified messages if non-nil.")
X
X(defvar gnus-digest-separator "^Subject:[ \t]"
X  "*Regexp that separates messages in a digest article.")
X
X(defvar gnus-use-full-window t
X  "*Non-nil means to take up the entire screen of Emacs.")
X
X(defvar gnus-window-configuration
X  '((SelectNewsgroup (0 1 0))
X    (ExitNewsgroup   (1 0 0))
X    (SelectArticle   (0 3 10))
X    (ExpandSubject   (0 1 0)))
X  "*Specify window configurations for each action.
XThe format of the variable is a list of (ACTION (G S A)), where
XG, S, and A are the relative height of Group, Subject, and Article
Xwindows, respectively.  ACTION is `SelectNewsgroup', `ExitNewsgroup',
X`SelectArticle', or `ExpandSubject'.")
X
X(defvar gnus-Group-mode-hook nil
X  "*A hook for GNUS Group Mode.")
X
X(defvar gnus-Subject-mode-hook nil
X  "*A hook for GNUS Subject Mode.")
X
X(defvar gnus-Article-mode-hook nil
X  "*A hook for GNUS Article Mode.")
X
X(defvar gnus-Kill-file-mode-hook nil
X  "*A hook for GNUS KILL File Mode.")
X
X(defvar gnus-Startup-hook nil
X  "*A hook called at start up time.
XThis hook is called after GNUS is connected to the NNTP server. So, it
Xis possible to change the behavior of GNUS according to the selected
XNNTP server.")
X
X(defvar gnus-Group-prepare-hook
X  (function
X   (lambda ()
X     ;; Search for the first unread newsgroup.
X     (goto-char (point-min))
X     (re-search-forward "^[ \t]+[1-9][0-9]*:" nil t)))
X  "*A hook called after newsgroup list is created in the Newsgroup buffer.
XThis hook is used for moving the point to the first unread newsgroup
Xby default.  If you want to modify the Newsgroup buffer, you can use
Xthis hook.")
X
X(defvar gnus-Subject-prepare-hook nil
X  "*A hook called after subject list is created in the Subject buffer.
XIf you want to modify the Subject buffer, you can use this hook.")
X
X(defvar gnus-Article-prepare-hook nil
X  "*A hook called after an article is prepared in the Article buffer.
XIf you want to run a special decoding program like nkf, use this hook.")
X
X(defvar gnus-Select-group-hook nil
X  "*A hook called when a newsgroup is selected.
XIf you want to sort Subject buffer by date and then by subject, you
Xcan use the following hook:
X
X(setq gnus-Select-group-hook
X      '(lambda ()
X	 ;; First of all, sort by date.
X	 (gnus-sort-headers
X	  '(lambda (a b)
X	     (gnus-date-lessp (gnus-header-date a)
X			      (gnus-header-date b))))
X	 ;; Then sort by subject string ignoring `Re:'.
X	 ;; If case-fold-search is non-nil, case of letters is ignored.
X	 (gnus-sort-headers
X	  '(lambda (a b)
X	     (gnus-string-lessp
X	      (gnus-simplify-subject (gnus-header-subject a) 're)
X	      (gnus-simplify-subject (gnus-header-subject b) 're)
X	      )))))
X
XIf you'd like to simplify subjects like the
X`gnus-Subject-next-same-subject' command does, you can use the
Xfollowing hook:
X
X(setq gnus-Select-group-hook
X      '(lambda ()
X	 (mapcar (function
X		  (lambda (header)
X		    (nntp-set-header-subject
X		     header
X		     (gnus-simplify-subject
X		      (gnus-header-subject header) 're-only))))
X		 gnus-newsgroup-headers)))
X
XIn some newsgroups author name is meaningless. It is possible to
Xprevent listing author names in GNUS Subject buffer as follows:
X
X(setq gnus-Select-group-hook
X      '(lambda ()
X	 (cond ((string-equal \"comp.sources.unix\" gnus-newsgroup-name)
X		(setq gnus-optional-headers
X		      (function gnus-optional-lines)))
X	       (t
X		(setq gnus-optional-headers
X		      (function gnus-optional-lines-and-from))))))")
X
X(defvar gnus-Select-article-hook nil
X  "*A hook called when an article is selected.
XIf you'd like to run RMAIL on a digest article automagically, you can
Xuse the following hook:
X
X(setq gnus-Select-article-hook
X      '(lambda ()
X	 (cond ((string-equal \"comp.sys.sun\" gnus-newsgroup-name)
X		(gnus-Subject-rmail-digest))
X	       ((and (string-equal \"comp.text\" gnus-newsgroup-name)
X		     (string-match \"^TeXhax Digest\"
X				   (gnus-header-subject gnus-current-headers)))
X		(gnus-Subject-rmail-digest)
X		))))")
X
X(defvar gnus-Select-digest-hook
X  (function
X   (lambda ()
X     ;; Reply-To: is required by `undigestify-rmail-message'.
X     (or (mail-position-on-field "Reply-to" t)
X	 (progn
X	   (mail-position-on-field "Reply-to")
X	   (insert (gnus-fetch-field "From"))))))
X  "*A hook called when reading digest messages using Rmail.
XThis hook can be used to modify incomplete digest articles as follows
X(this is the default):
X
X(setq gnus-Select-digest-hook
X      '(lambda ()
X	 ;; Reply-To: is required by `undigestify-rmail-message'.
X	 (or (mail-position-on-field \"Reply-to\" t)
X	     (progn
X	       (mail-position-on-field \"Reply-to\")
X	       (insert (gnus-fetch-field \"From\"))))))")
X
X(defvar gnus-Rmail-digest-hook nil
X  "*A hook called when reading digest messages using Rmail.
XThis hook is intended to customize Rmail mode for reading digest articles.")
X
X(defvar gnus-Apply-kill-hook (function gnus-apply-kill-file)
X  "*A hook called when a newsgroup is selected and subject list is prepared.
XThis hook is intended to apply a KILL file to the selected newsgroup.
XThe function `gnus-apply-kill-file' is called defaultly.
X
XSince a general KILL file is too heavy to use only for a few
Xnewsgroups, I recommend you to use a lighter hook function. For
Xexample, if you'd like to apply a KILL file to articles which contains
Xa string `rmgroup' in subject in newsgroup `control', you can use the
Xfollowing hook:
X
X(setq gnus-Apply-kill-hook
X      '(lambda ()
X	 (cond ((string-match \"control\" gnus-newsgroup-name)
X		(gnus-kill \"Subject\" \"rmgroup\")
X		(gnus-expunge \"X\")))))")
X
X(defvar gnus-Mark-article-hook
X  (function
X   (lambda ()
X     (or (memq gnus-current-article gnus-newsgroup-marked)
X	 (gnus-Subject-mark-as-read gnus-current-article))
X     (gnus-Subject-set-current-mark "+")))
X  "*A hook called when an article is selected at the first time.
XThe hook is intended to mark an article as read (or unread)
Xautomatically when it is selected.
X
XIf you'd like to mark as unread (-) instead, use the following hook:
X
X(setq gnus-Mark-article-hook
X      '(lambda ()
X	 (gnus-Subject-mark-as-unread gnus-current-article)
X	 (gnus-Subject-set-current-mark \"+\")))")
X
X(defvar gnus-Inews-article-hook nil
X  "*A hook called before posting an article.
XIf you'd like to run a special encoding program, use this hook.")
X
X(defvar gnus-Exit-group-hook nil
X  "*A hook called when exiting (not quitting) Subject mode.
XIf your machine is so slow that exiting from Subject mode takes very
Xlong time, set the variable gnus-newsgroup-headers to nil. This
Xinhibits marking articles as read using cross-reference information.")
X
X(defvar gnus-Suspend-gnus-hook nil
X  "*A hook called when suspending (not exiting) GNUS.")
X
X(defvar gnus-Exit-gnus-hook nil
X  "*A hook called when exiting (not suspending) GNUS.")
X
X(defvar gnus-Save-newsrc-hook nil
X  "*A hook called when saving the newsrc file.
XThis hook is called before saving .newsrc file.")
X
X;; Site dependent variables. You have to define these variables in
SHAR_EOF
echo "End of part 1, continue with part 2"
echo "2" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.el continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.el
X;;  site-init.el, default.el or your .emacs.
X
X(defvar gnus-your-domain nil
X  "*Your domain name without your host name like: \"stars.flab.Fujitsu.CO.JP\"
XThe `DOMAINNAME' environment variable is used instead if defined.  If
Xthe function (system-name) returns the full internet name, there is no
Xneed to define the name.")
X
X(defvar gnus-your-organization nil
X  "*Your organization like: \"Fujitsu Laboratories Ltd., Kawasaki, Japan.\"
XThe `ORGANIZATION' environment variable is used instead if defined.")
X
X(defvar gnus-use-generic-from nil
X  "*If nil, prepend local host name to the defined domain in the From:
Xfield; if stringp, use this; if non-nil, strip of the local host name.")
X
X(defvar gnus-use-generic-path nil
X  "*If nil, use the NNTP server name in the Path: field; if stringp,
Xuse this; if non-nil, use no host name (user name only)")
X
X(defvar gnus-Info-directory Info-directory
X  "*A directory placing an Info file of GNUS.")
X
X
X;; Internal variables.
X
X(defconst gnus-version "GNUS 3.12"
X  "Version numbers of this version of GNUS.")
X
X(defvar gnus-Info-nodes
X  '((gnus-Group-mode . "(gnus)Newsgroup Commands")
X    (gnus-Subject-mode . "(gnus)Subject Commands")
X    (gnus-Article-mode . "(gnus)Article Commands")
X    (gnus-Kill-file-mode . "(gnus)KILL File")
X    (gnus-Browse-killed-mode . "(gnus)Maintenance"))
X  "Assoc list of major modes and related Info nodes.") ;Not user variable.
X
X(defvar gnus-access-methods
X  '((nntp
X     (gnus-retrieve-headers .	nntp-retrieve-headers)
X     (gnus-open-server .	nntp-open-server)
X     (gnus-close-server .	nntp-close-server)
X     (gnus-server-opened .	nntp-server-opened)
X     (gnus-status-message .	nntp-status-message)
X     (gnus-request-article .	nntp-request-article)
X     (gnus-request-group .	nntp-request-group)
X     (gnus-request-list .	nntp-request-list)
X     (gnus-request-post .	nntp-request-post))
X    (nnspool
X     (gnus-retrieve-headers .	nnspool-retrieve-headers)
X     (gnus-open-server .	nnspool-open-server)
X     (gnus-close-server .	nnspool-close-server)
X     (gnus-server-opened .	nnspool-server-opened)
X     (gnus-status-message .	nnspool-status-message)
X     (gnus-request-article .	nnspool-request-article)
X     (gnus-request-group .	nnspool-request-group)
X     (gnus-request-list .	nnspool-request-list)
X     (gnus-request-post .	nnspool-request-post))
X    (mhspool
X     (gnus-retrieve-headers .	mhspool-retrieve-headers)
X     (gnus-open-server .	mhspool-open-server)
X     (gnus-close-server .	mhspool-close-server)
X     (gnus-server-opened .	mhspool-server-opened)
X     (gnus-status-message .	mhspool-status-message)
X     (gnus-request-article .	mhspool-request-article)
X     (gnus-request-group .	mhspool-request-group)
X     (gnus-request-list .	mhspool-request-list)
X     (gnus-request-post .	mhspool-request-post)))
X  "Access method for NNTP, nnspool, and mhspool.")
X
X(defvar gnus-Group-buffer "*Newsgroup*")
X(defvar gnus-Subject-buffer "*Subject*")
X(defvar gnus-Article-buffer "*Article*")
X(defvar gnus-Digest-buffer "GNUS Digest")
X(defvar gnus-Digest-summary-buffer "GNUS Digest-summary")
X
X(defvar gnus-buffer-list
X  (list gnus-Group-buffer gnus-Subject-buffer gnus-Article-buffer
X	gnus-Digest-buffer gnus-Digest-summary-buffer)
X  "GNUS buffers which should be killed when exiting.")
X
X(defvar gnus-variable-list
X  '(gnus-newsrc-options
X    gnus-newsrc-options-n-yes gnus-newsrc-options-n-no
X    gnus-newsrc-assoc gnus-killed-assoc gnus-marked-assoc)
X  "GNUS variables saved in the quick startup file.")
X
X(defvar gnus-newsrc-options nil
X  "Options line in the .newsrc file.")
X
X(defvar gnus-newsrc-options-n-yes nil
X  "Regexp representing subscribed newsgroups.")
X
X(defvar gnus-newsrc-options-n-no nil
X  "Regexp representing unsubscribed newsgroups.")
X
X(defvar gnus-newsrc-assoc nil
X  "Assoc list of read articles.")
X
X(defvar gnus-killed-assoc nil
X  "Assoc list of newsgroups removed from gnus-newsrc-assoc.")
X
X(defvar gnus-marked-assoc nil
X  "Assoc list of articles marked as unread.")
X
X(defvar gnus-unread-hashtb nil
X  "Hashtable of unread articles.")
X
X(defvar gnus-active-hashtb nil
X  "Hashtable of active articles.")
X
X(defvar gnus-octive-hashtb nil
X  "Hashtable of OLD active articles.")
X
X(defvar gnus-current-startup-file nil
X  "Startup file for the current host.")
X
X(defvar gnus-last-search-regexp nil
X  "Default regexp for article search command.")
X
X(defvar gnus-last-shell-command nil
X  "Default shell command on article.")
X
X(defvar gnus-newsgroup-name nil)
X(defvar gnus-newsgroup-begin nil)
X(defvar gnus-newsgroup-end nil)
X(defvar gnus-newsgroup-last-rmail nil)
X(defvar gnus-newsgroup-last-mail nil)
X(defvar gnus-newsgroup-last-folder nil)
X(defvar gnus-newsgroup-last-file nil)
X(defvar gnus-have-all-newsgroups nil)
X
X(defvar gnus-newsgroup-unreads nil
X  "List of unread articles in the current newsgroup.")
X
X(defvar gnus-newsgroup-unselected nil
X  "List of unselected unread articles in the current newsgroup.")
X
X(defvar gnus-newsgroup-marked nil
X  "List of marked articles in the current newsgroup (a subset of unread art).")
X
X(defvar gnus-newsgroup-headers nil
X  "List of article headers in the current newsgroup.")
X
X(defvar gnus-current-article nil)
X(defvar gnus-current-headers nil)
X(defvar gnus-current-history nil)
X(defvar gnus-have-all-headers nil)
X(defvar gnus-last-article nil)
X(defvar gnus-current-kill-article nil)
X
X(defvar gnus-Group-mode-map nil)
X(defvar gnus-Subject-mode-map nil)
X(defvar gnus-Article-mode-map nil)
X(defvar gnus-Kill-file-mode-map nil)
X
X(defvar rmail-last-file (expand-file-name "~/XMBOX"))
X(defvar rmail-last-rmail-file (expand-file-name "~/XNEWS"))
X
X;; Define GNUS Subsystems.
X
X(autoload 'gnus-Group-kill-group "gnusmisc"
X	  "Kill newsgroup on current line." t)
X(autoload 'gnus-Group-yank-group "gnusmisc"
X	  "Yank the last killed newsgroup on current line." t)
X(autoload 'gnus-Browse-killed-groups "gnusmisc"
X	  "Browse the killed newsgroups." t)
X
X(autoload 'gnus-post-news   "gnuspost" "Post a new news." t)
X(autoload 'gnus-news-reply  "gnuspost" "Post a reply news." t)
X(autoload 'gnus-cancel-news "gnuspost" "Cancel your news." t)
X
X(autoload 'rmail-output "rmailout"
X	  "Append this message to Unix mail file named FILE-NAME." t)
X(autoload 'news-mail-reply "rnewspost")
X(autoload 'news-mail-other-window "rnewspost")
X(autoload 'mail-position-on-field "sendmail")
X(autoload 'mh-find-path "mh-e")
X(autoload 'mh-prompt-for-folder "mh-e")
X
X(put 'gnus-Group-mode 'mode-class 'special)
X(put 'gnus-Subject-mode 'mode-class 'special)
X(put 'gnus-Article-mode 'mode-class 'special)
X
X
X;;(put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
X
X(defmacro gnus-eval-in-buffer-window (buffer &rest forms)
X  "Pop to BUFFER, evaluate FORMS, and then returns to original window."
X  (` (let ((GNUSStartBufferWindow (selected-window)))
X       (unwind-protect
X	   (progn
X	     (pop-to-buffer (, buffer))
X	     (,@ forms))
X	 (select-window GNUSStartBufferWindow)))))
X
X(defmacro gnus-make-hashtable ()
X  '(make-abbrev-table))
X
X(defmacro gnus-gethash (string hashtable)
X  "Get hash value of STRING in HASHTABLE."
X  ;;(` (symbol-value (abbrev-symbol (, string) (, hashtable))))
X  (` (abbrev-expansion (, string) (, hashtable))))
X
X(defmacro gnus-sethash (string value hashtable)
X  "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
X  ;; We cannot use define-abbrev since it only accepts string as value.
X  (` (set (intern (, string) (, hashtable)) (, value))))
X
X;; Note: Macros defined here are also defined in nntp.el. I don't like
X;; to put them here, but many users got troubled with the old
X;; definitions in nntp.elc. These codes are NNTP 3.7 version.
X
X(defmacro nntp-header-number (header)
X  "Return article number in HEADER."
X  (` (aref (, header) 0)))
X
X(defmacro nntp-set-header-number (header number)
X  "Set article number of HEADER to NUMBER."
X  (` (aset (, header) 0 (, number))))
X
X(defmacro nntp-header-subject (header)
X  "Return subject string in HEADER."
X  (` (aref (, header) 1)))
X
X(defmacro nntp-set-header-subject (header subject)
X  "Set article subject of HEADER to SUBJECT."
X  (` (aset (, header) 1 (, subject))))
X
X(defmacro nntp-header-from (header)
X  "Return author string in HEADER."
X  (` (aref (, header) 2)))
X
X(defmacro nntp-set-header-from (header from)
X  "Set article author of HEADER to FROM."
X  (` (aset (, header) 2 (, from))))
X
X(defmacro nntp-header-xref (header)
X  "Return xref string in HEADER."
X  (` (aref (, header) 3)))
X
X(defmacro nntp-set-header-xref (header xref)
X  "Set article xref of HEADER to xref."
X  (` (aset (, header) 3 (, xref))))
X
X(defmacro nntp-header-lines (header)
X  "Return lines in HEADER."
X  (` (aref (, header) 4)))
X
X(defmacro nntp-set-header-lines (header lines)
X  "Set article lines of HEADER to LINES."
X  (` (aset (, header) 4 (, lines))))
X
X(defmacro nntp-header-date (header)
X  "Return date in HEADER."
X  (` (aref (, header) 5)))
X
X(defmacro nntp-set-header-date (header date)
X  "Set article date of HEADER to DATE."
X  (` (aset (, header) 5 (, date))))
X
X(defmacro nntp-header-id (header)
X  "Return date in HEADER."
X  (` (aref (, header) 6)))
X
X(defmacro nntp-set-header-id (header id)
X  "Set article ID of HEADER to ID."
X  (` (aset (, header) 6 (, id))))
X
X
X;;;
X;;; GNUS Group Mode
X;;;
X
X(if gnus-Group-mode-map
X    nil
X  (setq gnus-Group-mode-map (make-keymap))
X  (suppress-keymap gnus-Group-mode-map)
X  (define-key gnus-Group-mode-map " " 'gnus-Group-read-group)
X  (define-key gnus-Group-mode-map "=" 'gnus-Group-select-group)
X  (define-key gnus-Group-mode-map "j" 'gnus-Group-jump-to-group)
X  (define-key gnus-Group-mode-map "n" 'gnus-Group-next-unread-group)
X  (define-key gnus-Group-mode-map "p" 'gnus-Group-prev-unread-group)
X  (define-key gnus-Group-mode-map "\177" 'gnus-Group-prev-unread-group)
X  (define-key gnus-Group-mode-map "N" 'gnus-Group-next-group)
X  (define-key gnus-Group-mode-map "P" 'gnus-Group-prev-group)
X  (define-key gnus-Group-mode-map "\C-n" 'gnus-Group-next-group)
X  (define-key gnus-Group-mode-map "\C-p" 'gnus-Group-prev-group)
X  (define-key gnus-Group-mode-map "\r" 'next-line)
X  (define-key gnus-Group-mode-map "/" 'isearch-forward)
X  (define-key gnus-Group-mode-map "<" 'beginning-of-buffer)
X  (define-key gnus-Group-mode-map ">" 'end-of-buffer)
X  (define-key gnus-Group-mode-map "u" 'gnus-Group-unsubscribe-current-group)
X  (define-key gnus-Group-mode-map "U" 'gnus-Group-unsubscribe-group)
X  (define-key gnus-Group-mode-map "c" 'gnus-Group-catch-up)
X  (define-key gnus-Group-mode-map "C" 'gnus-Group-catch-up-all)
X  (define-key gnus-Group-mode-map "l" 'gnus-Group-list-groups)
X  (define-key gnus-Group-mode-map "L" 'gnus-Group-list-all-groups)
X  (define-key gnus-Group-mode-map "g" 'gnus-Group-get-new-news)
X  (define-key gnus-Group-mode-map "R" 'gnus-Group-restart)
X  (define-key gnus-Group-mode-map "b" 'gnus-Group-check-bogus-groups)
X  (define-key gnus-Group-mode-map "r" 'gnus-Group-restrict-groups)
X  (define-key gnus-Group-mode-map "a" 'gnus-Group-post-news)
X  (define-key gnus-Group-mode-map "\ek" 'gnus-Group-edit-local-kill)
X  (define-key gnus-Group-mode-map "\eK" 'gnus-Group-edit-global-kill)
X  (define-key gnus-Group-mode-map "\C-k" 'gnus-Group-kill-group)
X  (define-key gnus-Group-mode-map "\C-y" 'gnus-Group-yank-group)
X  (define-key gnus-Group-mode-map "\C-c\C-y" 'gnus-Browse-killed-groups)
X  (define-key gnus-Group-mode-map "V" 'gnus-version)
X  (define-key gnus-Group-mode-map "x" 'gnus-Group-force-update)
X  (define-key gnus-Group-mode-map "s" 'gnus-Group-force-update)
X  (define-key gnus-Group-mode-map "z" 'gnus-Group-suspend)
X  (define-key gnus-Group-mode-map "q" 'gnus-Group-exit)
X  (define-key gnus-Group-mode-map "Q" 'gnus-Group-quit)
X  (define-key gnus-Group-mode-map "?" 'gnus-Group-describe-briefly)
X  (define-key gnus-Group-mode-map "\C-c\C-i" 'gnus-Info-find-node))
X
X(defun gnus-Group-mode ()
X  "Major mode for reading network news.
XAll normal editing commands are turned off.
XInstead, these commands are available:
X
XSPC	Read articles in this newsgroup.
X=	Select this newsgroup.
Xj	Move to the specified newsgroup.
Xn	Move to the next unread newsgroup.
Xp	Move to the previous unread newsgroup.
XC-n	Move to the next newsgroup.
XC-p	Move to the previous newsgroup.
X/	Do an incremental search forward.
X<	Move point to the beginning of this buffer.
X>	Move point to the end of this buffer.
Xu	Unsubscribe from (subscribe to) this newsgroup.
XU	Unsubscribe from (subscribe to) the specified newsgroup.
Xc	Mark all articles as read, preserving marked articles.
XC	Mark all articles in this newsgroup as read.
Xl	Revert this buffer.
XL	List all newsgroups.
Xg	Get new news.
XR	Force to read the raw .newsrc file and get new news.
Xb	Check bogus newsgroups.
Xr	Restrict visible newsgroups to the current region.
Xa	Post a new article.
XESC k	Edit a local KILL file applied to this newsgroup.
XESC K	Edit a global KILL file applied to all newsgroups.
XC-k	Kill this newsgroup.
XC-y	Yank killed newsgroup here.
XC-c C-y	Browse killed newsgroups.
Xs	Save .newsrc file.
Xz	Suspend reading news.
Xq	Quit reading news.
XQ	Quit reading news without saving .newsrc file.
XV	Show the version number of this GNUS.
X?	Describe Group Mode commands briefly.
XC-h m	Describe Group Mode.
XC-c C-i	Read Info about Group Mode.
X
X  The name of the host running NNTP server is asked for if no default
Xhost is specified. It is also possible to choose another NNTP server
Xeven when the default server is defined by giving a prefix argument to
Xthe command `\\[gnus]'.
X
X  If an NNTP server is preceded by a colon such as `:Mail', the user's
Xprivate directory `~/Mail' is used as a news spool. This makes it
Xpossible to read mail stored in MH folders or articles saved by GNUS.
XFile names of mail or articles must consist of only numeric
Xcharacters. Otherwise, they are ignored.
X
X  If there is a file named `~/.newsrc-SERVER', it is used as the
Xstartup file instead of standard one when talking to SERVER.  It is
Xpossible to talk to many hosts by using different startup files for
Xeach.
X
X  Option `-n' of the options line in the startup file is recognized
Xproperly the same as the Bnews system. For example, if the options
Xline is `options -n !talk talk.rumors', newsgroups under the `talk'
Xhierarchy except for `talk.rumors' are ignored while checking new
Xnewsgroups.
X
X  If there is a file named `~/.signature-DISTRIBUTION', it is used as
Xsignature file instead of standard one when posting a news in
XDISTRIBUTION.
X
X  If an Info file generated from `gnus.texinfo' is installed, you can
Xread an appropriate Info node of the Info file according to the
Xcurrent major mode of GNUS by \\[gnus-Info-find-node].
X
X  The variable `gnus-version', `nntp-version', `nnspool-version', and
X`mhspool-version' have the version numbers of this version of gnus.el,
Xnntp.el, nnspool.el, and mhspoo.el, respectively.
X
XUser customizable variables:
X gnus-nntp-server
X    Specifies the name of the host running the NNTP server. If its
X    value is a string such as `:DIRECTORY', the user's private
X    DIRECTORY is used as a news spool. The variable is initialized
X    from the NNTPSERVER environment variable.
X
X gnus-nntp-service
X    Specifies a NNTP service name. It is usually \"nntp\" or 119.  Nil
X    forces GNUS to use a local news spool if the variable
X    `gnus-nntp-server' is set to the local host name.
X
X gnus-startup-file
X    Specifies a startup file (.newsrc). If there is a file named
X    `.newsrc-SERVER', it's used instead when talking to SERVER. I
X    recommend you to use the server specific file, if you'd like to
X    talk to many servers.  Especially if you'd like to read your
X    private directory, the name of the file must be
X    `.newsrc-:DIRECTORY'.
X
X gnus-signature-file
X    Specifies a signature file (.signature). If there is a file named
X    `.signature-DISTRIBUTION', it's used instead when posting an
X    article in DISTRIBUTION. Set the variable to nil to prevent
X    appending the file automatically. If you use an NNTP inews which
X    comes with the NNTP package, you may have to set the variable to
X    nil.
X
X gnus-author-copy
X    Specifies a file name to save a copy of article you posted using
X    FCC: field.  If the first character of the value is `|', the
X    contents of the article is piped out to a program specified by the
X    rest of the value.  The variable is initialized from the
X    AUTHORCOPY environment variable.
X
X gnus-kill-file-name
X    Use specified file name as a KILL file (default to `KILL').
X
X gnus-novice-user
X    Non-nil means that you are a novice to USENET.  If non-nil,
X    verbose messages may be displayed or your confirmations may be
X    required.
X
X gnus-interactive-post
X    Non-nil means that newsgroup, subject and distribution are asked
X    for interactively when posting a new article.
X
X gnus-use-full-window
X    Non-nil means to take up the entire screen of Emacs.
X
X gnus-window-configuration
X    Specifies the configuration of Group, Subject, and Article
X    windows.  It is a list of (ACTION (G S A)), where G, S, and A are
X    the relative height of Group, Subject, and Article windows,
X    respectively.  ACTION is `SelectNewsgroup', `ExitNewsgroup',
X    `SelectArticle', or `ExpandSubject'.
X
X [gnus-subject-lines-height is obsolete. Use gnus-window-configuration.]
X
XVarious hooks for customization:
X gnus-Group-mode-hook
X    Entry to this mode calls the value with no arguments, if that
X    value is non-nil. This hook is called before GNUS is connected to
X    the NNTP server. So, you can change or define the NNTP server in
X    this hook.
X
X gnus-Startup-hook
X    Called with no arguments after the NNTP server is selected. It is
X    possible to change the behavior of GNUS or initialize the
X    variables according to the selected NNTP server.
X
X gnus-Group-prepare-hook
X    Called with no arguments after a newsgroup list is created in the
X    Newsgroup buffer, if that value is non-nil. See the documentation
X    of this variable for more information.
X
X gnus-Save-newsrc-hook
X    Called with no arguments when saving newsrc file if that value is
X    non-nil.
X
X gnus-Inews-article-hook
X    Called with no arguments when posting an article if that value is
X    non-nil. This hook is called just before posting an article, while
X    news-inews-hook is called before preparing article headers. If
X    you'd like to convert kanji code of the article, this hook is recommended.
X
X gnus-Suspend-gnus-hook
X    Called with no arguments when suspending (not exiting) GNUS, if
X    that value is non-nil.
X
X gnus-Exit-gnus-hook
X    Called with no arguments when exiting (not suspending) GNUS, if
X    that value is non-nil."
X  (interactive)
X  (kill-all-local-variables)
X  ;; Gee.  Why don't you upgrade?
X  (cond ((boundp 'mode-line-modified)
X	 (setq mode-line-modified "--- "))
X	((listp (default-value 'mode-line-format))
X	 (setq mode-line-format
X	       (cons "--- " (cdr (default-value 'mode-line-format)))))
X	(t
X	 (setq mode-line-format
X	       "--- GNUS: List of Newsgroups  %[(%m)%]----%3p-%-")))
X  (setq major-mode 'gnus-Group-mode)
X  (setq mode-name "GNUS Newsgroup")
X  (setq mode-line-buffer-identification	"GNUS: List of Newsgroups")
X  (setq mode-line-process nil)
X  (use-local-map gnus-Group-mode-map)
X  (buffer-flush-undo (current-buffer))
X  (setq buffer-read-only t)		;Disable modification
X  (run-hooks 'gnus-Group-mode-hook))
X
X(defun gnus (&optional confirm)
X  "Read network news.
XIf optional argument CONFIRM is non-nil, ask NNTP server."
X  (interactive "P")
X  (unwind-protect
X      (progn
X	(switch-to-buffer (get-buffer-create gnus-Group-buffer))
X	(gnus-Group-mode)
X	(gnus-start-news-server confirm))
X    (if (not (gnus-server-opened))
X	(gnus-Group-quit)
X      ;; NNTP server is successfully open. 
X      (setq mode-line-process (format " {%s}" gnus-nntp-server))
X      (let ((buffer-read-only nil))
X	(erase-buffer)
X	(gnus-Group-startup-message)
X	(sit-for 0))
X      (run-hooks 'gnus-Startup-hook)
X      (gnus-setup-news-info)
X      (if gnus-novice-user
X	  (gnus-Group-describe-briefly)) ;Show brief help message.
X      (gnus-Group-list-groups nil)
X      )))
X
X(defun gnus-Group-startup-message ()
X  "Insert startup message in current buffer."
X  ;; Insert the message.
X  (insert "
X                   GNUS Version 3.12
X
X         NNTP-based News Reader for GNU Emacs
X
X
XIf you have any trouble with this software, please let me
Xknow. I will fix your problems in the next release.
X
XComments, suggestions, and bug fixes are welcome.
X
XMasanobu UMEDA
Xumerin@flab.Fujitsu.CO.JP
Xumerin%flab.Fujitsu.JUNET@uunet.UU.NET")
X  ;; And then hack it.
X  ;; 57 is the longest line.
X  (indent-rigidly (point-min) (point-max) (/ (max (- (window-width) 57) 0) 2))
X  (goto-char (point-min))
X  ;; +4 is fuzzy factor.
X  (insert-char ?\n (/ (max (- (window-height) 18) 0) 2)))
X
X(defun gnus-Group-list-groups (show-all)
X  "List newsgroups in the Newsgroup buffer.
XIf argument SHOW-ALL is non-nil, unsubscribed groups are also listed."
X  (interactive "P")
X  (gnus-Group-prepare show-all)
X  (if (zerop (buffer-size))
X      (message "No news is good news")
X    ;; Adjust cursor point.
X    (beginning-of-line)			;(goto-char (point-min))
X    (search-forward ":" nil t)
X    ))
X
X(defun gnus-Group-prepare (&optional all)
X  "Prepare list of newsgroups in current buffer.
XIf optional argument ALL is non-nil, unsubscribed groups are also listed."
X  (let ((buffer-read-only nil)
X	(newsrc gnus-newsrc-assoc)
X	(group-info nil)
X	(group-name nil)
X	(unread-count 0)
X	;; This specifies the format of Group buffer.
X	(cntl "%s%s%5d: %s\n"))
X    (erase-buffer)
X    ;; List newsgroups.
X    (while newsrc
X      (setq group-info (car newsrc))
X      (setq group-name (car group-info))
X      (setq unread-count (nth 1 (gnus-gethash group-name gnus-unread-hashtb)))
X      (if (or all
X	      (and (nth 1 group-info)	;Subscribed.
X		   (> unread-count 0)))	;There are unread articles.
X	  ;; Yes, I can use gnus-Group-prepare-line, but this is faster.
X	  (insert
X	   (format cntl
X		   ;; Subscribed or not.
X		   (if (nth 1 group-info) " " "U")
X		   ;; Has new news?
X		   (if (and (> unread-count 0)
X			    (>= 0
X				(- unread-count
X				   (length
X				    (cdr (assoc group-name
X						gnus-marked-assoc))))))
X		       "*" " ")
X		   ;; Number of unread articles.
X		   unread-count
X		   ;; Newsgroup name.
X		   group-name))
X	)
X      (setq newsrc (cdr newsrc))
X      )
X    (setq gnus-have-all-newsgroups all)
X    (goto-char (point-min))
X    (run-hooks 'gnus-Group-prepare-hook)
X    ))
X
X(defun gnus-Group-prepare-line (info)
X  "Return a string for the Newsgroup buffer from INFO.
XINFO is an element of gnus-newsrc-assoc or gnus-killed-assoc."
X  (let* ((group-name (car info))
X	 (unread-count
X	  (or (nth 1 (gnus-gethash group-name gnus-unread-hashtb))
X	      ;; Not in hash table, so compute it now.
X	      (gnus-number-of-articles
X	       (gnus-difference-of-range
X		(nth 2 (gnus-gethash group-name gnus-active-hashtb))
X		(nthcdr 2 info)))))
X	 ;; This specifies the format of Group buffer.
X	 (cntl "%s%s%5d: %s\n"))
X    (format cntl
X	    ;; Subscribed or not.
X	    (if (nth 1 info) " " "U")
X	    ;; Has new news?
X	    (if (and (> unread-count 0)
X		     (>= 0
X			 (- unread-count
X			    (length
X			     (cdr (assoc group-name gnus-marked-assoc))))))
X		"*" " ")
X	    ;; Number of unread articles.
X	    unread-count
X	    ;; Newsgroup name.
X	    group-name
X	    )))
X
X(defun gnus-Group-update-group (group &optional visible-only)
X  "Update newsgroup info of GROUP.
XIf optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored."
X  (let ((buffer-read-only nil)
X	(visible nil))
X    ;; Buffer may be narrowed.
X    (save-restriction
X      (widen)
X      ;; Search point to modify.
X      (goto-char (point-min))
X      (if (re-search-forward (concat "^.+: " (regexp-quote group) "$") nil t)
X	  ;; GROUP is listed in current buffer. So, delete old line.
X	  (progn
X	    (setq visible t)
X	    (beginning-of-line)
X	    (delete-region (point) (progn (forward-line 1) (point)))
X	    ))
X      (if (or visible (not visible-only))
X	  (progn
X	    (insert (gnus-Group-prepare-line (assoc group gnus-newsrc-assoc)))
X	    (forward-line -1)		;Move point on that line.
X	    ))
X      )))
X
X;; GNUS Group mode command
X
X(defun gnus-Group-group-name ()
X  "Get newsgroup name around point."
X  (save-excursion
X    (beginning-of-line)
X    (if (looking-at ".[* \t]*[0-9]+:[ \t]+\\([^ \t\n]+\\)$")
X	(buffer-substring (match-beginning 1) (match-end 1))
X      )))
X
X(defun gnus-Group-read-group (all &optional no-article)
X  "Read news in this newsgroup.
XIf argument ALL is non-nil, already read articles become readable.
XIf optional argument NO-ARTICLE is non-nil, no article body is displayed."
X  (interactive "P")
X  (let ((group (gnus-Group-group-name))) ;Newsgroup name to read.
X    (if group
X	(gnus-Subject-read-group
X	 group
X	 (or all
X	     ;;(not (nth 1 (assoc group gnus-newsrc-assoc)))	;Unsubscribed
X	     (zerop
X	      (nth 1 (gnus-gethash group gnus-unread-hashtb))))	;No unread
X	 no-article
X	 ))
X    ))
X
X(defun gnus-Group-select-group (all)
X  "Select this newsgroup.
XNo article is selected automatically.
XIf argument ALL is non-nil, already read articles become readable."
X  (interactive "P")
X  (gnus-Group-read-group all t))
X
X(defun gnus-Group-jump-to-group (group)
X  "Jump to newsgroup GROUP."
X  (interactive
X   (list (completing-read "Newsgroup: " gnus-newsrc-assoc nil 'require-match)))
X  (goto-char (point-min))
X  (or (re-search-forward (concat "^.+: " (regexp-quote group) "$") nil t)
X      (if (assoc group gnus-newsrc-assoc)
X	  ;; Add GROUP entry, then seach again.
X	  (gnus-Group-update-group group)))
X  ;; Adjust cursor point.
X  (beginning-of-line)
X  (search-forward ":" nil t))
X
X(defun gnus-Group-search-forward (backward any-group)
X  "Search for newsgroup forward.
XIf 1st argument BACKWARD is non-nil, search backward instead.
XIf 2nd argument ANY-GROUP is non-nil, unsubscribed or empty group
Xmay be selected."
X  (let ((func (if backward 're-search-backward 're-search-forward))
X	(regexp 
X	 (format "^%s[ \t]*\\(%s\\):"
X		 (if any-group ".." " [ \t]")
X		 (if any-group "[0-9]+" "[1-9][0-9]*")))
X	(found nil))
X    (if backward
X	(beginning-of-line)
X      (end-of-line))
X    (setq found (funcall func regexp nil t))
X    ;; Adjust cursor point.
X    (beginning-of-line)
X    (search-forward ":" nil t)
X    ;; Return T if found.
X    found
X    ))
X
X(defun gnus-Group-next-group (n)
X  "Go to next N'th newsgroup."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Group-search-forward nil t))
X    (setq n (1- n)))
X  (or (gnus-Group-search-forward nil t)
X      (message "No more newsgroup")))
X
X(defun gnus-Group-next-unread-group (n)
X  "Go to next N'th unread newsgroup."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Group-search-forward nil nil))
X    (setq n (1- n)))
X  (or (gnus-Group-search-forward nil nil)
X      (message "No more unread newsgroup")))
X
X(defun gnus-Group-prev-group (n)
X  "Go to previous N'th newsgroup."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Group-search-forward t t))
X    (setq n (1- n)))
X  (or (gnus-Group-search-forward t t)
X      (message "No more newsgroup")))
X
X(defun gnus-Group-prev-unread-group (n)
X  "Go to previous N'th unread newsgroup."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Group-search-forward t nil))	      
X    (setq n (1- n)))
X  (or (gnus-Group-search-forward t nil)
X      (message "No more unread newsgroup")))
X
X(defun gnus-Group-catch-up (all &optional quietly)
X  "Mark all articles not marked as unread in current newsgroup as read.
XIf prefix argument ALL is non-nil, all articles are marked as read.
XCross references (Xref: field) of articles are ignored."
X  (interactive "P")
X  (let* ((group (gnus-Group-group-name))
X         (marked (if (not all)
X		     (cdr (assoc group gnus-marked-assoc)))))
X    (and group
X	 (or quietly
X	     (y-or-n-p
X	      (if all
X		  "Do you really want to mark everything as read? "
X		"Delete all articles not marked as read? ")))
X	 (progn
X	   (message "")			;Erase "Yes or No" question.
X	   ;; Any marked articles will be preserved.
X	   (gnus-update-unread-articles group marked marked)
X	   (gnus-Group-update-group group)
X	   (gnus-Group-next-group 1)))
X    ))
X
X(defun gnus-Group-catch-up-all (&optional quietly)
X  "Mark all articles in current newsgroup as read.
XCross references (Xref: field) of articles are ignored."
X  (interactive)
X  (gnus-Group-catch-up t quietly))
X
X(defun gnus-Group-unsubscribe-current-group ()
X  "Toggle subscribe from/to unsubscribe current group."
X  (interactive)
X  (gnus-Group-unsubscribe-group (gnus-Group-group-name))
X  (gnus-Group-next-group 1))
X
X(defun gnus-Group-unsubscribe-group (group)
X  "Toggle subscribe from/to unsubscribe GROUP.
XNew newsgroup is added to .newsrc automatically."
X  (interactive
X   (list (completing-read "Newsgroup: "
X			  gnus-active-hashtb nil 'require-match)))
X  (let ((newsrc (assoc group gnus-newsrc-assoc)))
X    (cond ((not (null newsrc))
X	   ;; Toggle subscription flag.
X	   (setcar (nthcdr 1 newsrc) (not (nth 1 newsrc)))
X	   (gnus-update-newsrc-buffer group)
X	   (gnus-Group-update-group group)
X	   ;; Adjust cursor point.
X	   (beginning-of-line)
X	   (search-forward ":" nil t))
X	  ((and (stringp group)
X		(gnus-gethash group gnus-active-hashtb))
X	   ;; Add new newsgroup.
X	   (gnus-add-new-newsgroup group)
X	   (gnus-Group-update-group group)
X	   ;; Adjust cursor point.
X	   (beginning-of-line)
X	   (search-forward ":" nil t))
X	  (t (error "No such newsgroup: %s" group)))
X    ))
X
X(defun gnus-Group-list-all-groups ()
X  "List all of newsgroups in the Newsgroup buffer."
X  (interactive)
X  (gnus-Group-list-groups t))
X
X(defun gnus-Group-get-new-news ()
X  "Get newly arrived articles. In fact, read the active file again."
X  (interactive)
X  (gnus-setup-news-info)
X  (gnus-Group-list-groups gnus-have-all-newsgroups))
X
X(defun gnus-Group-restart ()
X  "Force GNUS to read the raw startup file."
X  (interactive)
X  (gnus-save-newsrc-file)
X  (gnus-setup-news-info t)		;Force to read the raw startup file.
X  (gnus-Group-list-groups gnus-have-all-newsgroups))
X
X(defun gnus-Group-check-bogus-groups ()
X  "Check bogus newsgroups."
X  (interactive)
X  (gnus-check-bogus-newsgroups t)	;Require confirmation.
X  (gnus-Group-list-groups gnus-have-all-newsgroups))
X
X(defun gnus-Group-restrict-groups (start end)
X  "Restrict visible newsgroups to the current region (START and END).
XType \\[widen] to remove restriction."
X  (interactive "r")
X  (save-excursion
X    (narrow-to-region (progn
X			(goto-char start)
X			(beginning-of-line)
X			(point))
X		      (progn
X			(goto-char end)
X			(forward-line 1)
X			(point))))
X  (message (substitute-command-keys "Type \\[widen] to remove restriction")))
X
X(defun gnus-Group-post-news ()
X  "Post an article."
X  (interactive)
X  (if (get-buffer gnus-Subject-buffer)
X      (bury-buffer gnus-Subject-buffer))
X  (if (get-buffer gnus-Article-buffer)
X      (bury-buffer gnus-Article-buffer))
X  (gnus-post-news))
X
X(defun gnus-Group-edit-global-kill ()
X  "Edit a global KILL file."
X  (interactive)
X  (setq gnus-current-kill-article nil)	;No articles selected.
X  (gnus-Kill-file-edit-file nil) 	;Nil stands for global KILL file.
X  (message
X   (substitute-command-keys
X    "Editing a global KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
X
X(defun gnus-Group-edit-local-kill ()
X  "Edit a local KILL file."
X  (interactive)
X  (setq gnus-current-kill-article nil)	;No articles selected.
X  (gnus-Kill-file-edit-file (gnus-Group-group-name))
X  (message
X   (substitute-command-keys
X    "Editing a local KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
X
X(defun gnus-Group-force-update ()
X  "Update .newsrc file."
X  (interactive)
X  (gnus-save-newsrc-file))
X
X(defun gnus-Group-suspend ()
X  "Suspend the current GNUS session.
XIn fact, cleanup buffers except for Group Mode buffer.
XThe hook gnus-Suspend-gnus-hook is called before actually suspending."
X  (interactive)
X  (run-hooks 'gnus-Suspend-gnus-hook)
X  ;; Kill GNUS buffers except for Group Mode buffer.
X  (let ((buffers gnus-buffer-list))
X    (while buffers
X      (and (not (eq (car buffers) gnus-Group-buffer))
X	   (get-buffer (car buffers))
X	   (kill-buffer (car buffers)))
X      (setq buffers (cdr buffers))
X      ))
X  (bury-buffer))
X
X(defun gnus-Group-exit ()
X  "Quit reading news after updating .newsrc.
XThe hook gnus-Exit-gnus-hook is called before actually quitting."
X  (interactive)
X  (if (or (zerop (buffer-size))
X	  (not (gnus-server-opened))
X	  (y-or-n-p "Are you sure you want to quit reading news? "))
X      (progn
X	(message "")			;Erase "Yes or No" question.
X	(run-hooks 'gnus-Exit-gnus-hook)
X	(gnus-save-newsrc-file)
X	(gnus-clear-system)
X	(gnus-close-server))
X    ))
X
X(defun gnus-Group-quit ()
X  "Quit reading news without updating .newsrc.
XThe hook gnus-Exit-gnus-hook is called before actually quitting."
X  (interactive)
X  (if (or (zerop (buffer-size))
X	  (not (gnus-server-opened))
X	  (yes-or-no-p
X	   (format "Quit reading news without saving %s? "
X		   (file-name-nondirectory gnus-current-startup-file))))
X      (progn
X	(message "")			;Erase "Yes or No" question.
X	(run-hooks 'gnus-Exit-gnus-hook)
X	(gnus-clear-system)
X	(gnus-close-server))
X    ))
X
X(defun gnus-Group-describe-briefly ()
X  "Describe Group mode commands briefly."
X  (interactive)
X  (message
X   (concat
X    (substitute-command-keys "\\[gnus-Group-read-group]:Select  ")
X    (substitute-command-keys "\\[gnus-Group-next-unread-group]:Forward  ")
X    (substitute-command-keys "\\[gnus-Group-prev-unread-group]:Backward  ")
X    (substitute-command-keys "\\[gnus-Group-exit]:Exit  ")
X    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
X    (substitute-command-keys "\\[gnus-Group-describe-briefly]:This help")
X    )))
X
X
X;;;
X;;; GNUS Subject Mode
X;;;
X
X(if gnus-Subject-mode-map
X    nil
X  (setq gnus-Subject-mode-map (make-keymap))
X  (suppress-keymap gnus-Subject-mode-map)
X  (define-key gnus-Subject-mode-map " " 'gnus-Subject-next-page)
X  (define-key gnus-Subject-mode-map "\177" 'gnus-Subject-prev-page)
X  (define-key gnus-Subject-mode-map "\r" 'gnus-Subject-scroll-up)
X  (define-key gnus-Subject-mode-map "n" 'gnus-Subject-next-unread-article)
X  (define-key gnus-Subject-mode-map "p" 'gnus-Subject-prev-unread-article)
X  (define-key gnus-Subject-mode-map "N" 'gnus-Subject-next-article)
X  (define-key gnus-Subject-mode-map "P" 'gnus-Subject-prev-article)
X  (define-key gnus-Subject-mode-map "\e\C-n" 'gnus-Subject-next-same-subject)
X  (define-key gnus-Subject-mode-map "\e\C-p" 'gnus-Subject-prev-same-subject)
X  ;;(define-key gnus-Subject-mode-map "\e\C-n" 'gnus-Subject-next-unread-same-subject)
X  ;;(define-key gnus-Subject-mode-map "\e\C-p" 'gnus-Subject-prev-unread-same-subject)
X  (define-key gnus-Subject-mode-map "\C-c\C-n" 'gnus-Subject-next-digest)
X  (define-key gnus-Subject-mode-map "\C-c\C-p" 'gnus-Subject-prev-digest)
X  (define-key gnus-Subject-mode-map "\C-n" 'gnus-Subject-next-subject)
X  (define-key gnus-Subject-mode-map "\C-p" 'gnus-Subject-prev-subject)
X  (define-key gnus-Subject-mode-map "\en" 'gnus-Subject-next-unread-subject)
X  (define-key gnus-Subject-mode-map "\ep" 'gnus-Subject-prev-unread-subject)
X  ;;(define-key gnus-Subject-mode-map "\C-cn" 'gnus-Subject-next-group)
X  ;;(define-key gnus-Subject-mode-map "\C-cp" 'gnus-Subject-prev-group)
X  (define-key gnus-Subject-mode-map "." 'gnus-Subject-first-unread-article)
X  (define-key gnus-Subject-mode-map "/" 'isearch-forward)
X  (define-key gnus-Subject-mode-map "s" 'gnus-Subject-isearch-article)
X  (define-key gnus-Subject-mode-map "\es" 'gnus-Subject-search-article-forward)
X  (define-key gnus-Subject-mode-map "\eS" 'gnus-Subject-search-article-backward)
X  (define-key gnus-Subject-mode-map "<" 'gnus-Subject-beginning-of-article)
X  (define-key gnus-Subject-mode-map ">" 'gnus-Subject-end-of-article)
X  (define-key gnus-Subject-mode-map "j" 'gnus-Subject-goto-subject)
X  (define-key gnus-Subject-mode-map "J" 'gnus-Subject-goto-article)
X  (define-key gnus-Subject-mode-map "l" 'gnus-Subject-goto-last-article)
X  (define-key gnus-Subject-mode-map "^" 'gnus-Subject-refer-parent-article)
X  (define-key gnus-Subject-mode-map "\er" 'gnus-Subject-refer-article)
X  (define-key gnus-Subject-mode-map "u" 'gnus-Subject-mark-as-unread-forward)
X  (define-key gnus-Subject-mode-map "U" 'gnus-Subject-mark-as-unread-backward)
X  (define-key gnus-Subject-mode-map "d" 'gnus-Subject-mark-as-read-forward)
X  (define-key gnus-Subject-mode-map "D" 'gnus-Subject-mark-as-read-backward)
X  (define-key gnus-Subject-mode-map "\eu" 'gnus-Subject-clear-mark-forward)
X  (define-key gnus-Subject-mode-map "\eU" 'gnus-Subject-clear-mark-backward)
X  (define-key gnus-Subject-mode-map "k" 'gnus-Subject-kill-same-subject-and-select)
X  (define-key gnus-Subject-mode-map "\C-k" 'gnus-Subject-kill-same-subject)
X  (define-key gnus-Subject-mode-map "&" 'gnus-Subject-execute-command)
X  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up)
X  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-all)
X  (define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-and-exit)
X  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-all-and-exit)
X  (define-key gnus-Subject-mode-map "\C-t" 'gnus-Subject-toggle-truncation)
X  (define-key gnus-Subject-mode-map "x" 'gnus-Subject-delete-marked-as-read)
X  (define-key gnus-Subject-mode-map "X" 'gnus-Subject-delete-marked-with)
X  (define-key gnus-Subject-mode-map "\C-c\C-sn" 'gnus-Subject-sort-by-number)
X  (define-key gnus-Subject-mode-map "\C-c\C-sa" 'gnus-Subject-sort-by-author)
X  (define-key gnus-Subject-mode-map "\C-c\C-ss" 'gnus-Subject-sort-by-subject)
X  (define-key gnus-Subject-mode-map "\C-c\C-sd" 'gnus-Subject-sort-by-date)
X  (define-key gnus-Subject-mode-map "\C-c\C-s\C-n" 'gnus-Subject-sort-by-number)
X  (define-key gnus-Subject-mode-map "\C-c\C-s\C-a" 'gnus-Subject-sort-by-author)
X  (define-key gnus-Subject-mode-map "\C-c\C-s\C-s" 'gnus-Subject-sort-by-subject)
X  (define-key gnus-Subject-mode-map "\C-c\C-s\C-d" 'gnus-Subject-sort-by-date)
X  (define-key gnus-Subject-mode-map "=" 'gnus-Subject-expand-window)
X  (define-key gnus-Subject-mode-map "G" 'gnus-Subject-reselect-current-group)
X  (define-key gnus-Subject-mode-map "w" 'gnus-Subject-stop-page-breaking)
X  (define-key gnus-Subject-mode-map "\C-c\C-r" 'gnus-Subject-caesar-message)
X  (define-key gnus-Subject-mode-map "g" 'gnus-Subject-show-article)
X  (define-key gnus-Subject-mode-map "t" 'gnus-Subject-toggle-header)
X  (define-key gnus-Subject-mode-map "v" 'gnus-Subject-show-all-headers)
X  (define-key gnus-Subject-mode-map "\C-d" 'gnus-Subject-rmail-digest)
X  (define-key gnus-Subject-mode-map "a" 'gnus-Subject-post-news)
X  (define-key gnus-Subject-mode-map "f" 'gnus-Subject-post-reply)
X  (define-key gnus-Subject-mode-map "F" 'gnus-Subject-post-reply-with-original)
X  (define-key gnus-Subject-mode-map "C" 'gnus-Subject-cancel-article)
X  (define-key gnus-Subject-mode-map "r" 'gnus-Subject-mail-reply)
X  (define-key gnus-Subject-mode-map "R" 'gnus-Subject-mail-reply-with-original)
X  (define-key gnus-Subject-mode-map "m" 'gnus-Subject-mail-other-window)
X  (define-key gnus-Subject-mode-map "o" 'gnus-Subject-save-article)
X  (define-key gnus-Subject-mode-map "\C-o" 'gnus-Subject-save-in-mail)
X  (define-key gnus-Subject-mode-map "|" 'gnus-Subject-pipe-output)
X  (define-key gnus-Subject-mode-map "\ek" 'gnus-Subject-edit-local-kill)
X  (define-key gnus-Subject-mode-map "\eK" 'gnus-Subject-edit-global-kill)
X  (define-key gnus-Subject-mode-map "V" 'gnus-version)
X  (define-key gnus-Subject-mode-map "q" 'gnus-Subject-exit)
X  (define-key gnus-Subject-mode-map "Q" 'gnus-Subject-quit)
X  (define-key gnus-Subject-mode-map "?" 'gnus-Subject-describe-briefly)
X  (define-key gnus-Subject-mode-map "\C-c\C-i" 'gnus-Info-find-node))
X
X(defun gnus-Subject-mode ()
X  "Major mode for reading articles in this newsgroup.
XAll normal editing commands are turned off.
XInstead, these commands are available:
X
XSPC	Scroll to the next page of the current article.  The next unread
X	article is selected automatically at the end of the message.
XDEL	Scroll to the previous page of the current article.
XRET	Scroll up (or down) one line the current article.
Xn	Move to the next unread article.
Xp	Move to the previous unread article.
XN	Move to the next article.
XP	Move to the previous article.
XESC C-n	Move to the next article which has the same subject as the
X	current article.
XESC C-p	Move to the previous article which has the same subject as the
X	current article.
X\\[gnus-Subject-next-unread-same-subject]
X	Move to the next unread article which has the same subject as the
X	current article.
X\\[gnus-Subject-prev-unread-same-subject]
X	Move to the previous unread article which has the same subject as
X	the current article.
XC-c C-n	Scroll to the next digested message of the current article.
XC-c C-p	Scroll to the previous digested message of the current article.
XC-n	Move to the next subject.
XC-p	Move to the previous subject.
XESC n	Move to the next unread subject.
XESC p	Move to the previous unread subject.
X\\[gnus-Subject-next-group]
X	Exit the current newsgroup and select the next unread newsgroup.
X\\[gnus-Subject-prev-group]
X	Exit the current newsgroup and select the previous unread newsgroup.
X.	Jump to the first unread article in the current newsgroup.
X/	Do an incremental search forward on subjects.
Xs	Do an incremental search forward on the current article.
XESC s	Search for an article containing a regexp forward.
XESC S	Search for an article containing a regexp backward.
X<	Move point to the beginning of the current article.
X>	Move point to the end of the current article.
Xj	Jump to the article specified by the numeric article ID.
XJ	Jump to the article specified by the numeric article ID, then read it.
Xl	Jump to the article you read last.
X^	Refer to parent of the current article.
XESC r	Refer to the article specified by the Message-ID.
Xu	Mark the current article as unread, and go forward.
XU	Mark the current article as unread, and go backward.
Xd	Mark the current article as read, and go forward.
XD	Mark the current article as read, and go backward.
XESC u	Clear the current article's mark, and go forward.
XESC U	Clear the current article's mark, and go backward.
Xk	Mark articles which has the same subject as the current article as
X	read, and then select the next unread article.
XC-k	Mark articles which has the same subject as the current article as
X	read.
XESC k	Edit a local KILL file applied to the current newsgroup.
XESC K	Edit a global KILL file applied to all newsgroups.
X&	Execute a command for each article conditionally.
X\\[gnus-Subject-catch-up]
X	Mark all articles as read in the current newsgroup, preserving
X	articles marked as unread.
X\\[gnus-Subject-catch-up-all]
X	Mark all articles as read in the current newsgroup.
X\\[gnus-Subject-catch-up-and-exit]
X	Catch up all articles not marked as unread, and then exit the
X	current newsgroup.
X\\[gnus-Subject-catch-up-all-and-exit]
X	Catch up all articles, and then exit the current newsgroup.
XC-t	Toggle truncations of subject lines.
Xx	Delete subject lines marked as read.
XX	Delete subject lines with the specific marks.
XC-c C-s C-n	Sort subjects by article number.
XC-c C-s C-a	Sort subjects by article author.
XC-c C-s C-s	Sort subjects alphabetically.
XC-c C-s C-d	Sort subjects by date.
X=	Expand Subject window to show headers full window.
XG	Reselect the current newsgroup. Prefix argument means to select all.
Xw	Stop page breaking by linefeed.
XC-c C-r	Caesar rotates letters by 13/47 places.
Xg	Force to show the current article.
Xt	Show original article header if pruned header currently shown, or
X	vice versa.
Xv	Show original article header.
XC-d	Run RMAIL on the current digest article.
Xa	Post a new article.
Xf	Post a reply article.
XF	Post a reply article with original article.
XC	Cancel the current article.
Xr	Mail a message to the author.
XR	Mail a message to the author with original author.
Xm	Mail a message in other window.
Xo	Save the current article in your favorite format.
XC-o	Append the current article to a file in Unix mail format.
X|	Pipe the contents of the current article to a subprocess.
Xq	Quit reading news in the current newsgroup.
XQ	Quit reading news without recording unread articles information.
XV	Show the version number of this GNUS.
X?	Describe Subject Mode commands briefly.
XC-h m	Describe Subject Mode.
XC-c C-i	Read Info about Subject Mode.
X
XUser customizable variables:
X gnus-large-newsgroup
X    The number of articles which indicates a large newsgroup. If the
X    number of articles in a newsgroup is greater than the value, the
X    number of articles to be selected is asked for. If the given value
X    N is positive, the last N articles is selected. If N is negative,
X    the first N articles are selected. An empty string means to select
X    all articles.
X
X gnus-use-long-file-name
X    Non-nil means that a newsgroup name is used as a default file name
X    to save articles to. If it's nil, the directory form of a
X    newsgroup is used instead.
X
X gnus-default-article-saver
X    Specifies your favorite article saver which is interactively
X    funcallable. Following functions are available:
X
X	gnus-Subject-save-in-rmail (in Rmail format)
X	gnus-Subject-save-in-mail (in Unix mail format)
X	gnus-Subject-save-in-folder (in MH folder)
X	gnus-Subject-save-in-file (in article format).
X
X gnus-rmail-save-name
X gnus-mail-save-name
X gnus-folder-save-name
X gnus-file-save-name
X    Specifies a function generating a file name to save articles in
X    specified format.  The function is called with NEWSGROUP, HEADERS,
X    and optional LAST-FILE.  Access macros to the headers are defined
X    as nntp-header-FIELD, and functions are defined as
X    gnus-header-FIELD.
X
X gnus-article-save-directory
X    Specifies a directory name to save articles to using the commands
X    gnus-Subject-save-in-rmail, gnus-Subject-save-in-mail and
X    gnus-Subject-save-in-file. The variable is initialized from the
X    SAVEDIR environment variable.
X
X gnus-show-all-headers
X    Non-nil means that all headers of an article are shown.
X
X gnus-save-all-headers
X    Non-nil means that all headers of an article are saved in a file.
X
X gnus-optional-headers
X    Specifies a function which generates an optional string displayed
X    in the Subject buffer. The function is called with an article
X    HEADERS.  The result must be a string excluding `[' and `]'.  The
X    default function returns a string like NNN:AUTHOR, where NNN is
X    the number of lines in an article and AUTHOR is the name of the
X    author.
X
X gnus-auto-select-first
X    Non-nil means the first unread article is selected automagically
X    when a newsgroup is selected normally (by gnus-Group-read-group).
X    If you'd like to prevent automatic selection of the first unread
X    article in some newsgroups, set the variable to nil in
X    gnus-Select-group-hook or gnus-Apply-kill-hook.
X
X gnus-auto-select-next
X    Non-nil means the next newsgroup is selected automagically at the
X    end of the newsgroup. If the value is t and the next newsgroup is
X    empty (no unread articles), GNUS will exit Subject mode and go
X    back to Group mode. If the value is neither nil nor t, GNUS won't
X    exit Subject mode but select the following unread newsgroup.
X    Especially, if the value is the symbol `quietly', the next unread
X    newsgroup will be selected without any confirmations.
X
X gnus-auto-select-same
X    Non-nil means an article with the same subject as the current
X    article is selected automagically like `rn -S'.
X
X gnus-auto-center-subject
X    Non-nil means the point of Subject Mode window is always kept
X    centered.
X
X gnus-break-pages
X    Non-nil means an article is broken into pages at page delimiters.
X    This may not work with some versions of GNU Emacs earlier than
X    version 18.50.
X
X gnus-page-delimiter
X    Specifies a regexp describing line-beginnings that separate pages
X    of news article.
X
X gnus-more-message
X    Specifies a message shown at the end of pages in page break mode.
X    The length of the message string must be shorter than or equal to
X    that of the page delimiter if GNU Emacs is earlier than version
SHAR_EOF
echo "End of part 2, continue with part 3"
echo "3" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 3 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.el continued
#
CurArch=3
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.el
X    18.52.
X
X gnus-digest-show-summary
X    Non-nil means that a summary of digest messages is shown when
X    reading a digest article using `gnus-Subject-rmail-digest'
X    command.
X
X gnus-digest-separator
X    Specifies a regexp separating messages in a digest article.
X
XVarious hooks for customization:
X gnus-Subject-mode-hook
X    Entry to this mode calls the value with no arguments, if that
X    value is non-nil.
X
X gnus-Select-group-hook
X    Called with no arguments when newsgroup is selected, if that value
X    is non-nil. It is possible to sort subjects in this hook. See the
X    documentation of this variable for more information.
X
X gnus-Subject-prepare-hook
X    Called with no arguments after a subject list is created in the
X    Subject buffer, if that value is non-nil. If you'd like to modify
X    the buffer, you can use this hook.
X
X gnus-Select-article-hook
X    Called with no arguments when an article is selected, if that
X    value is non-nil. See the documentation of this variable for more
X    information.
X
X gnus-Select-digest-hook
X    Called with no arguments when reading digest messages using Rmail,
X    if that value is non-nil. This hook can be used to modify an
X    article so that Rmail can work with it. See the documentation of
X    the variable for more information.
X
X gnus-Rmail-digest-hook
X    Called with no arguments when reading digest messages using Rmail,
X    if that value is non-nil. This hook is intended to customize Rmail
X    mode.
X
X gnus-Apply-kill-hook
X    Called with no arguments when a newsgroup is selected and the
X    Subject buffer is prepared. This hook is intended to apply a KILL
X    file to the selected newsgroup. The format of KILL file is
X    completely different from that of version 3.8. You have to rewrite
X    them in the new format. See the documentation of Kill file mode
X    for more information.
X
X gnus-Mark-article-hook
X    Called with no arguments when an article is selected at the first
X    time. The hook is intended to mark an article as read (or unread)
X    automatically when it is selected.  See the documentation of the
X    variable for more information.
X
X gnus-Exit-group-hook
X    Called with no arguments when exiting the current newsgroup, if
X    that value is non-nil. If your machine is so slow that exiting
X    from Subject mode takes very long time, inhibit marking articles
X    as read using cross-references by setting the variable
X    gnus-newsgroup-headers to nil in this hook."
X  (interactive)
X  (kill-all-local-variables)
X  ;; Gee.  Why don't you upgrade?
X  (cond ((boundp 'mode-line-modified)
X	 (setq mode-line-modified "--- "))
X	((listp (default-value 'mode-line-format))
X	 (setq mode-line-format
X	       (cons "--- " (cdr (default-value 'mode-line-format))))))
X  (make-local-variable 'global-mode-string)
X  (setq global-mode-string nil)
X  (setq major-mode 'gnus-Subject-mode)
X  (setq mode-name "GNUS Subject")
X  ;;(setq mode-line-process '(" " gnus-newsgroup-name))
X  (gnus-Subject-set-mode-line)
X  (use-local-map gnus-Subject-mode-map)
X  (buffer-flush-undo (current-buffer))
X  (setq buffer-read-only t)		;Disable modification
X  (setq truncate-lines t)		;Stop line folding.
X  ;;(setq case-fold-search t)
X  (run-hooks 'gnus-Subject-mode-hook))
X
X(defun gnus-Subject-setup-buffer ()
X  "Initialize subject display buffer."
X  (if (get-buffer gnus-Subject-buffer)
X      (set-buffer gnus-Subject-buffer)
X    (set-buffer (get-buffer-create gnus-Subject-buffer))
X    (gnus-Subject-mode)
X    ))
X
X(defun gnus-Subject-read-group (group &optional show-all no-article)
X  "Start reading news in newsgroup GROUP.
XIf optional 1st argument SHOW-ALL is non-nil, already read articles are
Xalso listed.
XIf optional 2nd argument NO-ARTICLE is non-nil, no article is selected
Xinitially."
X  (message "Retrieving newsgroup: %s..." group)
X  (if (gnus-select-newsgroup group show-all)
X      (progn
X	;; Don't switch-to-buffer to prevent displaying old contents
X	;;  of the buffer until new subjects list is created.
X	;; Suggested by Juha Heinanen <jh@tut.fi>
X	(gnus-Subject-setup-buffer)
X	;; You can change the order of subjects in this hook.
X	(run-hooks 'gnus-Select-group-hook)
X	(gnus-Subject-prepare)
X	;; Function `gnus-apply-kill-file' must be called in this hook.
X	(run-hooks 'gnus-Apply-kill-hook)
X	(if (zerop (buffer-size))
X	    ;; This newsgroup is empty.
X	    (progn
X	      (gnus-Subject-catch-up-and-exit nil t) ;Without confirmations.
X	      (message "No unread news"))
X	  ;; Show first unread article if requested.
X	  (goto-char (point-min))
X	  (if (and (not no-article)
X		   gnus-auto-select-first
X		   (gnus-Subject-first-unread-article))
X	      ;; Window is configured automatically.
X	      ;; Current buffer may be changed as a result of hook
X	      ;; evaluation, especially by gnus-Subject-rmail-digest
X	      ;; command, so we should not adjust cursor point here.
X	      nil
X	    (gnus-configure-windows 'SelectNewsgroup)
X	    (pop-to-buffer gnus-Subject-buffer)
X	    (gnus-Subject-set-mode-line)
X	    ;; I sometime get confused with the old Article buffer.
X	    (if (get-buffer gnus-Article-buffer)
X		(if (get-buffer-window gnus-Article-buffer)
X		    (save-excursion
X		      (set-buffer gnus-Article-buffer)
X		      (let ((buffer-read-only nil))
X			(erase-buffer)))
X		  (kill-buffer gnus-Article-buffer)))
X	    ;; Adjust cursor point.
X	    (beginning-of-line)
X	    (search-forward ":" nil t))
X	  ))
X    ;; Cannot select newsgroup GROUP.
X    (ding) (message "No such newsgroup: %s" group)
X    (sit-for 0)
X    ;; Run checking bogus newsgroups.
X    (gnus-check-bogus-newsgroups t)	;Confirm
X    ))
X
X(defun gnus-Subject-prepare ()
X  "Prepare subject list of current newsgroup in Subject mode buffer."
X  (let* ((buffer-read-only nil)
X	 (number 0)
X	 (headers gnus-newsgroup-headers)
X	 (header nil)
X	 ;; This defines format of Subject mode buffer.
X	 (cntl
X	  (format "%%s %%%dd: [%%s] %%s\n"
X		  (length (prin1-to-string gnus-newsgroup-end)))))
X    ;; Note: The next codes are not actually used because the user who
X    ;; want it can define them in gnus-Select-group-hook.
X    ;; Print verbose messages if too many articles are selected.
X    ;;    (and (numberp gnus-large-newsgroup)
X    ;;       (> (length gnus-newsgroup-headers) gnus-large-newsgroup)
X    ;;       (message "Preparing headers..."))
X    (erase-buffer)
X    (while headers
X      (setq header (car headers))
X      (if (vectorp header)		;Depends on nntp.el.
X	  (progn
X	    (setq number (nntp-header-number header))
X	    (insert
X	     (format cntl
X		     ;; Read or not.
X		     (cond ((memq number gnus-newsgroup-marked)  "-")
X			   ((memq number gnus-newsgroup-unreads) " ")
X			   (t "D"))
X		     ;; Article number.
X		     number
X		     ;; Optional headers.
X		     (or (and gnus-optional-headers
X			      (funcall gnus-optional-headers header)) "")
X		     ;; Its subject string.
X		     (nntp-header-subject header)))
X	    ))
X      (setq headers (cdr headers))
X      )
X    ;; Erase header retrieval message.
X    (message "")
X    ;; Call hooks for modifying Subject mode buffer.
X    ;; Suggested by sven@tde.LTH.Se (Sven Mattisson).
X    (goto-char (point-min))
X    (run-hooks 'gnus-Subject-prepare-hook)
X    ))
X
X(defun gnus-Subject-set-mode-line ()
X  "Set Subject mode line string."
X  (setq mode-line-buffer-identification
X	(list 17
X	      (concat "GNUS: "
X		      (if gnus-current-headers
X			  (nntp-header-subject gnus-current-headers)
X			gnus-newsgroup-name))))
X  (set-buffer-modified-p t))
X
X;; GNUS Subject mode command.
X
X(defun gnus-Subject-search-group (&optional backward)
X  "Search for next unread newsgroup.
XIf optional argument BACKWARD is non-nil, search backward instead."
X  (save-excursion
X    (set-buffer gnus-Group-buffer)
X    (save-excursion
X      ;; We don't want to alter current point of Group mode buffer.
X      (if (gnus-Group-search-forward backward nil)
X	  (gnus-Group-group-name))
X      )))
X
X(defun gnus-Subject-search-subject (backward unread subject)
X  "Search for article forward.
XIf 1st argument BACKWARD is non-nil, search backward.
XIf 2nd argument UNREAD is non-nil, only unread article is selected.
XIf 3rd argument SUBJECT is non-nil, the article which has
Xthe same subject will be searched for."
X  (let ((func (if backward 're-search-backward 're-search-forward))
X	(article nil)
X	(regexp 
X	 (format "^%s[ \t]+\\([0-9]+\\):.\\[.*\\][ \t]+%s"
X		 ;;(if unread " " ".")
X		 (cond ((eq unread t) " ") (unread "[ ---]") (t "."))
X		 (if subject
X		     (concat "\\([Rr][Ee]:[ \t]+\\)*"
X			     (regexp-quote (gnus-simplify-subject subject))
X			     ;; Ignore words in parentheses.
X			     "\\([ \t]*(.*)\\)*[ \t]*$")
X		   "")
X		 )))
X    (if backward
X	(beginning-of-line)
X      (end-of-line))
X    (if (funcall func regexp nil t)
X	(setq article
X	      (string-to-int
X	       (buffer-substring (match-beginning 1) (match-end 1)))))
X    ;; Adjust cursor point.
X    (beginning-of-line)
X    (search-forward ":" nil t)
X    ;; This is the result.
X    article
X    ))
X
X(defun gnus-Subject-search-forward (&optional unread subject)
X  "Search for article forward.
XIf 1st optional argument UNREAD is non-nil, only unread article is selected.
XIf 2nd optional argument SUBJECT is non-nil, the article which has
Xthe same subject will be searched for."
X  (gnus-Subject-search-subject nil unread subject))
X
X(defun gnus-Subject-search-backward (&optional unread subject)
X  "Search for article backward.
XIf 1st optional argument UNREAD is non-nil, only unread article is selected.
XIf 2nd optional argument SUBJECT is non-nil, the article which has
Xthe same subject will be searched for."
X  (gnus-Subject-search-subject t unread subject))
X
X(defun gnus-Subject-article-number ()
X  "Article number around point. If nothing, return current number."
X  (save-excursion
X    (beginning-of-line)
X    (if (looking-at ".[ \t]+\\([0-9]+\\):")
X	(string-to-int
X	 (buffer-substring (match-beginning 1) (match-end 1)))
X      ;; If search fail, return current article number.
X      gnus-current-article
X      )))
X
X(defun gnus-Subject-subject-string ()
X  "Return current subject string or nil if nothing."
X  (save-excursion
X    ;; It is possible to implement this function using
X    ;;  `gnus-Subject-article-number' and `gnus-newsgroup-headers'.
X    (beginning-of-line)
X    (if (looking-at ".[ \t]+[0-9]+:.\\[.*\\][ \t]+\\(.*\\)$")
X	(buffer-substring (match-beginning 1) (match-end 1)))
X    ))
X
X(defun gnus-Subject-goto-subject (article)
X  "Move point to ARTICLE's subject."
X  (interactive
X   (list
X    (string-to-int
X     (completing-read "Article number: "
X		      (mapcar
X		       (function
X			(lambda (headers)
X			  (list
X			   (int-to-string (nntp-header-number headers)))))
X		       gnus-newsgroup-headers)
X		      nil 'require-match))))
X  (let ((current (point)))
X    (goto-char (point-min))
X    (or (and article (re-search-forward (format "^.[ \t]+%d:" article) nil t))
X	(progn (goto-char current) nil))
X    ))
X
X(defun gnus-Subject-recenter ()
X  "Center point in Subject mode window."
X  ;; Scroll window so as to cursor comes center of Subject mode window
X  ;;  only when article is displayed.
X  ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
X  ;; Recenter only when requested.
X  ;; Subbested by popovich@park.cs.columbia.edu
X  (and gnus-auto-center-subject
X       (get-buffer-window gnus-Article-buffer)
X       (< (/ (- (window-height) 1) 2)
X	  (count-lines (point) (point-max)))
X       (recenter (/ (- (window-height) 2) 2))))
X
X;; Walking around Group mode buffer.
X
X(defun gnus-Subject-next-group (no-article)
X  "Exit current newsgroup and then select next unread newsgroup.
XIf prefix argument NO-ARTICLE is non-nil, no article is selected initially."
X  (interactive "P")
X  (let ((group (gnus-Subject-search-group)))
X    (if (null group)
X	(progn
X	  (message "Exiting %s..." gnus-newsgroup-name)  
X	  (gnus-Subject-exit)
X	  (message ""))
X      (message "Selecting %s..." group)
X      (gnus-Subject-exit t)		;Exit Subject mode temporary.
X      ;; Now current point of Group mode buffer is pointing GROUP.
X      (gnus-Subject-read-group group nil no-article)
X      (or (eq (current-buffer)
X	      (get-buffer gnus-Subject-buffer))
X	  (eq gnus-auto-select-next t)
X	  ;; Expected newsgroup has nothing to read since the articles
X	  ;; are marked as read by cross-referencing. So, try next
X	  ;; newsgroup. (Make sure we are in Group mode buffer now.)
X	  (and (eq (current-buffer)
X		   (get-buffer gnus-Group-buffer))
X	       (gnus-Group-group-name)
X	       (gnus-Subject-read-group
X		(gnus-Group-group-name) nil no-article))
X	  )
X      )))
X
X(defun gnus-Subject-prev-group (no-article)
X  "Exit current newsgroup and then select previous unread newsgroup.
XIf prefix argument NO-ARTICLE is non-nil, no article is selected initially."
X  (interactive "P")
X  (let ((group (gnus-Subject-search-group t)))
X    (if (null group)
X	(progn
X	  (message "Exiting %s..." gnus-newsgroup-name)  
X	  (gnus-Subject-exit)
X	  (message ""))
X      (message "Selecting %s..." group)
X      (gnus-Subject-exit t)		;Exit Subject mode temporary.
X      ;; We have to adjust point of Group mode buffer because current
X      ;; point is moved to next unread newsgroup by exiting.
X      (gnus-Group-jump-to-group group)
X      (gnus-Subject-read-group group nil no-article)
X      (or (eq (current-buffer)
X	      (get-buffer gnus-Subject-buffer))
X	  (eq gnus-auto-select-next t)
X	  ;; Expected newsgroup has nothing to read since the articles
X	  ;; are marked as read by cross-referencing. So, try next
X	  ;; newsgroup. (Make sure we are in Group mode buffer now.)
X	  (and (eq (current-buffer)
X		   (get-buffer gnus-Group-buffer))
X	       (gnus-Subject-search-group t)
X	       (gnus-Subject-read-group
X		(gnus-Subject-search-group t) nil no-article))
X	  )
X      )))
X
X;; Walking around subject lines.
X
X(defun gnus-Subject-next-subject (n &optional unread)
X  "Go to next N'th subject line.
XIf optional argument UNREAD is non-nil, only unread article is selected."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Subject-search-forward unread))
X    (setq n (1- n)))
X  (cond ((gnus-Subject-search-forward unread)
X	 (gnus-Subject-recenter))
X	(unread
X	 (message "No more unread articles"))
X	(t
X	 (message "No more articles"))
X	))
X
X(defun gnus-Subject-next-unread-subject (n)
X  "Go to next N'th unread subject line."
X  (interactive "p")
X  (gnus-Subject-next-subject n t))
X
X(defun gnus-Subject-prev-subject (n &optional unread)
X  "Go to previous N'th subject line.
XIf optional argument UNREAD is non-nil, only unread article is selected."
X  (interactive "p")
X  (while (and (> n 1)
X	      (gnus-Subject-search-backward unread))
X    (setq n (1- n)))
X  (cond ((gnus-Subject-search-backward unread)
X	 (gnus-Subject-recenter))
X	(unread
X	 (message "No more unread articles"))
X	(t
X	 (message "No more articles"))
X	))
X
X(defun gnus-Subject-prev-unread-subject (n)
X  "Go to previous N'th unread subject line."
X  (interactive "p")
X  (gnus-Subject-prev-subject n t))
X
X;; Walking around subject lines with displaying articles.
X
X(defun gnus-Subject-expand-window ()
X  "Expand Subject window to show headers full window."
X  (interactive)
X  (gnus-configure-windows 'ExpandSubject)
X  (pop-to-buffer gnus-Subject-buffer))
X
X(defun gnus-Subject-display-article (article &optional all-header)
X  "Display ARTICLE in Article buffer."
X  (if (null article)
X      nil
X    (gnus-configure-windows 'SelectArticle)
X    (pop-to-buffer gnus-Subject-buffer)
X    (gnus-Article-prepare article all-header)
X    (gnus-Subject-recenter)
X    (gnus-Subject-set-mode-line)
X    (run-hooks 'gnus-Select-article-hook)
X    ;; Successfully display article.
X    t
X    ))
X
X(defun gnus-Subject-select-article (&optional all-headers force)
X  "Select the current article.
XOptional argument ALL-HEADERS is non-nil, show all headers."
X  (let ((article (gnus-Subject-article-number)))
X    (if (or (null gnus-current-article)
X	    (/= article gnus-current-article)
X	    (and force (not (eq all-headers gnus-have-all-headers))))
X	;; The selected subject is different from that of the current article.
X	(gnus-Subject-display-article article all-headers)
X      (gnus-configure-windows 'SelectArticle)
X      (pop-to-buffer gnus-Subject-buffer))
X    ))
X
X(defun gnus-Subject-set-current-mark (&optional current-mark)
X  "Put `+' at the current article.
XOptional argument specifies CURRENT-MARK instead of `+'."
X  (save-excursion
X    (set-buffer gnus-Subject-buffer)
X    (let ((buffer-read-only nil))
X      (goto-char (point-min))
X      ;; First of all clear mark at last article.
X      (if (re-search-forward "^.[ \t]+[0-9]+:[^ \t]" nil t)
X	  (progn
X	    (delete-char -1)
X	    (insert " ")
X	    (goto-char (point-min))))
X      (if (re-search-forward (format "^.[ \t]+%d:" gnus-current-article) nil t)
X	  (progn
X	    (delete-char 1)
X	    (insert (or current-mark "+"))))
X      )))
X
X;;(defun gnus-Subject-next-article (unread &optional subject)
X;;  "Select article after current one.
X;;If argument UNREAD is non-nil, only unread article is selected."
X;;  (interactive "P")
X;;  (cond ((gnus-Subject-display-article
X;;	  (gnus-Subject-search-forward unread subject)))
X;;	(unread
X;;	 (message "No more unread articles"))
X;;	(t
X;;	 (message "No more articles"))
X;;	))
X
X(defun gnus-Subject-next-article (unread &optional subject)
X  "Select article after current one.
XIf argument UNREAD is non-nil, only unread article is selected."
X  (interactive "P")
X  (cond ((gnus-Subject-display-article
X	  (gnus-Subject-search-forward unread subject)))
X	((and subject
X	      gnus-auto-select-same
X	      (gnus-set-difference gnus-newsgroup-unreads
X				   gnus-newsgroup-marked)
X	      (memq this-command
X		    '(gnus-Subject-next-unread-article
X		      gnus-Subject-next-page
X		      gnus-Subject-kill-same-subject-and-select
X		      ;;gnus-Subject-next-article
X		      ;;gnus-Subject-next-same-subject
X		      ;;gnus-Subject-next-unread-same-subject
X		      )))
X	 ;; Wrap article pointer if there are unread articles.
X	 ;; Hook function, such as gnus-Subject-rmail-digest, may
X	 ;; change current buffer, so need check.
X	 (let ((buffer (current-buffer))
X	       (last-point (point)))
X	   ;; No more articles with same subject, so jump to the first
X	   ;; unread article.
X	   (gnus-Subject-first-unread-article)
X	   ;;(and (eq buffer (current-buffer))
X	   ;;	(= (point) last-point)
X	   ;;	;; Ignore given SUBJECT, and try again.
X	   ;;	(gnus-Subject-next-article unread nil))
X	   (and (eq buffer (current-buffer))
X		(< (point) last-point)
X		(message "Wrapped"))
X	   ))
X	(t
X	 ;; Select next newsgroup automatically if requested.
X	 (let ((cmd (string-to-char (this-command-keys)))
X	       (group (gnus-Subject-search-group))
X	       (auto-select
X		(and gnus-auto-select-next
X		     ;;(null (gnus-set-difference gnus-newsgroup-unreads
X		     ;;				gnus-newsgroup-marked))
X		     (memq this-command
X			   '(gnus-Subject-next-unread-article
X			     gnus-Subject-next-article
X			     gnus-Subject-next-page
X			     gnus-Subject-next-same-subject
X			     gnus-Subject-next-unread-same-subject
X			     gnus-Subject-kill-same-subject
X			     gnus-Subject-kill-same-subject-and-select
X			     ))
X		     ;; Ignore characters typed ahead.
X		     (not (input-pending-p))
X		     )))
X	   (message "No more%s articles%s"
X		    (if unread " unread" "")
X		    (if (and auto-select
X			     (not (eq gnus-auto-select-next 'quietly)))
X			(if group
X			    (format " (Type %s to %s [%d])"
X				    (key-description (char-to-string cmd))
X				    group
X				    (nth 1 (gnus-gethash group
X							 gnus-unread-hashtb)))
X			  (format " (Type %s to exit %s)"
X				  (key-description (char-to-string cmd))
X				  gnus-newsgroup-name
X				  ))
X		      ""))
X	   ;; Select next unread newsgroup automagically.
X	   (cond ((and auto-select
X		       (eq gnus-auto-select-next 'quietly))
X		  ;; Select quietly.
X		  (gnus-Subject-next-group nil))
X		 (auto-select
X		  ;; Confirm auto selection.
X		  (let ((char (read-char)))
X		    (if (= char cmd)
X			(gnus-Subject-next-group nil)
X		      (setq unread-command-char char))))
X		 )
X	   ))
X	))
X
X(defun gnus-Subject-next-unread-article ()
X  "Select unread article after current one."
X  (interactive)
X  (gnus-Subject-next-article t (and gnus-auto-select-same
X				    (gnus-Subject-subject-string))))
X
X(defun gnus-Subject-prev-article (unread &optional subject)
X  "Select article before current one.
XIf argument UNREAD is non-nil, only unread article is selected."
X  (interactive "P")
X  (cond ((gnus-Subject-display-article
X	  (gnus-Subject-search-backward unread subject)))
X	((and subject
X	      gnus-auto-select-same
X	      (gnus-set-difference gnus-newsgroup-unreads
X				   gnus-newsgroup-marked)
X	      (memq this-command
X		    '(gnus-Subject-prev-unread-article
X		      ;;gnus-Subject-prev-page
X		      ;;gnus-Subject-prev-article
X		      ;;gnus-Subject-prev-same-subject
X		      ;;gnus-Subject-prev-unread-same-subject
X		      )))
X	 ;; Ignore given SUBJECT, and try again.
X	 (gnus-Subject-prev-article unread nil))
X	(unread
X	 (message "No more unread articles"))
X	(t
X	 (message "No more articles"))
X	))
X
X(defun gnus-Subject-prev-unread-article ()
X  "Select unred article before current one."
X  (interactive)
X  (gnus-Subject-prev-article t (and gnus-auto-select-same
X				    (gnus-Subject-subject-string))))
X
X(defun gnus-Subject-next-page (lines)
X  "Show next page of selected article.
XIf end of artile, select next article.
XArgument LINES specifies lines to be scrolled up."
X  (interactive "P")
X  (let ((article (gnus-Subject-article-number))
X	(endp nil))
X    (if (or (null gnus-current-article)
X	    (/= article gnus-current-article))
X	;; Selected subject is different from current article's.
X	(gnus-Subject-display-article article)
X      (gnus-configure-windows 'SelectArticle)
X      (pop-to-buffer gnus-Subject-buffer)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	(setq endp (gnus-Article-next-page lines)))
X      (cond ((and endp lines)
X	     (message "End of message"))
X	    ((and endp (null lines))
X	     (gnus-Subject-next-unread-article)))
X      )))
X
X(defun gnus-Subject-prev-page (lines)
X  "Show previous page of selected article.
XArgument LINES specifies lines to be scrolled down."
X  (interactive "P")
X  (let ((article (gnus-Subject-article-number)))
X    (if (or (null gnus-current-article)
X	    (/= article gnus-current-article))
X	;; Selected subject is different from current article's.
X	(gnus-Subject-display-article article)
X      (gnus-configure-windows 'SelectArticle)
X      (pop-to-buffer gnus-Subject-buffer)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	(gnus-Article-prev-page lines))
X      )))
X
X(defun gnus-Subject-scroll-up (lines)
X  "Scroll up (or down) one line current article.
XArgument LINES specifies lines to be scrolled up (or down if negative)."
X  (interactive "p")
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (cond ((> lines 0)
X	   (if (gnus-Article-next-page lines)
X	       (message "End of message")))
X	  ((< lines 0)
X	   (gnus-Article-prev-page (- 0 lines))))
X    ))
X
X(defun gnus-Subject-next-same-subject ()
X  "Select next article which has the same subject as current one."
X  (interactive)
X  (gnus-Subject-next-article nil (gnus-Subject-subject-string)))
X
X(defun gnus-Subject-prev-same-subject ()
X  "Select previous article which has the same subject as current one."
X  (interactive)
X  (gnus-Subject-prev-article nil (gnus-Subject-subject-string)))
X
X(defun gnus-Subject-next-unread-same-subject ()
X  "Select next unread article which has the same subject as current one."
X  (interactive)
X  (gnus-Subject-next-article t (gnus-Subject-subject-string)))
X
X(defun gnus-Subject-prev-unread-same-subject ()
X  "Select previous unread article which has the same subject as current one."
X  (interactive)
X  (gnus-Subject-prev-article t (gnus-Subject-subject-string)))
X
X(defun gnus-Subject-refer-parent-article (child)
X  "Refer parent article of current article.
XIf a prefix argument CHILD is non-nil, go back to the child article
Xusing internally maintained articles history.
XNOTE: This command may not work with nnspool.el."
X  (interactive "P")
X  (gnus-Subject-select-article t t)	;Request all headers.
X  (let ((referenced-id nil))		;Message-id of parent or child article.
X    (if child
X	;; Go back to child article using history.
X	(gnus-Subject-refer-article nil)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	;; Look for parent Message-ID.
X	(let ((references (gnus-fetch-field "References")))
X	  ;; Get the last message-id in the references.
X	  (and references
X	       (string-match "\\(<[^<>]+>\\)[ \t]*\\'" references)
X	       (setq referenced-id
X		     (substring references
X				(match-beginning 1) (match-end 1))))
X	  ))
X      (if (stringp referenced-id)
X	  (gnus-Subject-refer-article referenced-id)
X	(error "No more parents"))
X      )))
X
X(defun gnus-Subject-refer-article (message-id)
X  "Refer article specified by MESSAGE-ID.
XIf the MESSAGE-ID is nil or an empty string, Message-ID is poped from
Xinternally maintained articles history.
XNOTE: This command may not work with nnspool.el."
X  (interactive "sMessage-ID: ")
X  ;; Make sure that this command depends on the fact that article
X  ;; related information is not updated when an article is retrieved
X  ;; by Message-ID.
X  (gnus-Subject-select-article t t)	;Request all headers.
X  (if (and (stringp message-id)
X	   (> (length message-id) 0))
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	;; Construct the correct Message-ID if necessary.
X	;; Suggested by tale@pawl.rpi.edu.
X	(or (string-match "^<" message-id)
X	    (setq message-id (concat "<" message-id)))
X	(or (string-match ">$" message-id)
X	    (setq message-id (concat message-id ">")))
X	;; Push current message-id on history.
X	;; We cannot use gnus-current-headers to get current
X	;; message-id because we may be looking at parent or refered
X	;; article.
X	(let ((current (gnus-fetch-field "Message-ID")))
X	  (or (equal current message-id) ;Nothing to do.
X	      (equal current (car gnus-current-history))
X	      (setq gnus-current-history
X		    (cons current gnus-current-history)))
X	  ))
X    ;; Pop message-id from history.
X    (setq message-id (car gnus-current-history))
X    (setq gnus-current-history (cdr gnus-current-history)))
X  (if (stringp message-id)
X      ;; Retrieve article by message-id. This may not work with nnspool.
X      (gnus-Article-prepare message-id t)
X    (error "No such references"))
X  )
X
X(defun gnus-Subject-next-digest (nth)
X  "Move to head of NTH next digested message."
X  (interactive "p")
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (gnus-Article-next-digest (or nth 1))
X    ))
X
X(defun gnus-Subject-prev-digest (nth)
X  "Move to head of NTH previous digested message."
X  (interactive "p")
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (gnus-Article-prev-digest (or nth 1))
X    ))
X
X(defun gnus-Subject-first-unread-article ()
X  "Select first unread article. Return non-nil if successfully selected."
X  (interactive)
X  (let ((begin (point)))
X    (goto-char (point-min))
X    (if (re-search-forward "^ [ \t]+[0-9]+:" nil t)
X	(gnus-Subject-display-article (gnus-Subject-article-number))
X      ;; If there is no unread articles, stay there.
X      (goto-char begin)
X      ;;(gnus-Subject-display-article (gnus-Subject-article-number))
X      (message "No more unread articles")
X      nil
X      )
X    ))
X
X(defun gnus-Subject-isearch-article ()
X  "Do incremental search forward on current article."
X  (interactive)
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (call-interactively 'isearch-forward)
X    ))
X
X(defun gnus-Subject-search-article-forward (regexp)
X  "Search for an article containing REGEXP forward.
Xgnus-Select-article-hook is not called during the search."
X  (interactive
X   (list (read-string
X	  (concat "Search forward (regexp): "
X		  (if gnus-last-search-regexp
X		      (concat "(default " gnus-last-search-regexp ") "))))))
X  (if (string-equal regexp "")
X      (setq regexp (or gnus-last-search-regexp ""))
X    (setq gnus-last-search-regexp regexp))
X  (if (gnus-Subject-search-article regexp nil)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	(recenter 0)
X	;;(sit-for 1)
X	)
X    (error "Search failed: \"%s\"" regexp)
X    ))
X
X(defun gnus-Subject-search-article-backward (regexp)
X  "Search for an article containing REGEXP backward.
Xgnus-Select-article-hook is not called during the search."
X  (interactive
X   (list (read-string
X	  (concat "Search backward (regexp): "
X		  (if gnus-last-search-regexp
X		      (concat "(default " gnus-last-search-regexp ") "))))))
X  (if (string-equal regexp "")
X      (setq regexp (or gnus-last-search-regexp ""))
X    (setq gnus-last-search-regexp regexp))
X  (if (gnus-Subject-search-article regexp t)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	(recenter 0)
X	;;(sit-for 1)
X	)
X    (error "Search failed: \"%s\"" regexp)
X    ))
X
X(defun gnus-Subject-search-article (regexp &optional backward)
X  "Search for an article containing REGEXP.
XOptional argument BACKWARD means do search for backward.
Xgnus-Select-article-hook is not called during the search."
X  (let ((gnus-Select-article-hook nil)	;Disable hook.
X	(gnus-Mark-article-hook nil)	;Inhibit marking as read.
X	(re-search
X	 (if backward
X	     (function re-search-backward) (function re-search-forward)))
X	(found nil)
X	(last nil))
X    ;; First of all, search current article.
X    ;; We don't want to read article again from NNTP server nor reset
X    ;; current point.
X    (gnus-Subject-select-article)
X    (message "Searching article: %d..." gnus-current-article)
X    (setq last gnus-current-article)
X    (gnus-eval-in-buffer-window gnus-Article-buffer
X      (save-restriction
X	(widen)
X	;; Begin search from current point.
X	(setq found (funcall re-search regexp nil t))))
X    ;; Then search next articles.
X    (while (and (not found)
X		(gnus-Subject-display-article 
X		 (gnus-Subject-search-subject backward nil nil)))
X      (message "Searching article: %d..." gnus-current-article)
X      (gnus-eval-in-buffer-window gnus-Article-buffer
X	(save-restriction
X	  (widen)
X	  (goto-char (if backward (point-max) (point-min)))
X	  (setq found (funcall re-search regexp nil t)))
X	))
X    (message "")
X    ;; Adjust article pointer.
X    (or (eq last gnus-current-article)
X	(setq gnus-last-article last))
X    ;; Return T if found such article.
X    found
X    ))
X
X(defun gnus-Subject-execute-command (field regexp command &optional backward)
X  "If FIELD of article header matches REGEXP, execute COMMAND string.
XIf FIELD is an empty string (or nil), entire article body is searched for.
XIf optional (prefix) argument BACKWARD is non-nil, do backward instead."
X  (interactive
X   (list (let ((completion-ignore-case t))
X	   (completing-read "Field name: "
X			    '(("Number")("Subject")("From")
X			      ("Xref")("Lines")("Date")("Id"))
X			    nil 'require-match))
X	 (read-string "Regexp: ")
X	 (read-key-sequence "Command: ")
X	 current-prefix-arg))
X  ;; We don't want to change current point nor window configuration.
X  (save-excursion
X    (save-window-excursion
X      (message "Executing %s..." (key-description command))
X      ;; We'd like to execute COMMAND interactively so as to give arguments.
X      (gnus-execute field regexp
X		    (` (lambda ()
X			 (call-interactively '(, (key-binding command)))))
X		    backward)
X      (message "Executing %s... done" (key-description command)))))
X
X(defun gnus-Subject-beginning-of-article ()
X  "Go to beginning of article body"
X  (interactive)
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (widen)
X    (beginning-of-buffer)
X    (if gnus-break-pages
X	(gnus-narrow-to-page))
X    ))
X
X(defun gnus-Subject-end-of-article ()
X  "Go to end of article body"
X  (interactive)
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (widen)
X    (end-of-buffer)
X    (if gnus-break-pages
X	(gnus-narrow-to-page))
X    ))
X
X(defun gnus-Subject-goto-article (article &optional all-headers)
X  "Read ARTICLE if exists.
XOptional argument ALL-HEADERS means all headers are shown."
X  (interactive
X   (list
X    (string-to-int
X     (completing-read "Article number: "
X		      (mapcar
X		       (function
X			(lambda (headers)
X			  (list
X			   (int-to-string (nntp-header-number headers)))))
X		       gnus-newsgroup-headers)
X		      nil 'require-match))))
X  (if (gnus-Subject-goto-subject article)
X      (gnus-Subject-display-article article all-headers)))
X
X(defun gnus-Subject-goto-last-article ()
X  "Go to last subject line."
X  (interactive)
X  (if gnus-last-article
X      (gnus-Subject-goto-article gnus-last-article)))
X
X(defun gnus-Subject-show-article ()
X  "Force to show current article."
X  (interactive)
X  ;; The following is a trick to force to read the current article again.
X  (setq gnus-have-all-headers (not gnus-have-all-headers))
X  (gnus-Subject-select-article (not gnus-have-all-headers) t))
X
X(defun gnus-Subject-toggle-header (arg)
X  "Show original header if pruned header currently shown, or vice versa.
XWith arg, show original header iff arg is positive."
X  (interactive "P")
X  ;; Variable gnus-show-all-headers must be NIL to toggle really.
X  (let ((gnus-show-all-headers nil)
X	(all-headers
X	 (if (null arg) (not gnus-have-all-headers)
X	   (> (prefix-numeric-value arg) 0))))
X    (gnus-Subject-select-article all-headers t)))
X
X(defun gnus-Subject-show-all-headers ()
X  "Show original article header."
X  (interactive)
X  (gnus-Subject-select-article t t))
X
X(defun gnus-Subject-stop-page-breaking ()
X  "Stop page breaking by linefeed temporary (Widen article buffer)."
X  (interactive)
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (set-marker overlay-arrow-position nil)
X    (widen)
X    ))
X
X(defun gnus-Subject-kill-same-subject-and-select (unmark)
X  "Mark articles which has the same subject as read, and then select next.
XIf argument UNMARK is positive, remove any kinds of marks.
XIf argument UNMARK is negative, mark articles as unread instead."
X  (interactive "P")
X  (if unmark
X      (setq unmark (prefix-numeric-value unmark)))
X  (let ((count
X	 (gnus-Subject-mark-same-subject
X	  (gnus-Subject-subject-string) unmark)))
X    ;; Select next unread article. If auto-select-same mode, should
X    ;; select the first unread article.
X    (gnus-Subject-next-article t (and gnus-auto-select-same
X				      (gnus-Subject-subject-string)))
X    (message "%d articles are marked as %s"
X	     count (if unmark "unread" "read"))
X    ))
X
X(defun gnus-Subject-kill-same-subject (unmark)
X  "Mark articles which has the same subject as read. 
XIf argument UNMARK is positive, remove any kinds of marks.
XIf argument UNMARK is negative, mark articles as unread instead."
X  (interactive "P")
X  (if unmark
X      (setq unmark (prefix-numeric-value unmark)))
X  (let ((count
X	 (gnus-Subject-mark-same-subject
X	  (gnus-Subject-subject-string) unmark)))
X    (gnus-Subject-next-subject 1 (not unmark))
X    (message "%d articles are marked as %s"
X	     count (if unmark "unread" "read"))
X    ))
X
X(defun gnus-Subject-mark-same-subject (subject &optional unmark)
X  "Mark articles with same SUBJECT as read, and return marked number.
XIf optional argument UNMARK is positive, remove any kinds of marks.
XIf optional argument UNMARK is negative, mark articles as unread instead."
X  (save-excursion
X    (let ((count 1))
X      (cond ((null unmark)
X	     (gnus-Subject-mark-as-read nil "K"))
X	    ((> unmark 0)
X	     (gnus-Subject-mark-as-unread nil t))
X	    (t
X	     (gnus-Subject-mark-as-unread)))
X      (while (and subject
X		  (gnus-Subject-search-forward nil subject))
X	(cond ((null unmark)
X	       (gnus-Subject-mark-as-read nil "K"))
X	      ((> unmark 0)
X	       (gnus-Subject-mark-as-unread nil t))
X	      (t
X	       (gnus-Subject-mark-as-unread)))
X	(setq count (1+ count))
X	)
X      ;; Return number of articles marked as read.
X      count
X      )))
X
X(defun gnus-Subject-mark-as-unread-forward (count)
X  "Mark current article as unread, and then go forward.
XArgument COUNT specifies number of articles marked as unread."
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-unread nil nil)
X    (gnus-Subject-next-subject 1 nil)
X    (setq count (1- count))))
X
X(defun gnus-Subject-mark-as-unread-backward (count)
X  "Mark current article as unread, and then go backward.
XArgument COUNT specifies number of articles marked as unread."
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-unread nil nil)
X    (gnus-Subject-prev-subject 1 nil)
X    (setq count (1- count))))
X
X(defun gnus-Subject-mark-as-unread (&optional article clear-mark)
X  "Mark current article as unread.
XOptional 1st argument ARTICLE specifies article number to be marked as unread.
XOptional 2nd argument CLEAR-MARK remove any kinds of mark."
X  (save-excursion
X    (set-buffer gnus-Subject-buffer)
X    (let* ((buffer-read-only nil)
X	   (current (gnus-Subject-article-number))
X	   (article (or article current)))
X      (gnus-mark-article-as-unread article clear-mark)
X      (if (or (eq article current)
X	      (gnus-Subject-goto-subject article))
X	  (progn
X	    (beginning-of-line)
X	    (delete-char 1)
X	    (insert (if clear-mark " " "-"))))
X      )))
X
X(defun gnus-Subject-mark-as-read-forward (count)
X  "Mark current article as read, and then go forward.
XArgument COUNT specifies number of articles marked as read"
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-read)
X    (gnus-Subject-next-subject 1 'marked)
X    (setq count (1- count))))
X
X(defun gnus-Subject-mark-as-read-backward (count)
X  "Mark current article as read, and then go backward.
XArgument COUNT specifies number of articles marked as read"
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-read)
X    (gnus-Subject-prev-subject 1 'marked)
X    (setq count (1- count))))
X
X(defun gnus-Subject-mark-as-read (&optional article mark)
X  "Mark current article as read.
XOptional 1st argument ARTICLE specifies article number to be marked as read.
XOptional 2nd argument MARK specifies a string inserted at beginning of line.
XAny kind of string (length 1) except for a space and `-' is ok."
X  (save-excursion
X    (set-buffer gnus-Subject-buffer)
X    (let* ((buffer-read-only nil)
X	   (mark (or mark "D"))		;Default mark is `D'.
X	   (current (gnus-Subject-article-number))
X	   (article (or article current)))
X      (gnus-mark-article-as-read article)
X      (if (or (eq article current)
X	      (gnus-Subject-goto-subject article))
X	  (progn
X	    (beginning-of-line)
X	    (delete-char 1)
X	    (insert mark)))
X      )))
X
X(defun gnus-Subject-clear-mark-forward (count)
X  "Remove current article's mark, and go forward.
XArgument COUNT specifies number of articles unmarked"
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-unread nil t)
X    (gnus-Subject-next-subject 1 nil)
X    (setq count (1- count))))
X
X(defun gnus-Subject-clear-mark-backward (count)
X  "Remove current article's mark, and go backward.
XArgument COUNT specifies number of articles unmarked"
X  (interactive "p")
X  (while (> count 0)
X    (gnus-Subject-mark-as-unread nil t)
X    (gnus-Subject-prev-subject 1 nil)
X    (setq count (1- count))))
X
X(defun gnus-Subject-toggle-truncation (arg)
X  "Toggle truncation of subject lines.
XWith arg, turn line truncation on iff arg is positive."
X  (interactive "P")
X  (setq truncate-lines
X	(if (null arg) (not truncate-lines)
X	  (> (prefix-numeric-value arg) 0)))
X  (redraw-display))
X
X(defun gnus-Subject-delete-marked-as-read ()
X  "Delete lines which is marked as read."
X  (interactive)
X  (if gnus-newsgroup-unreads
X      (let ((buffer-read-only nil))
X	(save-excursion
X	  (goto-char (point-min))
X	  (delete-non-matching-lines "^[ ---]"))
X	;; Adjust point.
X	(if (eobp)
X	    (gnus-Subject-prev-subject 1)
X	  (beginning-of-line)
X	  (search-forward ":" nil t)))
X    ;; It is not so good idea to make the buffer empty.
X    (message "All articles are marked as read")
X    ))
X
X(defun gnus-Subject-delete-marked-with (marks)
X  "Delete lines which are marked with MARKS (e.g. \"DK\")."
X  (interactive "sMarks: ")
X  (let ((buffer-read-only nil))
X    (save-excursion
X      (goto-char (point-min))
X      (delete-matching-lines (concat "^[" marks "]")))
X    ;; Adjust point.
X    (or (zerop (buffer-size))
X	(if (eobp)
X	    (gnus-Subject-prev-subject 1)
X	  (beginning-of-line)
X	  (search-forward ":" nil t)))
X    ))
X
X(defun gnus-Subject-sort-by-number (reverse)
X  "Sort subject display buffer by article number.
XArgument REVERSE means reverse order."
X  (interactive "P")
X  (gnus-Subject-sort-subjects
X   (function
X    (lambda (a b)
X      (< (nntp-header-number a) (nntp-header-number b))))
X   reverse
X   ))
X
X(defun gnus-Subject-sort-by-author (reverse)
X  "Sort subject display buffer by author name alphabetically.
XIf case-fold-search is non-nil, case of letters is ignored.
XArgument REVERSE means reverse order."
X  (interactive "P")
X  (gnus-Subject-sort-subjects
X   (function
X    (lambda (a b)
X      (gnus-string-lessp (nntp-header-from a) (nntp-header-from b))))
X   reverse
X   ))
X
X(defun gnus-Subject-sort-by-subject (reverse)
X  "Sort subject display buffer by subject alphabetically. `Re:'s are ignored.
XIf case-fold-search is non-nil, case of letters is ignored.
XArgument REVERSE means reverse order."
X  (interactive "P")
X  (gnus-Subject-sort-subjects
X   (function
X    (lambda (a b)
X      (gnus-string-lessp
X       (gnus-simplify-subject (nntp-header-subject a) 're-only)
X       (gnus-simplify-subject (nntp-header-subject b) 're-only))))
X   reverse
X   ))
X
X(defun gnus-Subject-sort-by-date (reverse)
X  "Sort subject display buffer by posted date.
XArgument REVERSE means reverse order."
X  (interactive "P")
X  (gnus-Subject-sort-subjects
X   (function
X    (lambda (a b)
X      (gnus-date-lessp (nntp-header-date a) (nntp-header-date b))))
X   reverse
X   ))
X
X(defun gnus-Subject-sort-subjects (predicate &optional reverse)
X  "Sort subject display buffer by PREDICATE.
XOptional argument REVERSE means reverse order."
X  (let ((current (gnus-Subject-article-number)))
X    (gnus-sort-headers predicate reverse)
X    (gnus-Subject-prepare)
X    (gnus-Subject-goto-subject current)
X    ))
X
X(defun gnus-Subject-reselect-current-group (show-all)
X  "Once exit and then reselect the current newsgroup.
XPrefix argument SHOW-ALL means to select all articles."
X  (interactive "P")
X  (let ((current-subject (gnus-Subject-article-number)))
X    (gnus-Subject-exit t)
X    ;; We have to adjust the point of Group mode buffer because the
X    ;; current point was moved to the next unread newsgroup by
X    ;; exiting.
X    (gnus-Group-jump-to-group gnus-newsgroup-name)
X    (gnus-Group-read-group show-all t)
X    (gnus-Subject-goto-subject current-subject)
X    ))
X
X(defun gnus-Subject-caesar-message (rotnum)
X  "Caesar rotates all letters of current message by 13/47 places.
XWith prefix arg, specifies the number of places to rotate each letter forward.
XCaesar rotates Japanese letters by 47 places in any case."
X  (interactive "P")
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (require 'rnews)
X    (gnus-replace-functions)
X    (save-restriction
X      (widen)
X      ;; We don't want to jump to the beginning of the message.
X      ;; `save-excursion' does not do its job.
X      (move-to-window-line 0)
X      (let ((last (point)))
X	(news-caesar-buffer-body rotnum)
X	(goto-char last)
X	(recenter 0)
X	))
X    ))
X
X(defun gnus-Subject-rmail-digest ()
X  "Run RMAIL on current digest article.
Xgnus-Select-digest-hook will be called with no arguments, if that
Xvalue is non-nil. It is possible to modify the article so that Rmail
Xcan work with it.
Xgnus-Rmail-digest-hook will be called with no arguments, if that value
Xis non-nil. The hook is intended to customize Rmail mode."
X  (interactive)
X  (gnus-Subject-select-article)
X  (require 'rmail)
X  (let ((artbuf gnus-Article-buffer)
X	(digbuf (get-buffer-create gnus-Digest-buffer))
X	(mail-header-separator ""))
X    (set-buffer digbuf)
X    (buffer-flush-undo (current-buffer))
X    (setq buffer-read-only nil)
X    (erase-buffer)
X    (insert-buffer-substring artbuf)
X    (run-hooks 'gnus-Select-digest-hook)
X    (gnus-convert-article-to-rmail)
X    (goto-char (point-min))
X    ;; Rmail initializations.
X    (rmail-insert-rmail-file-header)
X    (rmail-mode)
X    (rmail-set-message-counters)
X    (rmail-show-message)
X    (condition-case ()
X	(progn
X	  (undigestify-rmail-message)
X	  (rmail-expunge)		;Delete original message.
X	  ;; File name is meaningless but `save-buffer' requires it.
X	  (setq buffer-file-name "GNUS Digest")
X	  (setq mode-line-buffer-identification
X		(concat "Digest: "
X			(nntp-header-subject gnus-current-headers)))
X	  ;; There is no need to write this buffer to a file.
X	  (make-local-variable 'write-file-hooks)
X	  (setq write-file-hooks
X		(list (function
X		       (lambda ()
X			 (set-buffer-modified-p nil)
X			 (message "(No changes need to be saved)")
X			 'no-need-to-write-this-buffer))))
X	  ;; Default file name saving digest messages.
X	  (setq rmail-last-rmail-file
X		(funcall gnus-rmail-save-name
X			 gnus-newsgroup-name
X			 gnus-current-headers
X			 gnus-newsgroup-last-rmail
X			 ))
X	  (setq rmail-last-file
X		(funcall gnus-mail-save-name
X			 gnus-newsgroup-name
X			 gnus-current-headers
X			 gnus-newsgroup-last-mail
X			 ))
X	  ;; Prevent generating new buffer named ***<N> each time.
X	  (setq rmail-summary-buffer
X		(get-buffer-create gnus-Digest-summary-buffer))
X	  (run-hooks 'gnus-Rmail-digest-hook)
X	  ;; Display Rmail buffer in a window where Article buffer was
X	  ;; displayed, and display Summary buffer in a window where
X	  ;; Subject buffer was displayed.
X	  (if gnus-digest-show-summary
X	      (let ((grpwin (get-buffer-window gnus-Group-buffer)))
X		;;(pop-to-buffer (current-buffer))
X		(set-window-buffer
X		 (get-buffer-window gnus-Article-buffer) digbuf)
X		(rmail-summary)
X		(if grpwin
X		    (progn
X		      (switch-to-buffer gnus-Group-buffer)
X		      (pop-to-buffer rmail-summary-buffer)))
X		(message (substitute-command-keys
X			  "Type \\[rmail-summary-quit] to return to GNUS"))
X		)
X	    ;;(switch-to-buffer (current-buffer))
X	    ;;(delete-other-windows)
X	    (gnus-configure-windows 'ExpandSubject)
X	    (pop-to-buffer gnus-Subject-buffer)
X	    (switch-to-buffer digbuf)
X	    (message (substitute-command-keys
X		      "Type \\[rmail-quit] to return to GNUS"))
X	    ))
X      (error (set-buffer-modified-p nil)
X	     (kill-buffer digbuf)
X	     ;; This command should not signal an error because the
X	     ;; command is called from hooks.
X	     (ding) (message "Article is not a digest")))
X    ))
X
X(defun gnus-Subject-post-news ()
X  "Post an article."
X  (interactive)
X  (gnus-Subject-select-article t nil)
X  (switch-to-buffer gnus-Article-buffer)
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (delete-other-windows)
X  (bury-buffer gnus-Article-buffer)
X  (gnus-post-news))
X
X(defun gnus-Subject-post-reply (yank)
X  "Post a reply article.
XIf prefix argument YANK is non-nil, original article is yanked automatically."
X  (interactive "P")
X  (gnus-Subject-select-article t nil)
X  (switch-to-buffer gnus-Article-buffer)
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (delete-other-windows)
X  (bury-buffer gnus-Article-buffer)
X  (gnus-news-reply yank))
X
X(defun gnus-Subject-post-reply-with-original ()
X  "Post a reply article with original article."
X  (interactive)
X  (gnus-Subject-post-reply t))
X
X(defun gnus-Subject-cancel-article ()
X  "Cancel this article you posted."
X  (interactive)
X  (gnus-Subject-select-article t nil)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (gnus-cancel-news)))
X
X(defun gnus-Subject-mail-reply (yank)
X  "Reply mail to news author.
SHAR_EOF
echo "End of part 3, continue with part 4"
echo "4" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 4 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.el continued
#
CurArch=4
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.el
XIf prefix argument YANK is non-nil, original article is yanked automatically."
X  (interactive "P")
X  (gnus-Subject-select-article)
X  (switch-to-buffer gnus-Article-buffer)
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (delete-other-windows)
X  (bury-buffer gnus-Article-buffer)
X  (news-mail-reply)
X  (gnus-replace-functions)
X  (if yank
X      (let ((last (point)))
X	(goto-char (point-max))
X	(mail-yank-original nil)
X	(goto-char last)
X	)))
X
X(defun gnus-Subject-mail-reply-with-original ()
X  "Reply mail to news author with original article."
X  (interactive)
X  (gnus-Subject-mail-reply t))
X
X(defun gnus-Subject-mail-other-window ()
X  "Reply mail to news author in other window."
X  (interactive)
X  (gnus-Subject-select-article)
X  (switch-to-buffer gnus-Article-buffer)
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (delete-other-windows)
X  (bury-buffer gnus-Article-buffer)
X  (news-mail-other-window)
X  (gnus-replace-functions))
X
X(defun gnus-Subject-save-article ()
X  "Save this article using default saver function.
XVariable `gnus-default-article-saver' specifies the saver function."
X  (interactive)
X  (gnus-Subject-select-article
X   (not (null gnus-save-all-headers)) gnus-save-all-headers)
X  (if gnus-default-article-saver
X      (call-interactively gnus-default-article-saver)
X    (error "No default saver is defined.")))
X
X(defun gnus-Subject-save-in-rmail (&optional filename)
X  "Append this article to Rmail file.
XOptional argument FILENAME specifies file name.
XDirectory to save to is default to `gnus-article-save-directory' which
Xis initialized from the SAVEDIR environment variable."
X  (interactive)
X  (gnus-Subject-select-article
X   (not (null gnus-save-all-headers)) gnus-save-all-headers)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (save-excursion
X      (save-restriction
X	(widen)
X	(let* ((overlay-arrow-position nil)
X	       (default-name
X		 (funcall gnus-rmail-save-name
X			  gnus-newsgroup-name
X			  gnus-current-headers
X			  gnus-newsgroup-last-rmail
X			  )))
X	  (or filename
X	      (setq filename
X		    (read-file-name
X		     (concat "Save article in Rmail file: (default "
X			     (file-name-nondirectory default-name)
X			     ") ")
X		     (file-name-directory default-name)
X		     default-name)))
X	  (gnus-make-directory (file-name-directory filename))
X	  (gnus-output-to-rmail filename)
X	  ;; Remember the directory name to save articles.
X	  (setq gnus-newsgroup-last-rmail filename)
X	  )))
X    ))
X
X(defun gnus-Subject-save-in-mail (&optional filename)
X  "Append this article to Unix mail file.
XOptional argument FILENAME specifies file name.
XDirectory to save to is default to `gnus-article-save-directory' which
Xis initialized from the SAVEDIR environment variable."
X  (interactive)
X  (gnus-Subject-select-article
X   (not (null gnus-save-all-headers)) gnus-save-all-headers)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (save-excursion
X      (save-restriction
X	(widen)
X	(let* ((overlay-arrow-position nil)
X	       (default-name
X		 (funcall gnus-mail-save-name
X			  gnus-newsgroup-name
X			  gnus-current-headers
X			  gnus-newsgroup-last-mail
X			  )))
X	  (or filename
X	      (setq filename
X		    (read-file-name
X		     (concat "Save article in Unix mail file: (default "
X			     (file-name-nondirectory default-name)
X			     ") ")
X		     (file-name-directory default-name)
X		     default-name)))
X	  (gnus-make-directory (file-name-directory filename))
X	  (rmail-output filename)
X	  ;; Remember the directory name to save articles.
X	  (setq gnus-newsgroup-last-mail filename)
X	  )))
X    ))
X
X(defun gnus-Subject-save-in-file (&optional filename)
X  "Append this article to file.
XOptional argument FILENAME specifies file name.
XDirectory to save to is default to `gnus-article-save-directory' which
Xis initialized from the SAVEDIR environment variable."
X  (interactive)
X  (gnus-Subject-select-article
X   (not (null gnus-save-all-headers)) gnus-save-all-headers)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (save-excursion
X      (save-restriction
X	(widen)
X	(let* ((overlay-arrow-position nil)
X	       (default-name
X		 (funcall gnus-file-save-name
X			  gnus-newsgroup-name
X			  gnus-current-headers
X			  gnus-newsgroup-last-file
X			  )))
X	  (or filename
X	      (setq filename
X		    (read-file-name
X		     (concat "Save article in file: (default "
X			     (file-name-nondirectory default-name)
X			     ") ")
X		     (file-name-directory default-name)
X		     default-name)))
X	  (gnus-make-directory (file-name-directory filename))
X	  (gnus-output-to-file filename)
X	  ;; Remember the directory name to save articles.
X	  (setq gnus-newsgroup-last-file filename)
X	  )))
X    ))
X
X(defun gnus-Subject-save-in-folder (&optional folder)
X  "Save this article to MH folder (using `rcvstore' in MH library).
XOptional argument FOLDER specifies folder name."
X  (interactive)
X  (gnus-Subject-select-article
X   (not (null gnus-save-all-headers)) gnus-save-all-headers)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (save-restriction
X      (widen)
X      ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet.
X      (mh-find-path)
X      (let ((overlay-arrow-position nil)
X	    (folder
X	     (or folder
X		 (mh-prompt-for-folder "Save article in"
X				       (funcall gnus-folder-save-name
X						gnus-newsgroup-name
X						gnus-current-headers
X						gnus-newsgroup-last-folder
X						)
X				       t
X				       )))
X	    (errbuf (get-buffer-create " *GNUS rcvstore*")))
X	(unwind-protect
X	    (call-process-region (point-min) (point-max)
X				 (expand-file-name "rcvstore" mh-lib)
X				 nil errbuf nil folder)
X	  (set-buffer errbuf)
X	  (if (zerop (buffer-size))
X	      (message "Article saved in folder: %s" folder)
X	    (message "%s" (buffer-string)))
X	  (kill-buffer errbuf)
X	  (setq gnus-newsgroup-last-folder folder))
X	))
X    ))
X
X(defun gnus-Subject-pipe-output ()
X  "Pipe this article to subprocess."
X  (interactive)
X  ;; Ignore `gnus-save-all-headers' since this is not save command.
X  (gnus-Subject-select-article)
X  (gnus-eval-in-buffer-window gnus-Article-buffer
X    (save-restriction
X      (widen)
X      (let ((overlay-arrow-position nil)
X	    (command (read-string "Shell command on article: "
X				  gnus-last-shell-command)))
X	(if (string-equal command "")
X	    (setq command gnus-last-shell-command))
X	(shell-command-on-region (point-min) (point-max) command nil)
X	(setq gnus-last-shell-command command)
X	))
X    ))
X
X(defun gnus-Subject-catch-up (all &optional quietly)
X  "Mark all articles not marked as unread in this newsgroup as read.
XIf prefix argument ALL is non-nil, all articles are marked as read."
X  (interactive "P")
X  (if (or quietly
X	  (y-or-n-p
X	   (if all
X	       "Do you really want to mark everything as read? "
X	     "Delete all articles not marked as unread? ")))
X      (let ((unmarked
X	     (gnus-set-difference gnus-newsgroup-unreads
X				  (if (not all) gnus-newsgroup-marked))))
X        (message "")			;Erase "Yes or No" question.
X	(while unmarked
X          (gnus-Subject-mark-as-read (car unmarked) "C")
X	  (setq unmarked (cdr unmarked))
X	  ))
X    ))
X
X(defun gnus-Subject-catch-up-all (&optional quietly)
X  "Mark all articles in this newsgroup as read."
X  (interactive)
X  (gnus-Subject-catch-up t quietly))
X
X(defun gnus-Subject-catch-up-and-exit (all &optional quietly)
X  "Mark all articles not marked as unread in this newsgroup as read, then exit.
XIf prefix argument ALL is non-nil, all articles are marked as read."
X  (interactive "P")
X  (if (or quietly
X	  (y-or-n-p
X	   (if all
X	       "Do you really want to mark everything as read? "
X	     "Delete all articles not marked as unread? ")))
X      (let ((unmarked
X             (gnus-set-difference gnus-newsgroup-unreads
X                                  (if (not all) gnus-newsgroup-marked))))
X        (message "")			;Erase "Yes or No" question.
X	(while unmarked
X          (gnus-mark-article-as-read (car unmarked))
X	  (setq unmarked (cdr unmarked)))
X	(gnus-Subject-exit))
X    ))
X
X(defun gnus-Subject-catch-up-all-and-exit (&optional quietly)
X  "Mark all articles in this newsgroup as read, and then exit."
X  (interactive)
X  (gnus-Subject-catch-up-and-exit t quietly))
X
X(defun gnus-Subject-edit-global-kill ()
X  "Edit a global KILL file."
X  (interactive)
X  (setq gnus-current-kill-article (gnus-Subject-article-number))
X  (gnus-Kill-file-edit-file nil)	;Nil stands for global KILL file.
X  (message
X   (substitute-command-keys
X    "Editing a global KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
X
X(defun gnus-Subject-edit-local-kill ()
X  "Edit a local KILL file applied to the current newsgroup."
X  (interactive)
X  (setq gnus-current-kill-article (gnus-Subject-article-number))
X  (gnus-Kill-file-edit-file gnus-newsgroup-name)
X  (message
X   (substitute-command-keys
X    "Editing a local KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
X
X(defun gnus-Subject-exit (&optional temporary)
X  "Exit reading current newsgroup, and then return to group selection mode.
Xgnus-Exit-group-hook is called with no arguments if that value is non-nil."
X  (interactive)
X  (run-hooks 'gnus-Exit-group-hook)
X  (let ((updated nil))
X    (gnus-update-unread-articles gnus-newsgroup-name
X				 (append gnus-newsgroup-unselected
X					 gnus-newsgroup-unreads)
X				 gnus-newsgroup-marked)
X    (setq updated
X	  (gnus-mark-as-read-by-xref gnus-newsgroup-name
X				     gnus-newsgroup-headers
X				     gnus-newsgroup-unreads))
X    (if temporary
X	;; Do not switch windows but change the buffer to work.
X	(set-buffer gnus-Group-buffer)
X      ;; Return to Group selection mode.
X      (if (get-buffer gnus-Subject-buffer)
X	  (bury-buffer gnus-Subject-buffer))
X      (if (get-buffer gnus-Article-buffer)
X	  (bury-buffer gnus-Article-buffer))
X      (gnus-configure-windows 'ExitNewsgroup)
X      (pop-to-buffer gnus-Group-buffer))
X    ;; Update cross referenced group info.
X    (while updated
X      (gnus-Group-update-group (car updated) t) ;Ignore invisible group.
X      (setq updated (cdr updated)))
X    (gnus-Group-update-group gnus-newsgroup-name)
X    (gnus-Group-jump-to-group gnus-newsgroup-name) ;Make sure where I was.
X    (gnus-Group-next-unread-group 1)
X    ))
X
X(defun gnus-Subject-quit ()
X  "Quit reading current newsgroup without updating read article info."
X  (interactive)
X  (if (y-or-n-p "Do you really wanna quit reading this group? ")
X      (progn
X	(message "")			;Erase "Yes or No" question.
X	;; Return to Group selection mode.
X	(if (get-buffer gnus-Subject-buffer)
X	    (bury-buffer gnus-Subject-buffer))
X	(if (get-buffer gnus-Article-buffer)
X	    (bury-buffer gnus-Article-buffer))
X	(gnus-configure-windows 'ExitNewsgroup)
X	(pop-to-buffer gnus-Group-buffer)
X	(gnus-Group-jump-to-group gnus-newsgroup-name) ;Make sure where I was.
X	(gnus-Group-next-group 1)	;(gnus-Group-next-unread-group 1)
X	)))
X
X(defun gnus-Subject-describe-briefly ()
X  "Describe Subject mode commands briefly."
X  (interactive)
X  (message
X   (concat
X    (substitute-command-keys "\\[gnus-Subject-next-page]:Select  ")
X    (substitute-command-keys "\\[gnus-Subject-next-unread-article]:Forward  ")
X    (substitute-command-keys "\\[gnus-Subject-prev-unread-article]:Backward  ")
X    (substitute-command-keys "\\[gnus-Subject-exit]:Exit  ")
X    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
X    (substitute-command-keys "\\[gnus-Subject-describe-briefly]:This help")
X    )))
X
X
X;;;
X;;; GNUS Article Mode
X;;;
X
X(if gnus-Article-mode-map
X    nil
X  (setq gnus-Article-mode-map (make-keymap))
X  (suppress-keymap gnus-Article-mode-map)
X  (define-key gnus-Article-mode-map " " 'gnus-Article-next-page)
X  (define-key gnus-Article-mode-map "\177" 'gnus-Article-prev-page)
X  (define-key gnus-Article-mode-map "r" 'gnus-Article-refer-article)
X  (define-key gnus-Article-mode-map "o" 'gnus-Article-pop-article)
X  (define-key gnus-Article-mode-map "h" 'gnus-Article-show-subjects)
X  (define-key gnus-Article-mode-map "s" 'gnus-Article-show-subjects)
X  (define-key gnus-Article-mode-map "?" 'gnus-Article-describe-briefly)
X  (define-key gnus-Article-mode-map "\C-c\C-i" 'gnus-Info-find-node))
X
X(defun gnus-Article-mode ()
X  "Major mode for browsing through an article.
XAll normal editing commands are turned off.
XInstead, these commands are available:
X\\{gnus-Article-mode-map}
X
XVarious hooks for customization:
X gnus-Article-mode-hook
X    Entry to this mode calls the value with no arguments, if that
X    value is non-nil.
X
X gnus-Article-prepare-hook
X    Called with no arguments after an article is prepared for reading,
X    if that value is non-nil."
X  (interactive)
X  (kill-all-local-variables)
X  ;; Gee.  Why don't you upgrade?
X  (cond ((boundp 'mode-line-modified)
X	 (setq mode-line-modified "--- "))
X	((listp (default-value 'mode-line-format))
X	 (setq mode-line-format
X	       (cons "--- " (cdr (default-value 'mode-line-format))))))
X  (make-local-variable 'global-mode-string)
X  (setq global-mode-string nil)
X  (setq major-mode 'gnus-Article-mode)
X  (setq mode-name "GNUS Article")
X  (gnus-Article-set-mode-line)
X  (use-local-map gnus-Article-mode-map)
X  (make-local-variable 'page-delimiter)
X  (setq page-delimiter gnus-page-delimiter)
X  (make-local-variable 'mail-header-separator)
X  (setq mail-header-separator "")	;For caesar function.
X  ;; Overlay arrow does not work if it's buffer local.
X  (setq overlay-arrow-string gnus-more-message)
X  (setq overlay-arrow-position (make-marker))
X  (buffer-flush-undo (current-buffer))
X  (setq buffer-read-only t)		;Disable modification
X  (run-hooks 'gnus-Article-mode-hook))
X
X(defun gnus-Article-setup-buffer ()
X  "Initialize Article mode buffer."
X  (or (get-buffer gnus-Article-buffer)
X      (save-excursion
X	(set-buffer (get-buffer-create gnus-Article-buffer))
X	(gnus-Article-mode))
X      ))
X
X(defun gnus-Article-prepare (article &optional all-headers)
X  "Prepare ARTICLE in Article mode buffer.
XIf optional argument ALL-HEADERS is non-nil, all headers are inserted."
X  (save-excursion
X    (set-buffer gnus-Article-buffer)
X    (let ((buffer-read-only nil))
X      ;; Marker may slow down editing command of Emacs.
X      (set-marker overlay-arrow-position nil)
X      (erase-buffer)
X      (if (gnus-request-article article)
X	  (progn
X	    ;; Prepare article buffer
X	    (insert-buffer-substring nntp-server-buffer)
X	    (setq gnus-have-all-headers (or all-headers gnus-show-all-headers))
X	    (if (and (numberp article)
X		     (not (eq article gnus-current-article)))
X		;; Seems me that a new article is selected.
X		(progn
X		  ;; gnus-current-article must be an article number.
X		  (setq gnus-last-article gnus-current-article)
X		  (setq gnus-current-article article)
X		  (setq gnus-current-headers
X			(gnus-find-header-by-number gnus-newsgroup-headers
X						    gnus-current-article))
X		  ;; Clear articles history only when articles are
X		  ;; retrieved by article numbers.
X		  (setq gnus-current-history nil)
X		  (run-hooks 'gnus-Mark-article-hook)
X		  ))
X	    ;; Hooks for modifying contents of the article. This hook
X	    ;; must be called before being narrowed.
X	    (run-hooks 'gnus-Article-prepare-hook)
X	    ;; Delete unnecessary headers.
X	    (or gnus-have-all-headers
X		(gnus-Article-delete-headers))
X	    ;; Do page break.
X	    (goto-char (point-min))
X	    (if gnus-break-pages
X		(gnus-narrow-to-page))
X	    ;; Next function must be called after setting
X	    ;;  `gnus-current-article' variable and narrowed to page.
X	    (gnus-Article-set-mode-line)
X	    )
X	(if (numberp article)
X	    (gnus-Subject-mark-as-read article))
X	(ding) (message "No such article (may be canceled)"))
X      )))
X
X(defun gnus-Article-show-all-headers ()
X  "Show all article headers in Article mode buffer."
X  (or gnus-have-all-headers
X      (gnus-Article-prepare gnus-current-article t)))
X
X;;(defun gnus-Article-set-mode-line ()
X;;  "Set Article mode line string."
X;;  (setq mode-line-buffer-identification
X;;	(list 17
X;;	      (format "GNUS: %s {%d-%d} %d"
X;;		      gnus-newsgroup-name
X;;		      gnus-newsgroup-begin
X;;		      gnus-newsgroup-end
X;;		      gnus-current-article
X;;                    )))
X;;  (set-buffer-modified-p t))
X
X(defun gnus-Article-set-mode-line ()
X  "Set Article mode line string."
X  (let ((unmarked
X	 (- (length gnus-newsgroup-unreads) (length gnus-newsgroup-marked))))
X    (setq mode-line-buffer-identification
X	  (list 17
X		(format "GNUS: %s{%d} %s"
X			gnus-newsgroup-name
X			gnus-current-article
X			;; This is proposed by tale@pawl.rpi.edu.
X                        (if (zerop unmarked)
X			    "      "
X			  (format "%d more" unmarked))
X			))))
X  (set-buffer-modified-p t))
X
X(defun gnus-Article-delete-headers ()
X  "Delete unnecessary headers."
X  (save-excursion
X    (save-restriction
X      (goto-char (point-min))
X      (narrow-to-region (point-min)
X			(progn (search-forward "\n\n" nil 'move) (point)))
X      (goto-char (point-min))
X      (and (stringp gnus-ignored-headers)
X	   (while (re-search-forward gnus-ignored-headers nil t)
X	     (beginning-of-line)
X	     (delete-region (point)
X			    (progn (re-search-forward "\n[^ \t]")
X				   (forward-char -1)
X				   (point)))))
X      )))
X
X;; Working on article's buffer
X
X(defun gnus-Article-next-page (lines)
X  "Show next page of current article.
XIf end of article, return non-nil. Otherwise return nil.
XArgument LINES specifies lines to be scrolled up."
X  (interactive "P")
X  (move-to-window-line -1)
X  (if (eobp)
X      (if (or (not gnus-break-pages)
X	      (save-restriction (widen) (eobp))) ;Real end-of-buffer?
X	  t
X	(gnus-narrow-to-page 1)		;Go to next page.
X	nil
X	)
X    (scroll-up lines)
X    nil
X    ))
X
X(defun gnus-Article-prev-page (lines)
X  "Show previous page of current article.
XArgument LINES specifies lines to be scrolled down."
X  (interactive "P")
X  (move-to-window-line 0)
X  (if (and gnus-break-pages
X	   (bobp)
X	   (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
X      (progn
X	(gnus-narrow-to-page -1) ;Go to previous page.
X	(goto-char (point-max))
X	(recenter -1))
X    (scroll-down lines)))
X
X(defun gnus-Article-next-digest (nth)
X  "Move to head of NTH next digested message.
XSet mark at end of digested message."
X  ;; Stop page breaking in digest mode.
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (end-of-line)
X  ;; Skip NTH - 1 digest.
X  ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>.
X  ;; Digest separator is customizable.
X  ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>.
X  (while (and (> nth 1)
X	      (re-search-forward gnus-digest-separator nil 'move))
X    (setq nth (1- nth)))
X  (if (re-search-forward gnus-digest-separator nil t)
X      (let ((begin (point)))
X	;; Search for end of this message.
X	(end-of-line)
X	(if (re-search-forward gnus-digest-separator nil t)
X	    (progn
X	      (search-backward "\n\n")	;This may be incorrect.
X	      (forward-line 1))
X	  (goto-char (point-max)))
X	(push-mark)			;Set mark at end of digested message.
X	(goto-char begin)
X	(beginning-of-line)
X	;; Show From: and Subject: fields.
X	(recenter 1))
X    (message "End of message")
X    ))
X
X(defun gnus-Article-prev-digest (nth)
X  "Move to head of NTH previous digested message."
X  ;; Stop page breaking in digest mode.
X  (set-marker overlay-arrow-position nil)
X  (widen)
X  (beginning-of-line)
X  ;; Skip NTH - 1 digest.
X  ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>.
X  ;; Digest separator is customizable.
X  ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>.
X  (while (and (> nth 1)
X	      (re-search-backward gnus-digest-separator nil 'move))
X    (setq nth (1- nth)))
X  (if (re-search-backward gnus-digest-separator nil t)
X      (let ((begin (point)))
X	;; Search for end of this message.
X	(end-of-line)
X	(if (re-search-forward gnus-digest-separator nil t)
X	    (progn
X	      (search-backward "\n\n")	;This may be incorrect.
X	      (forward-line 1))
X	  (goto-char (point-max)))
X	(push-mark)			;Set mark at end of digested message.
X	(goto-char begin)
X	;; Show From: and Subject: fields.
X	(recenter 1))
X    (goto-char (point-min))
X    (message "Top of message")
X    ))
X
X(defun gnus-Article-refer-article ()
X  "Read article specified by message-id around point."
X  (interactive)
X  (save-window-excursion
X    (save-excursion
X      (re-search-forward ">" nil t)	;Move point to end of "<....>".
X      (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t)
X	  (let ((message-id
X		 (buffer-substring (match-beginning 1) (match-end 1))))
X	    (set-buffer gnus-Subject-buffer)
X	    (gnus-Subject-refer-article message-id))
X	(error "No references around point"))
X      )))
X
X(defun gnus-Article-pop-article ()
X  "Pop up article history."
X  (interactive)
X  (save-window-excursion
X    (set-buffer gnus-Subject-buffer)
X    (gnus-Subject-refer-article nil)))
X
X(defun gnus-Article-show-subjects ()
X  "Reconfigure windows to show headers."
X  (interactive)
X  (gnus-configure-windows 'SelectArticle)
X  (pop-to-buffer gnus-Subject-buffer)
X  (gnus-Subject-goto-subject gnus-current-article))
X
X(defun gnus-Article-describe-briefly ()
X  "Describe Article mode commands briefly."
X  (interactive)
X  (message
X   (concat
X    (substitute-command-keys "\\[gnus-Article-next-page]:Next page  ")
X    (substitute-command-keys "\\[gnus-Article-prev-page]:Prev page  ")
X    (substitute-command-keys "\\[gnus-Article-show-subjects]:Show headers  ")
X    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
X    (substitute-command-keys "\\[gnus-Article-describe-briefly]:This help")
X    )))
X
X
X;;;
X;;; GNUS KILL-File Mode
X;;;
X
X(if gnus-Kill-file-mode-map
X    nil
X  (setq gnus-Kill-file-mode-map (copy-keymap emacs-lisp-mode-map))
X  (define-key gnus-Kill-file-mode-map "\C-c\C-k\C-s" 'gnus-Kill-file-kill-by-subject)
X  (define-key gnus-Kill-file-mode-map "\C-c\C-k\C-a" 'gnus-Kill-file-kill-by-author)
X  (define-key gnus-Kill-file-mode-map "\C-c\C-c" 'gnus-Kill-file-exit)
X  (define-key gnus-Kill-file-mode-map "\C-c\C-i" 'gnus-Info-find-node))
X
X(defun gnus-Kill-file-mode ()
X  "Major mode for editing KILL file.
X
XIn addition to Emacs-Lisp Mode, the following commands are available:
X
X\\[gnus-Kill-file-kill-by-subject]	Insert KILL command for current subject.
X\\[gnus-Kill-file-kill-by-author]	Insert KILL command for current author.
X\\[gnus-Kill-file-exit]	Save file and exit editing KILL file.
X\\[gnus-Info-find-node]	Read Info about KILL file.
X
X  A KILL file contains lisp expressions to be applied to a selected
Xnewsgroup. The purpose is to mark articles as read on the basis of
Xsome set of regexps. A global KILL file is applied to every newsgroup,
Xand a local KILL file is applied to a specified newsgroup. Since a
Xglobal KILL file is applied to every newsgroup, for better performance
Xuse a local one.
X
X  A KILL file can contain any kind of Emacs lisp expressions expected
Xto be evaluated in the Subject buffer. Writing lisp programs for this
Xpurpose is not so easy because the internal working of GNUS must be
Xwell-known. For this reason, GNUS provides a general function which
Xdoes this easily for non-Lisp programmers.
X
X  The `gnus-kill' function executes commands available in Subject Mode
Xby their key sequences. `gnus-kill' should be called with FIELD,
XREGEXP and optional COMMAND and ALL. FIELD is a string representing
Xthe header field or an empty string. If FIELD is an empty string, the
Xentire article body is searched for. REGEXP is a string which is
Xcompared with FIELD value. COMMAND is a string representing a valid
Xkey sequence in Subject Mode or Lisp expression. COMMAND is default to
X'(gnus-Subject-mark-as-read nil \"X\"). Make sure that COMMAND is
Xexecuted in the Subject buffer.  If the second optional argument ALL
Xis non-nil, the COMMAND is applied to articles which are already
Xmarked as read or unread.  Articles which are marked are skipped over
Xby default.
X
X  For example, if you want to mark articles of which subjects contain
Xthe string `AI' as read, a possible KILL file may look like:
X
X	(gnus-kill \"Subject\" \"AI\")
X
X  If you want to mark articles with `D' instead of `X', you can use
Xthe following expression:
X
X	(gnus-kill \"Subject\" \"AI\" \"d\")
X
XIn this example it is assumed that the command
X`gnus-Subject-mark-as-read-forward' is assigned to `d' in Subject Mode.
X
X  It is possible to delete unnecessary headers which are marked with
X`X' in a KILL file as follows:
X
X	(gnus-expunge \"X\")
X
X  If the Subject buffer is empty after applying KILL files, GNUS will
Xexit the selected newsgroup normally.  If headers which are marked
Xwith `D' are deleted in a KILL file, it is impossible to read articles
Xwhich are marked as read in the previous GNUS sessions.  Marks other
Xthan `D' should be used for articles which should really be deleted.
X
XEntry to this mode calls emacs-lisp-mode-hook and
Xgnus-Kill-file-mode-hook with no arguments, if that value is non-nil."
X  (interactive)
X  (kill-all-local-variables)
X  (use-local-map gnus-Kill-file-mode-map)
X  (set-syntax-table emacs-lisp-mode-syntax-table)
X  (setq major-mode 'gnus-Kill-file-mode)
X  (setq mode-name "KILL-File")
X  (lisp-mode-variables nil)
X  (run-hooks 'emacs-lisp-mode-hook 'gnus-Kill-file-mode-hook))
X
X(defun gnus-Kill-file-edit-file (newsgroup)
X  "Begin editing a KILL file of NEWSGROUP.
XIf NEWSGROUP is nil, the global KILL file is selected."
X  (interactive "sNewsgroup: ")
X  (let ((file (gnus-newsgroup-kill-file newsgroup)))
X    (gnus-make-directory (file-name-directory file))
X    (let ((buffer (find-file-noselect file)))
X      (if (or (one-window-p t)
X	      (get-buffer-window buffer))
X	  (find-file-other-window file)
X	;; Select the larget window for editing FILE.
X	(set-window-buffer (get-largest-window) buffer)
X	(pop-to-buffer buffer)))
X    (gnus-Kill-file-mode)
X    ))
X
X(defun gnus-Kill-file-kill-by-subject ()
X  "Insert KILL command for current subject."
X  (interactive)
X  (insert
X   (format "(gnus-kill \"Subject\" \"%s\")\n"
X	   (if gnus-current-kill-article
X	       (nntp-header-subject
X		(gnus-find-header-by-number gnus-newsgroup-headers
X					    gnus-current-kill-article))
X	     ""
X	     ))))
X
X(defun gnus-Kill-file-kill-by-author ()
X  "Insert KILL command for current author."
X  (interactive)
X  (insert
X   (format "(gnus-kill \"From\" \"%s\")\n"
X	   (if gnus-current-kill-article
X	       (nntp-header-from
X		(gnus-find-header-by-number gnus-newsgroup-headers
X					    gnus-current-kill-article))
X	     ""
X	     ))))
X
X(defun gnus-Kill-file-exit ()
X  "Save a KILL file, then return to the previous buffer."
X  (interactive)
X  (let ((killbuf (current-buffer)))
X    (save-buffer)
X    (bury-buffer)
X    ;; Kill the KILL file buffer.
X    ;; Suggested by tale@pawl.rpi.edu.
X    (kill-buffer killbuf)))
X
X
X;;;
X;;; Utility functions
X;;;
X
X(defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
X  "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
XIf variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num.
XOtherwise, it is like ~/News/news/group/num."
X  (let ((default
X	  (expand-file-name
X	   (concat (if gnus-use-long-file-name
X		       (capitalize newsgroup)
X		     (gnus-newsgroup-directory-form newsgroup))
X		   "/" (int-to-string (nntp-header-number headers)))
X	   (or gnus-article-save-directory "~/News"))))
X    (if (and last-file
X	     (string-equal (file-name-directory default)
X			   (file-name-directory last-file))
X	     (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
X	default
X      (or last-file default))))
X
X(defun gnus-numeric-save-name (newsgroup headers &optional last-file)
X  "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
XIf variable `gnus-use-long-file-name' is nil, it is ~/News/news.group/num.
XOtherwise, it is like ~/News/news/group/num."
X  (let ((default
X	  (expand-file-name
X	   (concat (if gnus-use-long-file-name
X		       newsgroup
X		     (gnus-newsgroup-directory-form newsgroup))
X		   "/" (int-to-string (nntp-header-number headers)))
X	   (or gnus-article-save-directory "~/News"))))
X    (if (and last-file
X	     (string-equal (file-name-directory default)
X			   (file-name-directory last-file))
X	     (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
X	default
X      (or last-file default))))
X
X(defun gnus-Plain-save-name (newsgroup headers &optional last-file)
X  "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
XIf variable `gnus-use-long-file-name' is nil, it is ~/News/News.group.
XOtherwise, it is like ~/News/news/group/news."
X  (or last-file
X      (expand-file-name
X       (if gnus-use-long-file-name
X	   (capitalize newsgroup)
X	 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
X       (or gnus-article-save-directory "~/News"))))
X
X(defun gnus-plain-save-name (newsgroup headers &optional last-file)
X  "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
XIf variable `gnus-use-long-file-name' is nil, it is ~/News/news.group.
XOtherwise, it is like ~/News/news/group/news."
X  (or last-file
X      (expand-file-name
X       (if gnus-use-long-file-name
X	   newsgroup
X	 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
X       (or gnus-article-save-directory "~/News"))))
X
X(defun gnus-Folder-save-name (newsgroup headers &optional last-folder)
X  "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
XIf variable `gnus-use-long-file-name' is nil, it is +News.group.
XOtherwise, it is like +news/group."
X  (or last-folder
X      (concat "+"
X	      (if gnus-use-long-file-name
X		  (capitalize newsgroup)
X		(gnus-newsgroup-directory-form newsgroup)))))
X
X(defun gnus-folder-save-name (newsgroup headers &optional last-folder)
X  "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
XIf variable `gnus-use-long-file-name' is nil, it is +news.group.
XOtherwise, it is like +news/group."
X  (or last-folder
X      (concat "+"
X	      (if gnus-use-long-file-name
X		  newsgroup
X		(gnus-newsgroup-directory-form newsgroup)))))
X
X(defun gnus-apply-kill-file ()
X  "Apply KILL file to the current newsgroup."
X  ;; Apply the global KILL file.
X  (load (gnus-newsgroup-kill-file nil) t nil t)
X  ;; And then apply the local KILL file.
X  (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t))
X
X(defun gnus-Newsgroup-kill-file (newsgroup)
X  "Return the name of a KILL file of NEWSGROUP.
XIf NEWSGROUP is nil, return the global KILL file instead."
X  (cond ((or (null newsgroup)
X	     (string-equal newsgroup ""))
X	 ;; The global KILL file is placed at top of the directory.
X	 (expand-file-name gnus-kill-file-name
X			   (or gnus-article-save-directory "~/News")))
X	(gnus-use-long-file-name
X	 ;; Append ".KILL" to capitalized newsgroup name.
X	 (expand-file-name (concat (capitalize newsgroup)
X				   "." gnus-kill-file-name)
X			   (or gnus-article-save-directory "~/News")))
X	(t
X	 ;; Place "KILL" under the hierarchical directory.
X	 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
X				   "/" gnus-kill-file-name)
X			   (or gnus-article-save-directory "~/News")))
X	))
X
X(defun gnus-newsgroup-kill-file (newsgroup)
X  "Return the name of a KILL file of NEWSGROUP.
XIf NEWSGROUP is nil, return the global KILL file instead."
X  (cond ((or (null newsgroup)
X	     (string-equal newsgroup ""))
X	 ;; The global KILL file is placed at top of the directory.
X	 (expand-file-name gnus-kill-file-name
X			   (or gnus-article-save-directory "~/News")))
X	(gnus-use-long-file-name
X	 ;; Append ".KILL" to newsgroup name.
X	 (expand-file-name (concat newsgroup "." gnus-kill-file-name)
X			   (or gnus-article-save-directory "~/News")))
X	(t
X	 ;; Place "KILL" under the hierarchical directory.
X	 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
X				   "/" gnus-kill-file-name)
X			   (or gnus-article-save-directory "~/News")))
X	))
X
X(defun gnus-newsgroup-directory-form (newsgroup)
X  "Make hierarchical directory name from NEWSGROUP name."
X  (let ((newsgroup (substring newsgroup 0)) ;Copy string.
X	(len (length newsgroup))
X	(idx 0))
X    ;; Replace all occurence of `.' with `/'.
X    (while (< idx len)
X      (if (= (aref newsgroup idx) ?.)
X	  (aset newsgroup idx ?/))
X      (setq idx (1+ idx)))
X    newsgroup
X    ))
X
X(defun gnus-make-directory (directory)
X  "Make DIRECTORY recursively."
X  (let ((directory (expand-file-name directory default-directory)))
X    (or (file-exists-p directory)
X	(gnus-make-directory-1 "" directory))
X    ))
X
X(defun gnus-make-directory-1 (head tail)
X  (cond ((string-match "^/\\([^/]+\\)" tail)
X	 (setq head
X	       (concat (file-name-as-directory head)
X		       (substring tail (match-beginning 1) (match-end 1))))
X	 (or (file-exists-p head)
X	     (call-process "mkdir" nil nil nil head))
X	 (gnus-make-directory-1 head (substring tail (match-end 1))))
X	((string-equal tail "") t)
X	))
X
X(defun gnus-simplify-subject (subject &optional re-only)
X  "Remove `Re:' and words in parentheses.
XIf optional argument RE-ONLY is non-nil, strip `Re:' only."
X  (let ((case-fold-search t))		;Ignore case.
X    ;; Remove `Re:'
X    (if (string-match "\\`\\(re:[ \t]+\\)*" subject)
X	(setq subject (substring subject (match-end 0))))
X    ;; Remove words in parentheses from end.
X    (or re-only
X	(while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
X	  (setq subject (substring subject 0 (match-beginning 0)))))
X    ;; Return subject string.
X    subject
X    ))
X
X(defun gnus-optional-lines-and-from (header)
X  "Return a string like `NNN:AUTHOR' from HEADER."
X  (let ((name-length (length "umerin@photon")))
X    (substring (format "%3d:%s"
X		       ;; Lines of the article.
X		       ;; Suggested by dana@bellcore.com.
X		       (nntp-header-lines header)
X		       ;; Its author.
X		       (concat (mail-strip-quoted-names
X				(nntp-header-from header))
X			       (make-string name-length ? )))
X	       ;; 4 stands for length of `NNN:'.
X	       0 (+ 4 name-length))))
X
X(defun gnus-optional-lines (header)
X  "Return a string like `NNN' from HEADER."
X  (format "%4d" (nntp-header-lines header)))
X
X(defun gnus-sort-headers (predicate &optional reverse)
X  "Sort current group headers by PREDICATE safely.
X*Safely* means C-g quitting is disabled during sorting.
XOptional argument REVERSE means reverse order."
X  (let ((inhibit-quit t))
X    (setq gnus-newsgroup-headers
X	  (if reverse
X	      (nreverse (sort (nreverse gnus-newsgroup-headers) predicate))
X	    (sort gnus-newsgroup-headers predicate)))
X    ))
X
X(defun gnus-string-lessp (a b)
X  "Return T if first arg string is less than second in lexicographic order.
XIf case-fold-search is non-nil, case of letters is ignored."
X  (if case-fold-search
X      (string-lessp (downcase a) (downcase b)) (string-lessp a b)))
X
X(defun gnus-date-lessp (date1 date2)
X  "Return T if DATE1 is earlyer than DATE2."
X  (string-lessp (gnus-comparable-date date1)
X		(gnus-comparable-date date2)))
X
X(defun gnus-comparable-date (date)
X  "Make comparable string by string-lessp from DATE."
X  (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3")
X		 ("APR" . " 4")("MAY" . " 5")("JUN" . " 6")
X		 ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9")
X		 ("OCT" . "10")("NOV" . "11")("DEC" . "12")))
X	(date (or date "")))
X    ;; Can understand the following styles:
X    ;; (1) 14 Apr 89 03:20:12 GMT
X    ;; (2) Fri, 17 Mar 89 4:01:33 GMT
X    (if (string-match
X	 "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date)
X	(concat
X	 ;; Year
X	 (substring date (match-beginning 3) (match-end 3))
X	 ;; Month
X	 (cdr
X	  (assoc
X	   (upcase (substring date (match-beginning 2) (match-end 2))) month))
X	 ;; Day
X	 (format "%2d" (string-to-int
X			(substring date
X				   (match-beginning 1) (match-end 1))))
X	 ;; Time
X	 (substring date (match-beginning 4) (match-end 4)))
X      ;; Cannot understand DATE string.
X      date
X      )
X    ))
X
X(defun gnus-fetch-field (field)
X  "Return the value of the header FIELD of current article."
X  (save-excursion
X    (save-restriction
X      (widen)
X      (goto-char (point-min))
X      (narrow-to-region (point-min)
X			(progn (search-forward "\n\n" nil 'move) (point)))
X      (mail-fetch-field field))))
X
X(fset 'gnus-expunge 'gnus-Subject-delete-marked-with)
X
X(defun gnus-kill (field regexp &optional command all)
X  "If FIELD of an article matches REGEXP, execute COMMAND.
XOptional 1st argument COMMAND is default to
X	(gnus-Subject-mark-as-read nil \"X\").
XIf optional 2nd argument ALL is non-nil, articles marked are also applied to.
XIf FIELD is an empty string (or nil), entire article body is searched for.
XCOMMAND must be a lisp expression or a string representing a key sequence."
X  ;; We don't want to change current point nor window configuration.
X  (save-excursion
X    (save-window-excursion
X      ;; Selected window must be Subject mode buffer to execute
X      ;; keyboard macros correctly. See command_loop_1.
X      (switch-to-buffer gnus-Subject-buffer)
X      (goto-char (point-min))		;From the beginning.
X      (if (null command)
X	  (setq command '(gnus-Subject-mark-as-read nil "X")))
X      (gnus-execute field regexp command nil (not all))
X      )))
X
X(defun gnus-execute (field regexp form &optional backward ignore-marked)
X  "If FIELD of article header matches REGEXP, execute lisp FORM (or a string).
XIf FIELD is an empty string (or nil), entire article body is searched for.
XIf optional 1st argument BACKWARD is non-nil, do backward instead.
XIf optional 2nd argument IGNORE-MARKED is non-nil, articles which are
Xmarked as read or unread are ignored."
X  (let ((function nil)
X	(header nil)
X	(article nil))
X    (if (string-equal field "")
X	(setq field nil))
X    (if (null field)
X	nil
X      (or (stringp field)
X	  (setq field (symbol-name field)))
X      ;; Get access function of header filed.
X      (setq function (intern-soft (concat "gnus-header-" (downcase field))))
X      (if (and function (fboundp function))
X	  (setq function (symbol-function function))
X	(error "Unknown header field: \"%s\"" field)))
X    ;; Make FORM funcallable.
X    (if (and (listp form) (not (eq (car form) 'lambda)))
X	(setq form (list 'lambda nil form)))
X    ;; Starting from the current article.
X    (or (and ignore-marked
X	     ;; Articles marked as read and unread should be ignored.
X	     (setq article (gnus-Subject-article-number))
X	     (or (not (memq article gnus-newsgroup-unreads)) ;Marked as read.
X		 (memq article gnus-newsgroup-marked) ;Marked as unread.
X		 ))
X	(gnus-execute-1 function regexp form))
X    (while (gnus-Subject-search-subject backward ignore-marked nil)
X      (gnus-execute-1 function regexp form))
X    ))
X
X(defun gnus-execute-1 (function regexp form)
X  (save-excursion
X    ;; The point of Subject mode buffer must be saved during execution.
X    (let ((article (gnus-Subject-article-number)))
X      (if (null article)
X	  nil				;Nothing to do.
X	(if function
X	    ;; Compare with header field.
X	    (let ((header (gnus-find-header-by-number
X			   gnus-newsgroup-headers article))
X		  (value nil))
X	      (and header
X		   (progn
X		     (setq value (funcall function header))
X		     ;; Number (Lines:) or symbol must be converted to string.
X		     (or (stringp value)
X			 (setq value (prin1-to-string value)))
X		     (string-match regexp value))
X		   (if (stringp form)	;Keyboard macro.
X		       (execute-kbd-macro form)
X		     (funcall form))))
X	  ;; Search article body.
X	  (let ((gnus-current-article nil) ;Save article pointer.
X		(gnus-last-article nil)
X		(gnus-break-pages nil)	;No need to break pages.
X		(gnus-Mark-article-hook nil)) ;Inhibit marking as read.
X	    (message "Searching for article: %d..." article)
X	    (gnus-Article-setup-buffer)
X	    (gnus-Article-prepare article t)
X	    (if (save-excursion
X		  (set-buffer gnus-Article-buffer)
X		  (goto-char (point-min))
X		  (re-search-forward regexp nil t))
X		(if (stringp form)	;Keyboard macro.
X		    (execute-kbd-macro form)
X		  (funcall form))))
X	  ))
X      )))
X
X;;; caesar-region written by phr@prep.ai.mit.edu  Nov 86
X;;; modified by tower@prep Nov 86
X;;; Modified by umerin@flab.flab.Fujitsu.JUNET for ROT47.
X
X(defun gnus-caesar-region (&optional n)
X  "Caesar rotation of region by N, default 13, for decrypting netnews.
XROT47 will be performed for Japanese text in any case."
X  (interactive (if current-prefix-arg	; Was there a prefix arg?
X		   (list (prefix-numeric-value current-prefix-arg))
X		 (list nil)))
X  (cond ((not (numberp n)) (setq n 13))
X	((< n 0) (setq n (- 26 (% (- n) 26))))
X	(t (setq n (% n 26))))		;canonicalize N
X  (if (not (zerop n))		; no action needed for a rot of 0
X      (progn
X	(if (or (not (boundp 'caesar-translate-table))
X		(/= (aref caesar-translate-table ?a) (+ ?a n)))
X	    (let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper)
X	      (message "Building caesar-translate-table...")
X	      (setq caesar-translate-table (make-vector 256 0))
X	      (while (< i 256)
X		(aset caesar-translate-table i i)
X		(setq i (1+ i)))
X	      (setq lower (concat lower lower) upper (upcase lower) i 0)
X	      (while (< i 26)
X		(aset caesar-translate-table (+ ?a i) (aref lower (+ i n)))
X		(aset caesar-translate-table (+ ?A i) (aref upper (+ i n)))
X		(setq i (1+ i)))
X	      ;; ROT47 for Japanese text.
X	      ;; Thanks to ichikawa@flab.fujitsu.junet.
X	      (setq i 161)
X	      (let ((t1 (logior ?O 128))
X		    (t2 (logior ?! 128))
X		    (t3 (logior ?~ 128)))
X		(while (< i 256)
X		  (aset caesar-translate-table i
X			(let ((v (aref caesar-translate-table i)))
X			  (if (<= v t1) (if (< v t2) v (+ v 47))
X			    (if (<= v t3) (- v 47) v))))
X		  (setq i (1+ i))))
X	      (message "Building caesar-translate-table... done")))
X	(let ((from (region-beginning))
X	      (to (region-end))
X	      (i 0) str len)
X	  (setq str (buffer-substring from to))
X	  (setq len (length str))
X	  (while (< i len)
X	    (aset str i (aref caesar-translate-table (aref str i)))
X	    (setq i (1+ i)))
X	  (goto-char from)
X	  (delete-region from to)
X	  (insert str)))))
X
X;; Functions accessing headers.
X;; Functions are more convenient than macros in some case.
X
X(defun gnus-header-number (header)
X  "Return article number in HEADER."
X  (nntp-header-number header))
X
X(defun gnus-header-subject (header)
X  "Return subject string in HEADER."
X  (nntp-header-subject header))
X
X(defun gnus-header-from (header)
X  "Return author string in HEADER."
X  (nntp-header-from header))
X
X(defun gnus-header-xref (header)
X  "Return xref string in HEADER."
X  (nntp-header-xref header))
X
X(defun gnus-header-lines (header)
X  "Return lines in HEADER."
X  (nntp-header-lines header))
X
X(defun gnus-header-date (header)
X  "Return date in HEADER."
X  (nntp-header-date header))
X
X(defun gnus-header-id (header)
X  "Return date in HEADER."
X  (nntp-header-id header))
X
X
X;;;
X;;; Article savers.
X;;;
X
X(defun gnus-output-to-rmail (file-name)
X  "Append the current article to an Rmail file named FILE-NAME."
X  (require 'rmail)
X  ;; Most of these codes are borrowed from rmailout.el.
X  (setq file-name (expand-file-name file-name))
X  (setq rmail-last-rmail-file file-name)
X  (let ((artbuf (current-buffer))
X	(tmpbuf (get-buffer-create " *GNUS-output*")))
X    (save-excursion
X      (or (get-file-buffer file-name)
X	  (file-exists-p file-name)
X	  (if (yes-or-no-p
X	       (concat "\"" file-name "\" does not exist, create it? "))
X	      (let ((file-buffer (create-file-buffer file-name)))
X		(save-excursion
X		  (set-buffer file-buffer)
X		  (rmail-insert-rmail-file-header)
X		  (let ((require-final-newline nil))
X		    (write-region (point-min) (point-max) file-name t 1)))
X		(kill-buffer file-buffer))
X	    (error "Output file does not exist")))
X      (set-buffer tmpbuf)
X      (buffer-flush-undo (current-buffer))
X      (erase-buffer)
X      (insert-buffer-substring artbuf)
X      (gnus-convert-article-to-rmail)
X      ;; Decide whether to append to a file or to an Emacs buffer.
X      (let ((outbuf (get-file-buffer file-name)))
X	(if (not outbuf)
X	    (append-to-file (point-min) (point-max) file-name)
X	  ;; File has been visited, in buffer OUTBUF.
X	  (set-buffer outbuf)
X	  (let ((buffer-read-only nil)
X		(msg (and (boundp 'rmail-current-message)
X			  rmail-current-message)))
X	    ;; If MSG is non-nil, buffer is in RMAIL mode.
X	    (if msg
X		(progn (widen)
X		       (narrow-to-region (point-max) (point-max))))
X	    (insert-buffer-substring tmpbuf)
X	    (if msg
X		(progn
X		  (goto-char (point-min))
X		  (widen)
X		  (search-backward "\^_")
X		  (narrow-to-region (point) (point-max))
X		  (goto-char (1+ (point-min)))
X		  (rmail-count-new-messages t)
X		  (rmail-show-message msg))))))
X      )
X    (kill-buffer tmpbuf)
X    ))
X
X(defun gnus-output-to-file (file-name)
X  "Append the current article to a file named FILE-NAME."
X  (setq file-name (expand-file-name file-name))
X  (let ((artbuf (current-buffer))
X	(tmpbuf (get-buffer-create " *GNUS-output*")))
X    (save-excursion
X      (set-buffer tmpbuf)
X      (buffer-flush-undo (current-buffer))
X      (erase-buffer)
X      (insert-buffer-substring artbuf)
X      ;; Append newline at end of the buffer as separator, and then
X      ;; save it to file.
X      (goto-char (point-max))
X      (insert "\n")
X      (append-to-file (point-min) (point-max) file-name))
X    (kill-buffer tmpbuf)
X    ))
X
X(defun gnus-convert-article-to-rmail ()
X  "Convert article in current buffer to Rmail message format."
X  (let ((buffer-read-only nil))
X    ;; Insert special header of Unix mail.
X    (goto-char (point-min))
X    (insert "From "
X	    (or (mail-strip-quoted-names (mail-fetch-field "from"))
X		"unknown")
X	    " " (current-time-string) "\n")
X    ;; ``Quote'' "\nFrom " as "\n>From "
X    ;;  (note that this isn't really quoting, as there is no requirement
X    ;;   that "\n[>]+From " be quoted in the same transparent way.)
X    (while (search-forward "\nFrom " nil t)
X      (forward-char -5)
X      (insert ?>))
X    ;; Convert article to babyl format.
X    (rmail-convert-to-babyl-format)
X    ))
X
X
X;;;
X;;; Internal functions.
X;;;
X
X(defun gnus-start-news-server (&optional confirm)
X  "Open network stream to remote NNTP server.
XIf optional argument CONFIRM is non-nil, ask you host that NNTP server
Xis running even if it is defined."
X  (if (gnus-server-opened)
X      ;; Stream is already opened.
X      nil
X    ;; Open NNTP server.
X    (if (or confirm
X	    (null gnus-nntp-server))
X	(if (and (boundp 'gnus-secondary-servers) gnus-secondary-servers)
X	    ;; Read server name with completion.
X	    (setq gnus-nntp-server
X		  (completing-read "NNTP server: "
X				   (cons (list gnus-nntp-server)
X					 gnus-secondary-servers)
X				   nil nil gnus-nntp-server))
X	  (setq gnus-nntp-server
X		(read-string "NNTP server: " gnus-nntp-server))))
X    ;; If no server name is given, local host is assumed.
X    (if (string-equal gnus-nntp-server "")
X	(setq gnus-nntp-server (system-name)))
X    (cond ((string-match ":" gnus-nntp-server)
X	   ;; :DIRECTORY
X	   (require 'mhspool)
X	   (gnus-define-access-method 'mhspool)
X	   (message "Looking up private directory..."))
X	  ((and (null gnus-nntp-service)
X	        (string-equal gnus-nntp-server (system-name)))
X	   (require 'nnspool)
X	   (gnus-define-access-method 'nnspool)
X	   (message "Looking up local news spool..."))
X	  (t
X	   (gnus-define-access-method 'nntp)
X	   (message "Connecting to NNTP server on %s..." gnus-nntp-server)))
X    (cond ((gnus-open-server gnus-nntp-server gnus-nntp-service))
X	  ((and (stringp (gnus-status-message))
X		(> (length (gnus-status-message)) 0))
X	   ;; Show valuable message if available.
X	   (error (gnus-status-message)))
X	  (t (error "Cannot open NNTP server on %s" gnus-nntp-server)))
X    ))
X
X;; Dummy functions used only once. Should return nil.
X(defun gnus-server-opened () nil)
X(defun gnus-close-server () nil)
X
X(defun gnus-define-access-method (method)
X  "Define access functions for the access METHOD (nntp, nnspool, or mhspool)."
X  (let ((bindings (cdr (assoc method gnus-access-methods))))
X    (if (null bindings)
X	(error "Unknown access method: %s" method)
X      (while bindings
X	(fset (car (car bindings)) (symbol-function (cdr (car bindings))))
X	(setq bindings (cdr bindings)))
X      )))
X
X(defun gnus-select-newsgroup (group &optional show-all)
SHAR_EOF
echo "End of part 4, continue with part 5"
echo "5" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 5 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.el continued
#
CurArch=5
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.el
X  "Select newsgroup GROUP.
XIf optional argument SHOW-ALL is non-nil, all of articles in the group
Xare selected."
X  (if (gnus-request-group group)
X      (let ((articles nil))
X	(setq gnus-newsgroup-name group)
X	(setq gnus-newsgroup-unreads
X	      (gnus-uncompress-sequence
X	       (nthcdr 2 (gnus-gethash group gnus-unread-hashtb))))
X	(cond (show-all
X	       ;; Select all active articles.
X	       (setq articles
X		     (gnus-uncompress-sequence
X		      (nthcdr 2 (gnus-gethash group gnus-active-hashtb)))))
X	      (t
X	       ;; Select unread articles only.
X	       (setq articles gnus-newsgroup-unreads)))
X	;; Require confirmation if selecting large newsgroup.
X	(setq gnus-newsgroup-unselected nil)
X	(if (not (numberp gnus-large-newsgroup))
X	    nil
X	  (let ((selected nil)
X		(number (length articles)))
X	    (if (> number gnus-large-newsgroup)
X		(progn
X		  (condition-case ()
X		      (let ((input
X			     (read-string
X			      (format
X			       "How many articles from %s (default %d): "
X			       gnus-newsgroup-name number))))
X			(setq selected
X			      (if (string-equal input "")
X				  number (string-to-int input))))
X		    (quit
X		     (setq selected 0)))
X		  (cond ((and (> selected 0)
X			      (< selected number))
X			 ;; Select last N articles.
X			 (setq articles (nthcdr (- number selected) articles)))
X			((and (< selected 0)
X			      (< (- 0 selected) number))
X			 ;; Select first N articles.
X			 (setq selected (- 0 selected))
X			 (setq articles (copy-sequence articles))
X			 (setcdr (nthcdr (1- selected) articles) nil))
X			((zerop selected)
X			 (setq articles nil))
X			;; Otherwise select all.
X			)
X		  ;; Get unselected unread articles.
X		  (setq gnus-newsgroup-unselected
X			(gnus-set-difference gnus-newsgroup-unreads articles))
X		  ))
X	    ))
X	;; Get headers list.
X	(setq gnus-newsgroup-headers (gnus-retrieve-headers articles))
X	;; UNREADS may contain expired articles, so we have to remove
X	;;  them from the list.
X	(setq gnus-newsgroup-unreads
X	      (gnus-intersection gnus-newsgroup-unreads
X				 (mapcar
X				  (function
X				   (lambda (header)
X				     (nntp-header-number header)))
X				  gnus-newsgroup-headers)))
X	;; Marked article must be a subset of unread articles.
X	(setq gnus-newsgroup-marked
X	      (gnus-intersection (append gnus-newsgroup-unselected
X					 gnus-newsgroup-unreads)
X				 (cdr (assoc group gnus-marked-assoc))))
X	;; First and last article in this newsgroup.
X	(setq gnus-newsgroup-begin
X	      (if gnus-newsgroup-headers
X		  (nntp-header-number (car gnus-newsgroup-headers))
X		0
X		))
X	(setq gnus-newsgroup-end
X	      (if gnus-newsgroup-headers
X		  (nntp-header-number
X		   (gnus-last-element gnus-newsgroup-headers))
X		0
X		))
X	;; File name that an article was saved last.
X	(setq gnus-newsgroup-last-rmail nil)
X	(setq gnus-newsgroup-last-mail nil)
X	(setq gnus-newsgroup-last-folder nil)
X	(setq gnus-newsgroup-last-file nil)
X	;; Reset article pointer etc.
X	(setq gnus-current-article nil)
X	(setq gnus-current-headers nil)
X	(setq gnus-current-history nil)
X	(setq gnus-have-all-headers nil)
X	(setq gnus-last-article nil)
X	;; GROUP is successfully selected.
X	t
X	)
X    ))
X
X(defun gnus-mark-article-as-read (article)
X  "Remember that ARTICLE is marked as read."
X  ;; Remove from unread and marked list.
X  (setq gnus-newsgroup-unreads
X	(delq article gnus-newsgroup-unreads))
X  (setq gnus-newsgroup-marked
X	(delq article gnus-newsgroup-marked)))
X
X(defun gnus-mark-article-as-unread (article &optional clear-mark)
X  "Remember that ARTICLE is marked as unread.
XOptional argument CLEAR-MARK means ARTICLE should not be remembered
Xthat it was marked as read once."
X  ;; Add to unread list.
X  (or (memq article gnus-newsgroup-unreads)
X      (setq gnus-newsgroup-unreads
X	    (cons article gnus-newsgroup-unreads)))
X  ;; If CLEAR-MARK is non-nil, the article must be removed from marked
X  ;; list.  Otherwise, it must be added to the list.
X  (if clear-mark
X      (setq gnus-newsgroup-marked
X	    (delq article gnus-newsgroup-marked))
X    (or (memq article gnus-newsgroup-marked)
X	(setq gnus-newsgroup-marked
X	      (cons article gnus-newsgroup-marked)))))
X
X(defun gnus-clear-system ()
X  "Clear all variables and buffer."
X  ;; Clear GNUS variables.
X  (let ((variables gnus-variable-list))
X    (while variables
X      (set (car variables) nil)
X      (setq variables (cdr variables))))
X  ;; Clear other internal variables.
X  (setq gnus-active-hashtb nil)
X  (setq gnus-unread-hashtb nil)
X  ;; Kill the startup file.
X  (and gnus-current-startup-file
X       (get-file-buffer gnus-current-startup-file)
X       (kill-buffer (get-file-buffer gnus-current-startup-file)))
X  (setq gnus-current-startup-file nil)
X  ;; Kill GNUS buffers.
X  (let ((buffers gnus-buffer-list))
X    (while buffers
X      (if (get-buffer (car buffers))
X	  (kill-buffer (car buffers)))
X      (setq buffers (cdr buffers))
X      ))
X  )
X
X(defun gnus-configure-windows (action)
X  "Configure GNUS windows according to the next ACTION.
XThe ACTION is one of `SelectNewsgroup', `SelectArticle', `ExitNewsgroup',
Xand `ExpandSubject'.
XWindow configuration is specified by the variable gnus-window-configuration."
X  (let* ((windows (car (cdr (assq action gnus-window-configuration))))
X	 (grpwin (get-buffer-window gnus-Group-buffer))
X	 (subwin (get-buffer-window gnus-Subject-buffer))
X	 (artwin (get-buffer-window gnus-Article-buffer))
X	 (winsum nil)
X	 (height nil)
X	 (grpheight 0)
X	 (subheight 0)
X	 (artheight 0))
X    (if (or (null windows)		;No configuration is specified.
X	    (and (eq (null grpwin)
X		     (zerop (nth 0 windows)))
X		 (eq (null subwin)
X		     (zerop (nth 1 windows)))
X		 (eq (null artwin)
X		     (zerop (nth 2 windows)))))
X	;; No need to change window configuration.
X	nil
X      (select-window (or grpwin subwin artwin (selected-window)))
X      ;; First of all, compute the height of each window.
X      (cond (gnus-use-full-window
X	     ;; Take up the entire screen.
X	     (delete-other-windows)
X	     (setq height (window-height (selected-window))))
X	    (t
X	     (setq height (+ (if grpwin (window-height grpwin) 0)
X			     (if subwin (window-height subwin) 0)
X			     (if artwin (window-height artwin) 0)))))
X      ;; The Newsgroup buffer exits always. So, use it to extend the
X      ;; Group window so as to get enough window space.
X      (switch-to-buffer gnus-Group-buffer)
X      (and (get-buffer gnus-Subject-buffer)
X	   (delete-windows-on gnus-Subject-buffer))
X      (and (get-buffer gnus-Article-buffer)
X	   (delete-windows-on gnus-Article-buffer))
X      ;; Compute expected window height.
X      (setq winsum (apply (function +) windows))
X      (if (not (zerop (nth 0 windows)))
X	  (setq grpheight (max window-min-height
X			       (/ (* height (nth 0 windows)) winsum))))
X      (if (not (zerop (nth 1 windows)))
X	  (setq subheight (max window-min-height
X			       (/ (* height (nth 1 windows)) winsum))))
X      (if (not (zerop (nth 2 windows)))
X	  (setq artheight (max window-min-height
X			       (/ (* height (nth 2 windows)) winsum))))
X      (setq height (+ grpheight subheight artheight))
X      (enlarge-window (max 0 (- height (window-height (selected-window)))))
X      ;; Then split the window.
X      (and (not (zerop artheight))
X	   (or (not (zerop grpheight))
X	       (not (zerop subheight)))
X	   (split-window-vertically (+ grpheight subheight)))
X      (and (not (zerop grpheight))
X	   (not (zerop subheight))
X	   (split-window-vertically grpheight))
X      ;; Then select buffers in each window.
X      (and (not (zerop grpheight))
X	   (progn
X	     (switch-to-buffer gnus-Group-buffer)
X	     (other-window 1)))
X      (and (not (zerop subheight))
X	   (progn
X	     ;; We have to prepare Article buffer first to prevent
X	     ;; displaying subject buffer twice.
X	     ;; Suggested by Juha Heinanen <jh@tut.fi>
X	     ;;(or (zerop artheight)
X	     ;;    (gnus-Article-setup-buffer))
X	     (switch-to-buffer gnus-Subject-buffer)
X	     (other-window 1)))
X      (and (not (zerop artheight))
X	   (progn
X	     (gnus-Article-setup-buffer)
X	     (switch-to-buffer gnus-Article-buffer)))
X      )
X    ))
X
X(defun gnus-find-header-by-number (headers number)
X  "Return a header which is a element of HEADERS and has NUMBER."
X  (let ((found nil))
X    (while (and headers (not found))
X      ;; We cannot use `=' to accept non-numeric NUMBER.
X      (if (eq number (nntp-header-number (car headers)))
X	  (setq found (car headers)))
X      (setq headers (cdr headers)))
X    found
X    ))
X
X(defun gnus-version ()
X  "Version numbers of this version of GNUS."
X  (interactive)
X  (cond ((and (boundp 'mhspool-version) (boundp 'nnspool-version))
X	 (message "%s; %s; %s; %s"
X		  gnus-version nntp-version nnspool-version mhspool-version))
X	((boundp 'mhspool-version)
X	 (message "%s; %s; %s"
X		  gnus-version nntp-version mhspool-version))
X	((boundp 'nnspool-version)
X	 (message "%s; %s; %s"
X		  gnus-version nntp-version nnspool-version))
X	(t
X	 (message "%s; %s" gnus-version nntp-version))))
X
X(defun gnus-Info-find-node ()
X  "Find Info documentation of GNUS."
X  (interactive)
X  (require 'info)
X  ;; Enlarge info window.
X  (if (eq major-mode 'gnus-Subject-mode)
X      (progn
X	(gnus-configure-windows 'ExpandSubject)
X	(pop-to-buffer gnus-Subject-buffer)))
X  (let ((Info-directory (expand-file-name gnus-Info-directory nil)))
X    (Info-goto-node (cdr (assq major-mode gnus-Info-nodes)))))
X
X(defun gnus-replace-functions ()
X  "Replace some functions defined in rnews.el and rnewspost.el."
X  ;; Override news-inews function in rnewspost.el.
X  (fset 'news-inews 'gnus-inews-news)
X  ;; Override caesar-region function in rnews.el.
X  (fset 'caesar-region 'gnus-caesar-region))
X
X(defun gnus-narrow-to-page (&optional arg)
X  "Make text outside current page invisible except for page delimiter.
XA numeric arg specifies to move forward or backward by that many pages,
Xthus showing a page other than the one point was originally in."
X  (interactive "P")
X  (setq arg (if arg (prefix-numeric-value arg) 0))
X  (save-excursion
X    (forward-page -1) ;Beginning of current page.
X    (widen)
X    (if (> arg 0)
X	(forward-page arg)
X      (if (< arg 0)
X	  (forward-page (1- arg))))
X    ;; Find the end of the page.
X    (forward-page)
X    ;; If we stopped due to end of buffer, stay there.
X    ;; If we stopped after a page delimiter, put end of restriction
X    ;; at the beginning of that line.
X    ;; These are commented out.
X    ;;    (if (save-excursion (beginning-of-line)
X    ;;			(looking-at page-delimiter))
X    ;;	(beginning-of-line))
X    (let ((end (point-max)))
X      (narrow-to-region (point)
X			(progn
X			  ;; Find the top of the page.
X			  (forward-page -1)
X			  ;; If we found beginning of buffer, stay there.
X			  ;; If extra text follows page delimiter on same line,
X			  ;; include it.
X			  ;; Otherwise, show text starting with following line.
X			  (if (and (eolp) (not (bobp)))
X			      (forward-line 1))
X			  (point)))
X      (if (and gnus-break-pages overlay-arrow-string)
X	  ;; Show MORE message at end of the page except for last page.
X	  (if (/= (point-max) end)
X	      (set-marker overlay-arrow-position
X			  (progn (goto-char (point-max))
X				 (beginning-of-line)
X				 (point)))
X	    (set-marker overlay-arrow-position nil)))
X      )))
X
X(defun gnus-last-element (list)
X  "Return last element of LIST."
X  (let ((last nil))
X    (while list
X      (if (null (cdr list))
X	  (setq last (car list)))
X      (setq list (cdr list)))
X    last
X    ))
X
X(defun gnus-set-difference (list1 list2)
X  "Return a list of elements of LIST1 that do not appear in LIST2."
X  (let ((list1 (copy-sequence list1)))
X    (while list2
X      (setq list1 (delq (car list2) list1))
X      (setq list2 (cdr list2)))
X    list1
X    ))
X
X(defun gnus-intersection (list1 list2)
X  "Return a list of elements that appear in both LIST1 and LIST2."
X  (let ((result nil))
X    (while list2
X      (if (memq (car list2) list1)
X	  (setq result (cons (car list2) result)))
X      (setq list2 (cdr list2)))
X    result
X    ))
X
X
X;;;
X;;; Get information about active articles, already read articles, and
X;;;  still unread articles.
X;;;
X
X;; GNUS internal format of gnus-newsrc-assoc and gnus-killed-assoc:
X;; (("general" t (1 . 1))
X;;  ("misc"    t (1 . 10) (12 . 15))
X;;  ("test"  nil (1 . 99)) ...)
X;; GNUS internal format of gnus-marked-assoc:
X;; (("general" 1 2 3)
X;;  ("misc" 2) ...)
X;; GNUS internal format of gnus-active-hashtb:
X;; (("general" t (1 . 1))
X;;  ("misc"    t (1 . 10))
X;;  ("test"  nil (1 . 99)) ...)
X;; GNUS internal format of gnus-unread-hashtb:
X;; (("general" 1 (1 . 1))
X;;  ("misc"   14 (1 . 10) (12 . 15))
X;;  ("test"   99 (1 . 99)) ...)
X
X(defun gnus-setup-news-info (&optional rawfile)
X  "Setup news information.
XIf optional argument RAWFILE is non-nil, force to read raw startup file."
X  (let ((init (not (and gnus-newsrc-assoc
X			gnus-active-hashtb
X			gnus-unread-hashtb
X			(not rawfile)
X			))))
X    ;; We have to clear some variables to re-initialize news info.
X    (if init
X	(setq gnus-newsrc-assoc nil
X	      gnus-active-hashtb nil
X	      gnus-unread-hashtb nil))
X    (if init
X	(gnus-read-newsrc-file rawfile))
X    (gnus-read-active-file)
X    (if init
X	(gnus-add-new-newsgroups))
X    (gnus-expire-marked-articles)
X    (gnus-get-unread-articles)
X    ))
X
X(defun gnus-make-newsrc-file (file)
X  "Make server dependent file name by catenating FILE and server host name."
X  (let* ((file (expand-file-name file nil))
X	 (real-file (concat file "-" gnus-nntp-server)))
X    (if (file-exists-p real-file)
X	real-file file)
X    ))
X
X(defun gnus-get-unread-articles ()
X  "Compute diffs between active and read articles."
X  (let ((read gnus-newsrc-assoc)
X	(group-info nil)
X	(group-name nil)
X	(active nil)
X	(range nil))
X    (message "Checking new news...")
X    (or gnus-unread-hashtb
X	(setq gnus-unread-hashtb (gnus-make-hashtable)))
X    (while read
X      (setq group-info (car read))	;About one newsgroup
X      (setq group-name (car group-info))
X      (setq active (nth 2 (gnus-gethash group-name gnus-active-hashtb)))
X      (if (and gnus-octive-hashtb
X	       ;; Is nothing changed?
X	       (equal active
X		      (nth 2 (gnus-gethash group-name gnus-octive-hashtb)))
X	       ;; Is this newsgroup in the unread hash table?
X	       (gnus-gethash group-name gnus-unread-hashtb)
X	       )
X	  nil				;Nothing to do.
X	(setq range (gnus-difference-of-range active (nthcdr 2 group-info)))
X	(gnus-sethash group-name
X		      (cons group-name	;Group name
X			    (cons (gnus-number-of-articles range)
X				  range)) ;Range of unread articles
X		      gnus-unread-hashtb)
X	)
X      (setq read (cdr read))
X      )
X    (message "Checking new news... done")
X    ))
X
X(defun gnus-expire-marked-articles ()
X  "Check expired article which is marked as unread."
X  (let ((marked-assoc gnus-marked-assoc)
X	(updated-assoc nil)
X	(marked nil)			;Current marked info.
X	(articles nil)			;List of marked articles.
X	(updated nil)			;List of real marked.
X	(begin nil))
X    (while marked-assoc
X      (setq marked (car marked-assoc))
X      (setq articles (cdr marked))
X      (setq updated nil)
X      (setq begin
X	    (car (nth 2 (gnus-gethash (car marked) gnus-active-hashtb))))
X      (while (and begin articles)
X	(if (>= (car articles) begin)
X	    ;; This article is still active.
X	    (setq updated (cons (car articles) updated)))
X	(setq articles (cdr articles)))
X      (if updated
X	  (setq updated-assoc
X		(cons (cons (car marked) updated) updated-assoc)))
X      (setq marked-assoc (cdr marked-assoc)))
X    (setq gnus-marked-assoc updated-assoc)
X    ))
X
X(defun gnus-mark-as-read-by-xref (group headers unreads)
X  "Mark as read using cross reference info. of GROUP with HEADERS and UNREADS.
XReturn list of updated newsgroup."
X  (let ((xref-list nil)
X	(header nil)
X	(xrefs nil)			;One Xref: field info.
X	(xref nil)			;(NEWSGROUP . ARTICLE)
X	(gname nil)			;Newsgroup name
X	(article nil))			;Article number
X    (while headers
X      (setq header (car headers))
X      (if (memq (nntp-header-number header) unreads)
X	  ;; This article is not yet marked as read.
X	  nil
X	(setq xrefs (gnus-parse-xref-field (nntp-header-xref header)))
X	;; For each cross reference info. in one Xref: field.
X	(while xrefs
X	  (setq xref (car xrefs))
X	  (setq gname (car xref))	;Newsgroup name
X	  (setq article (cdr xref))	;Article number
X	  (or (string-equal group gname) ;Ignore current group.
X	      ;; Ignore article marked as unread.
X	      (memq article (cdr (assoc gname gnus-marked-assoc)))
X	      (let ((group-xref (assoc gname xref-list)))
X		(if group-xref
X		    (if (memq article (cdr group-xref))
X			nil		;Alread marked.
X		      (setcdr group-xref (cons article (cdr group-xref))))
X		  ;; Create new assoc entry for GROUP.
X		  (setq xref-list (cons (list gname article) xref-list)))
X		))
X	  (setq xrefs (cdr xrefs))
X	  ))
X      (setq headers (cdr headers)))
X    ;; Mark cross referenced articles as read.
X    (gnus-mark-xrefed-as-read xref-list)
X    ;;(message "%s %s" (prin1-to-string unreads) (prin1-to-string xref-list))
X    ;; Return list of updated group name.
X    (mapcar (function car) xref-list)
X    ))
X
X(defun gnus-parse-xref-field (xref-value)
X  "Parse Xref: field value, and return list of `(group . article-id)'."
X  (let ((xref-list nil)
X	(xref-value (or xref-value "")))
X    ;; Remove server host name.
X    (if (string-match "^[ \t]*[^ \t,]+[ \t,]+\\(.*\\)$" xref-value)
X	(setq xref-value (substring xref-value (match-beginning 1)))
X      (setq xref-value nil))
X    ;; Process each xref info.
X    (while xref-value
X      (if (string-match
X	   "^[ \t,]*\\([^ \t,]+\\):\\([0-9]+\\)[^0-9]*" xref-value)
X	  (progn
X	    (setq xref-list
X		  (cons
X		   (cons
X		    ;; Group name
X		    (substring xref-value (match-beginning 1) (match-end 1))
X		    ;; Article-ID
X		    (string-to-int
X		     (substring xref-value (match-beginning 2) (match-end 2))))
X		   xref-list))
X	    (setq xref-value (substring xref-value (match-end 2))))
X	(setq xref-value nil)))
X    ;; Return alist.
X    xref-list
X    ))
X
X(defun gnus-mark-xrefed-as-read (xrefs)
X  "Update unread article information using XREFS alist."
X  (let ((group nil)
X	(idlist nil)
X	(unread nil))
X    (while xrefs
X      (setq group (car (car xrefs)))
X      (setq idlist (cdr (car xrefs)))
X      (setq unread (gnus-uncompress-sequence
X		    (nthcdr 2 (gnus-gethash group gnus-unread-hashtb))))
X      (while idlist
X	(setq unread (delq (car idlist) unread))
X	(setq idlist (cdr idlist)))
X      (gnus-update-unread-articles group unread 'ignore)
X      (setq xrefs (cdr xrefs))
X      )))
X
X(defun gnus-update-unread-articles (group unread-list marked-list)
X  "Update unread articles of GROUP using UNREAD-LIST and MARKED-LIST."
X  (let ((active (nth 2 (gnus-gethash group gnus-active-hashtb)))
X	(unread (gnus-gethash group gnus-unread-hashtb)))
X    (if (or (null active) (null unread))
X	;; Ignore unknown newsgroup.
X	nil
X      ;; Update gnus-unread-hashtb.
X      (if unread-list
X	  (setcdr (cdr unread)
X		  (gnus-compress-sequence unread-list))
X	;; All of the articles are read.
X	(setcdr (cdr unread) '((0 . 0))))
X      ;; Number of unread articles.
X      (setcar (cdr unread)
X	      (gnus-number-of-articles (nthcdr 2 unread)))
X      ;; Update gnus-newsrc-assoc.
X      (if (> (car active) 0)
X	  ;; Articles from 1 to N are not active.
X	  (setq active (cons 1 (cdr active))))
X      (setcdr (cdr (assoc group gnus-newsrc-assoc))
X	      (gnus-difference-of-range active (nthcdr 2 unread)))
X      ;; Update .newsrc buffer.
X      (gnus-update-newsrc-buffer group)
X      ;; Update gnus-marked-assoc.
X      (if (listp marked-list)		;Includes NIL.
X	  (let ((marked (assoc group gnus-marked-assoc)))
X	    (cond (marked
X		   (setcdr marked marked-list))
X		  (marked-list		;Non-NIL.
X		   (setq gnus-marked-assoc
X			 (cons (cons group marked-list)
X			       gnus-marked-assoc)))
X		  )))
X      )))
X
X(defun gnus-compress-sequence (numbers)
X  "Convert list of sorted numbers to ranges."
X  (let* ((numbers (sort (copy-sequence numbers) (function <)))
X	 (first (car numbers))
X	 (last (car numbers))
X	 (result nil))
X    (while numbers
X      (cond ((= last (car numbers)) nil) ;Omit duplicated number
X	    ((= (1+ last) (car numbers)) ;Still in sequence
X	     (setq last (car numbers)))
X	    (t				;End of one sequence
X	     (setq result (cons (cons first last) result))
X	     (setq first (car numbers))
X	     (setq last  (car numbers)))
X	    )
X      (setq numbers (cdr numbers))
X      )
X    (nreverse (cons (cons first last) result))
X    ))
X
X(defun gnus-uncompress-sequence (ranges)
X  "Expand compressed format of sequence."
X  (let ((first nil)
X	(last  nil)
X	(result nil))
X    (while ranges
X      (setq first (car (car ranges)))
X      (setq last  (cdr (car ranges)))
X      (while (< first last)
X	(setq result (cons first result))
X	(setq first (1+ first)))
X      (setq result (cons first result))
X      (setq ranges (cdr ranges))
X      )
X    (nreverse result)
X    ))
X
X(defun gnus-number-of-articles (range)
X  "Compute number of articles from RANGE `((beg1 . end1) (beg2 . end2) ...)'."
X  (let ((count 0))
X    (while range
X      (if (/= (cdr (car range)) 0)
X	  ;; If end1 is 0, it must be skipped. Usually no articles in
X	  ;;  this group.
X	  (setq count (+ count 1 (- (cdr (car range)) (car (car range))))))
X      (setq range (cdr range))
X      )
X    count				;Result
X    ))
X
X(defun gnus-difference-of-range (src obj)
X  "Compute (SRC - OBJ) on range.
XRange of SRC is expressed as `(beg . end)'.
XRange of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)."
X  (let ((beg (car src))
X	(end (cdr src))
X	(range nil))			;This is result.
X    ;; Src may be nil.
X    (while (and src obj)
X      (let ((beg1 (car (car obj)))
X	    (end1 (cdr (car obj))))
X	(cond ((> beg end)
X	       (setq obj nil))		;Terminate loop
X	      ((< beg beg1)
X	       (setq range (cons (cons beg (min (1- beg1) end)) range))
X	       (setq beg (1+ end1)))
X	      ((>= beg beg1)
X	       (setq beg (max beg (1+ end1))))
X	      )
X	(setq obj (cdr obj))		;Next OBJ
X	))
X    ;; Src may be nil.
X    (if (and src (<= beg end))
X	(setq range (cons (cons beg end) range)))
X    ;; Result
X    (if range
X	(nreverse range)
X      (list (cons 0 0)))
X    ))
X
X(defun gnus-add-new-newsgroup (newsgroup)
X  "Add one new NEWSGROUP."
X  (and (null (assoc newsgroup gnus-newsrc-assoc)) ;Really new?
X       (gnus-gethash newsgroup gnus-active-hashtb) ;Really exist?
X       (gnus-insert-newsgroup (or (assoc newsgroup gnus-killed-assoc)
X				  (list newsgroup t))
X			      (car (car gnus-newsrc-assoc)))))
X
X(defun gnus-add-new-newsgroups ()
X  "Add new newsgroups to gnus-newsrc-assoc.
X`-n' option of options line in .newsrc file is recognized."
X  (let ((group nil))
X    (mapatoms
X     (function
X      (lambda (sym)
X	(setq group (symbol-name sym))
X	;; Taking account of `-n' option.
X	(and (or (null gnus-newsrc-options-n-no)
X		 (not (string-match gnus-newsrc-options-n-no group))
X		 (and gnus-newsrc-options-n-yes
X		      (string-match gnus-newsrc-options-n-yes group)))
X	     (null (assoc group gnus-killed-assoc)) ;Ignore killed.
X	     (null (assoc group gnus-newsrc-assoc)) ;Really new.
X	     ;; Find new newsgroup.
X	     (progn
X	       (setq gnus-newsrc-assoc
X		     (cons (list group t) gnus-newsrc-assoc))
X	       (gnus-update-newsrc-buffer group nil
X					  (car (car (cdr gnus-newsrc-assoc))))
X	       (message "New newsgroup: %s is subscribed" group)
X	       ))
X	))
X     gnus-active-hashtb)
X    ))
X
X(defun gnus-kill-newsgroup (group)
X  "Kill GROUP from gnus-newsrc-assoc and .newsrc."
X  (let ((info (assoc group gnus-newsrc-assoc)))
X    (if (null info)
X	nil
X      ;; Delete from gnus-newsrc-assoc
X      (setq gnus-newsrc-assoc (delq info gnus-newsrc-assoc))
X      ;; Add to gnus-killed-assoc.
X      (setq gnus-killed-assoc
X	    (cons info
X		  (delq (assoc group gnus-killed-assoc) gnus-killed-assoc)))
X      ;; Then delete from .newsrc
X      (gnus-update-newsrc-buffer group 'delete)
X      ;; Return the deleted newsrc entry.
X      info
X      )))
X
X(defun gnus-insert-newsgroup (info &optional next)
X  "Insert newsrc INFO entry before NEXT.
XIf optional argument NEXT is nil, appended to the last."
X  (if (null info)
X      (error "Invalid argument: %s" info))
X  (let* ((group (car info))		;Newsgroup name.
X	 (range
X	  (gnus-difference-of-range
X	   (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info))))
X    ;; Check duplication.
X    (if (assoc group gnus-newsrc-assoc)
X	(error "Dumplicated: %s" group))
X    ;; Insert to gnus-newsrc-assoc.
X    (if (string-equal next (car (car gnus-newsrc-assoc)))
X	(setq gnus-newsrc-assoc
X	      (cons info gnus-newsrc-assoc))
X      (let ((found nil)
X	    (rest gnus-newsrc-assoc)
X	    (tail (cons nil gnus-newsrc-assoc)))
X	;; Seach insertion point.
X	(while (and (not found) rest)
X	  (if (string-equal next (car (car rest)))
X	      (setq found t)
X	    (setq rest (cdr rest))
X	    (setq tail (cdr tail))
X	    ))
X	;; Find it.
X	(setcdr tail nil)
X	(setq gnus-newsrc-assoc
X	      (append gnus-newsrc-assoc (cons info rest)))
X	))
X    ;; Delete from gnus-killed-assoc.
X    (setq gnus-killed-assoc
X	  (delq (assoc group gnus-killed-assoc) gnus-killed-assoc))
X    ;; Then insert to .newsrc.
X    (gnus-update-newsrc-buffer group nil next)
X    ;; Add to gnus-unread-hashtb.
X    (gnus-sethash group
X		  (cons group		;Newsgroup name.
X			(cons (gnus-number-of-articles range) range))
X		  gnus-unread-hashtb)
X    ))
X
X(defun gnus-check-killed-newsgroups ()
X  "Check consistency between gnus-newsrc-assoc and gnus-killed-assoc."
X  (let ((group nil)
X	(new-killed nil)
X	(old-killed gnus-killed-assoc))
X    (while old-killed
X      (setq group (car (car old-killed)))
X      (and (or (null gnus-newsrc-options-n-no)
X	       (not (string-match gnus-newsrc-options-n-no group))
X	       (and gnus-newsrc-options-n-yes
X		    (string-match gnus-newsrc-options-n-yes group)))
X	   (null (assoc group gnus-newsrc-assoc)) ;No duplication.
X	   ;; Subscribed in options line and not in gnus-newsrc-assoc.
X	   (setq new-killed
X		 (cons (car old-killed) new-killed)))
X      (setq old-killed (cdr old-killed))
X      )
X    (setq gnus-killed-assoc (nreverse new-killed))
X    ))
X
X(defun gnus-check-bogus-newsgroups (&optional confirm)
X  "Delete bogus newsgroups.
XIf optional argument CONFIRM is non-nil, confirm deletion of newsgroups."
X  (let ((group nil)			;Newsgroup name temporary used.
X	(old-newsrc gnus-newsrc-assoc)
X	(new-newsrc nil)
X	(bogus nil)			;List of bogus newsgroups.
X	(old-killed gnus-killed-assoc)
X	(new-killed nil)
X	(old-marked gnus-marked-assoc)
X	(new-marked nil))
X    (message "Checking bogus newsgroups...")
X    ;; Update gnus-newsrc-assoc.
X    (while old-newsrc
X      (setq group (car (car old-newsrc)))
X      (if (or (gnus-gethash group gnus-active-hashtb)
X	      (and confirm
X		   (not (y-or-n-p
X			 (format "Delete bogus newsgroup: %s " group)))))
X	  ;; Active newsgroup.
X	  (setq new-newsrc (cons (car old-newsrc) new-newsrc))
X	;; Found a bogus newsgroup.
X	(setq bogus (cons group bogus)))
X      (setq old-newsrc (cdr old-newsrc))
X      )
X    (setq gnus-newsrc-assoc (nreverse new-newsrc))
X    ;; Update gnus-killed-assoc.
X    ;; The killed newsgroups are deleted without any confirmations.
X    (while old-killed
X      (setq group (car (car old-killed)))
X      (and (gnus-gethash group gnus-active-hashtb)
X	   (null (assoc group gnus-newsrc-assoc))
X	   ;; Active and really killed newsgroup.
X	   (setq new-killed (cons (car old-killed) new-killed)))
X      (setq old-killed (cdr old-killed))
X      )
X    (setq gnus-killed-assoc (nreverse new-killed))
X    ;; Remove BOGUS from .newsrc file.
X    (while bogus
X      (gnus-update-newsrc-buffer (car bogus) 'delete)
X      (setq bogus (cdr bogus)))
X    ;; Update gnus-marked-assoc.
X    (while old-marked
X      (setq group (car (car old-marked)))
X      (if (and (cdr (car old-marked))	;Non-empty?
X	       (assoc group gnus-newsrc-assoc))	;Not bogus?
X	  (setq new-marked (cons (car old-marked) new-marked)))
X      (setq old-marked (cdr old-marked)))
X    (setq gnus-marked-assoc new-marked)
X    (message "Checking bogus newsgroups... done")
X    ))
X
X(defun gnus-read-active-file ()
X  "Get active file from NNTP server."
X  (message "Reading active file...")
X  (if (gnus-request-list)		;Get active file from server
X      (save-excursion
X	(set-buffer nntp-server-buffer)
X	;; Save OLD active info.
X	(setq gnus-octive-hashtb gnus-active-hashtb)
X	(setq gnus-active-hashtb (gnus-make-hashtable))
X	(gnus-active-to-gnus-format)
X	(message "Reading active file... done"))
X    (error "Cannot read active file from NNTP server.")))
X
X(defun gnus-active-to-gnus-format ()
X  "Convert active file format to internal format."
X  ;; Delete unnecessary lines.
X  (goto-char (point-min))
X  (delete-matching-lines "^to\\..*$")
X  ;; Store active file in hashtable.
X  (goto-char (point-min))
X  (while
X      (re-search-forward
X       "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([ymn]\\).*$"
X       nil t)
X    (gnus-sethash
X     (buffer-substring (match-beginning 1) (match-end 1))
X     (list (buffer-substring (match-beginning 1) (match-end 1))
X	   (string-equal
X	    "y" (buffer-substring (match-beginning 4) (match-end 4)))
X	   (cons (string-to-int
X		  (buffer-substring (match-beginning 3) (match-end 3)))
X		 (string-to-int
X		  (buffer-substring (match-beginning 2) (match-end 2)))))
X     gnus-active-hashtb)
X    ))
X
X(defun gnus-read-newsrc-file (&optional rawfile)
X  "Read startup FILE.
XIf optional argument RAWFILE is non-nil, the raw startup file is read."
X  (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file))
X  ;; Reset variables which may be included in the quick startup file.
X  (let ((variables gnus-variable-list))
X    (while variables
X      (set (car variables) nil)
X      (setq variables (cdr variables))))
X  (let* ((newsrc-file gnus-current-startup-file)
X	 (quick-file (concat newsrc-file ".el"))
X	 (quick-loaded nil)
X	 (newsrc-mod (nth 5 (file-attributes newsrc-file)))
X	 (quick-mod (nth 5 (file-attributes quick-file))))
X    (save-excursion
X      ;; Prepare .newsrc buffer.
X      (set-buffer (find-file-noselect newsrc-file))
X      ;; It is not so good idea turning off undo.
X      ;;(buffer-flush-undo (current-buffer))
X      ;; Load quick .newsrc to restore gnus-marked-assoc and
X      ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date.
X      (condition-case nil
X	  (setq quick-loaded (load quick-file t t t))
X	(error nil))
X      (cond ((and (not rawfile)		;Not forced to read the raw file.
X		  (or (and (fboundp 'file-newer-than-file-p)
X			   (file-newer-than-file-p quick-file newsrc-file))
X		      (and newsrc-mod quick-mod
X			   ;; .newsrc.el is newer than .newsrc.
X			   ;; Some older version does not support function
X			   ;; `file-newer-than-file-p'.
X			   (or (< (car newsrc-mod) (car quick-mod))
X			       (and (= (car newsrc-mod) (car quick-mod))
X				    (<= (nth 1 newsrc-mod) (nth 1 quick-mod))))
X			   ))
X		  quick-loaded
X		  gnus-newsrc-assoc	;Really loaded?
X		  )
X	     ;; We don't have to read the raw startup file.
X	     )
X	    (t
X	     ;; Since .newsrc file is newer than quick file, read it.
X	     (message "Reading %s..." newsrc-file)
X	     (gnus-newsrc-to-gnus-format)
X	     (gnus-check-killed-newsgroups)
X	     (message "Reading %s... Done" newsrc-file)))
X      )))
X
X(defun gnus-newsrc-to-gnus-format ()
X  "Parse current buffer as .newsrc file."
X  (let ((newsgroup nil)
X	(subscribe nil)
X	(ranges nil)
X	(subrange nil)
X	(read-list nil))
X    ;; We have to re-initialize these variable (except for
X    ;; gnus-marked-assoc and gnus-killed-assoc) because quick startup
X    ;; file may contain bogus values.
X    (setq gnus-newsrc-options nil)
X    (setq gnus-newsrc-options-n-yes nil)
X    (setq gnus-newsrc-options-n-no nil)
X    (setq gnus-newsrc-assoc nil)
X    ;; Save options line to variable.
X    (goto-char (point-min))
X    (if (re-search-forward "^[ \t]*options[ \t]*\\(.*[^ \t\n]\\)[ \t]*$" nil t)
X	(progn
X	  (setq gnus-newsrc-options
X		(buffer-substring (match-beginning 1) (match-end 1)))
X	  ;; Compile "-n" option.
X	  (if (string-match "\\(^\\|[ \t]\\)-n" gnus-newsrc-options)
X	      (let ((options (substring gnus-newsrc-options (match-end 0)))
X		    (yes nil) (no nil)
X		    (yes-or-no nil)
X		    (newsgroup nil))
X		(while
X		    (string-match
X		     "^[ \t]*\\(!?\\)\\([^--- \t][^ \t]*\\)" options)
X		  (setq yes-or-no
X			(substring options (match-beginning 1) (match-end 1)))
X		  (setq newsgroup
X			(regexp-quote
X			 (substring options
X				    (match-beginning 2) (match-end 2))))
X		  (setq options (substring options (match-end 2)))
X		  (cond ((and (string-equal yes-or-no "!")
X			      (string-equal newsgroup "all"))
X			 (setq no (cons ".*" no)))
X			((string-equal yes-or-no "!")
X			 (setq no (cons newsgroup no)))
X			((string-equal newsgroup "all")) ;Ignore `all'.
X			(t
X			 (setq yes (cons newsgroup yes)))
X			))
X		(if yes
X		    (setq gnus-newsrc-options-n-yes
X			  (concat "^\\("
X				  (apply (function concat)
X					 (mapcar
X					  (function
X					   (lambda (newsgroup)
X					     (concat newsgroup "\\|")))
X					  (cdr yes)))
X				  (car yes) "\\)")))
X		(if no
X		    (setq gnus-newsrc-options-n-no
X			  (concat "^\\("
X				  (apply (function concat)
X					 (mapcar
X					  (function
X					   (lambda (newsgroup)
X					     (concat newsgroup "\\|")))
X					  (cdr no)))
X				  (car no) "\\)")))
X		))
X	  ))
X    ;; Parse body of .newsrc file
X    (goto-char (point-min))
X    (while (re-search-forward
X	    "^[ \t]*\\([^!: \t]+\\)[ \t]*\\([!:]\\)[ \t]*\\(.*\\)$" nil t)
X      (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1)))
X      ;; Check duplications of newsgroups.
X      ;; Note: Checking the duplications takes very long time.
X      (if (assoc newsgroup gnus-newsrc-assoc)
X	  (message "Ignore duplicated newsgroup: %s" newsgroup)
X	(setq subscribe
X	      (string-equal
X	       ":" (buffer-substring (match-beginning 2) (match-end 2))))
X	(setq ranges (buffer-substring (match-beginning 3) (match-end 3)))
X	(setq read-list nil)
X	(while (string-match "^[, \t]*\\([0-9-]+\\)" ranges)
X	  (setq subrange (substring ranges (match-beginning 1) (match-end 1)))
X	  (setq ranges (substring ranges (match-end 1)))
X	  (cond ((string-match "^\\([0-9]+\\)-\\([0-9]+\\)$" subrange)
X		 (setq read-list
X		       (cons
X			(cons (string-to-int
X			       (substring subrange
X					  (match-beginning 1) (match-end 1)))
X			      (string-to-int
X			       (substring subrange
X					  (match-beginning 2) (match-end 2))))
X			read-list)))
X		((string-match "^[0-9]+$" subrange)
X		 (setq read-list
X		       (cons (cons (string-to-int subrange)
X				   (string-to-int subrange))
X			     read-list)))
X		(t
X		 (ding) (message "Ignoring bogus lines of %s" newsgroup)
X		 (sit-for 0))
X		))
X	(setq gnus-newsrc-assoc
X	      (cons (cons newsgroup (cons subscribe (nreverse read-list)))
X		    gnus-newsrc-assoc))
X	))
X    (setq gnus-newsrc-assoc
X	  (nreverse gnus-newsrc-assoc))
X    ))
X
X(defun gnus-save-newsrc-file ()
X  "Save to .newsrc FILE."
X  ;; Note: We cannot save .newsrc file if all newsgroups are removed
X  ;; from the variable gnus-newsrc-assoc.
X  (and (or gnus-newsrc-assoc gnus-killed-assoc)
X       gnus-current-startup-file
X       (save-excursion
X	 ;; A buffer containing .newsrc file may be deleted.
X	 (set-buffer (find-file-noselect gnus-current-startup-file))
X	 (if (not (buffer-modified-p))
X	     (message "(No changes need to be saved)")
X	   (message "Saving %s..." gnus-current-startup-file)
X	   (let ((make-backup-files t)
X		 (version-control nil)
X		 (require-final-newline t)) ;Don't ask even if requested.
X	     ;; Make backup file of master newsrc.
X	     ;; You can stop or change version control of backup file.
X	     ;; Suggested by jason@violet.berkeley.edu.
X	     (run-hooks 'gnus-Save-newsrc-hook)
X	     (save-buffer))
X	   ;; Quickly loadable .newsrc.
X	   (set-buffer (get-buffer-create " *GNUS-newsrc*"))
X	   (buffer-flush-undo (current-buffer))
X	   (erase-buffer)
X	   (gnus-gnus-to-quick-newsrc-format)
X	   (let ((make-backup-files nil)
X		 (version-control nil)
X		 (require-final-newline t)) ;Don't ask even if requested.
X	     (write-file (concat gnus-current-startup-file ".el")))
X	   (kill-buffer (current-buffer))
X	   (message "Saving %s... Done" gnus-current-startup-file)
X	   ))
X    ))
X
X(defun gnus-update-newsrc-buffer (group &optional delete next)
X  "Incrementally update .newsrc buffer about GROUP.
XIf optional 1st argument DELETE is non-nil, delete the group.
XIf optional 2nd argument NEXT is non-nil, inserted before it."
X  (save-excursion
X    ;; Taking account of the killed startup file.
X    ;; Suggested by tale@pawl.rpi.edu.
X    (set-buffer (or (get-file-buffer gnus-current-startup-file)
X		    (find-file-noselect gnus-current-startup-file)))
X    (let ((deleted nil)
X	  (buffer-read-only nil))	;May be not modifiable.
X      ;; Delete ALL entries which match for GROUP.
X      (goto-char (point-min))
X      (while (re-search-forward
X	      (concat "^[ \t]*" (regexp-quote group) "[ \t]*[:!]") nil t)
X	(beginning-of-line)
X	(delete-region (point) (progn (forward-line 1) (point)))
X	(setq deleted t)		;Old entry is deleted.
X	)
X      (if delete
X	  nil
X	;; Insert group entry.
X	(let ((newsrc (assoc group gnus-newsrc-assoc)))
X	  (if (null newsrc)
X	      nil
X	    ;; Find insertion point.
X	    (cond (deleted nil)		;Insert here.
X		  ((and (stringp next)
X			(progn
X			  (goto-char (point-min))
X			  (re-search-forward
X			   (concat "^[ \t]*"
X				   (regexp-quote next) "[ \t]*[:!]") nil t)))
X		   (beginning-of-line))
X		  (t
X		   (goto-char (point-max))
X		   (or (bolp)
X		       (insert "\n"))))
X	    ;; Insert after options line.
X	    (if (looking-at "^[ \t]*options[ \t]")
X		(forward-line 1))
X	    (insert group		;Group name
X		    (if (nth 1 newsrc) ": " "! ")) ;Subscribed?
X	    (gnus-ranges-to-newsrc-format (nthcdr 2 newsrc)) ;Read articles
X	    (insert "\n")
X	    )))
X      )))
X
X(defun gnus-gnus-to-quick-newsrc-format ()
X  "Insert GNUS variables such as gnus-newsrc-assoc in lisp format."
X  (insert ";; GNUS internal format of .newsrc.\n")
X  (insert ";; Touch .newsrc instead if you think to remove this file.\n")
X  (let ((variable nil)
X	(variables gnus-variable-list)
X	;; Temporary rebind to make changes invisible.
X	(gnus-killed-assoc gnus-killed-assoc))
X    ;; Remove duplicated or unsubscribed newsgroups in gnus-killed-assoc.
X    (gnus-check-killed-newsgroups)
X    ;; Then, insert lisp expressions.
X    (while variables
X      (setq variable (car variables))
X      (and (boundp variable)
X	   (symbol-value variable)
X	   (insert "(setq " (symbol-name variable) " '"
X		   (prin1-to-string (symbol-value variable))
X		   ")\n"))
X      (setq variables (cdr variables)))
X    ))
X
X(defun gnus-ranges-to-newsrc-format (ranges)
X  "Insert ranges of read articles."
X  (let ((range nil))			;Range is a pair of BEGIN and END.
X    (while ranges
X      (setq range (car ranges))
X      (setq ranges (cdr ranges))
X      (cond ((= (car range) (cdr range))
X	     (if (= (car range) 0)
X		 (setq ranges nil)	;No unread articles.
X	       (insert (int-to-string (car range)))
X	       (if ranges (insert ","))
X	       ))
X	    (t
X	     (insert (int-to-string (car range))
X		     "-"
X		     (int-to-string (cdr range)))
X	     (if ranges (insert ","))
X	     ))
X      )))
X
X
X;;Local variables:
X;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
X;;end:
SHAR_EOF
chmod 0644 gnus.el || echo "restore of gnus.el fails"
set `wc -c gnus.el`;Sum=$1
if test "$Sum" != "198973"
then echo original size 198973, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnusmisc.el &&
X;;; Miscellaneous commands for GNUS newsreader
X;; Copyright (C) 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1989 Masanobu UMEDA
X;; $Header: gnusmisc.el,v 1.1 89/06/19 13:37:20 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X(provide 'gnusmisc)
X(require 'gnus)
X
X;;;
X;;; GNUS Browse-Killed Mode
X;;;
X
X;; Some ideas are due to roland@wheaties.ai.mit.edu (Roland McGrath).
X;; I'd like to thank him very much.
X
X(defvar gnus-Browse-killed-mode-hook nil
X  "*A hook for GNUS Browse-Killed Mode.")
X
X(defvar gnus-Browse-killed-buffer "*Killed Newsgroup*")
X(defvar gnus-Browse-killed-mode-map nil)
X
X(put 'gnus-Browse-killed-mode 'mode-class 'special)
X
X;; Make the buffer to be managed by GNUS.
X
X(or (memq gnus-Browse-killed-buffer gnus-buffer-list)
X    (setq gnus-buffer-list
X	  (cons gnus-Browse-killed-buffer gnus-buffer-list)))
X
X(if gnus-Browse-killed-mode-map
X    nil
X  (setq gnus-Browse-killed-mode-map (make-keymap))
X  (suppress-keymap gnus-Browse-killed-mode-map t)
X  (define-key gnus-Browse-killed-mode-map " " 'gnus-Group-next-group)
X  (define-key gnus-Browse-killed-mode-map "\177" 'gnus-Group-prev-group)
X  (define-key gnus-Browse-killed-mode-map "\C-n" 'gnus-Group-next-group)
X  (define-key gnus-Browse-killed-mode-map "\C-p" 'gnus-Group-prev-group)
X  (define-key gnus-Browse-killed-mode-map "n" 'gnus-Group-next-group)
X  (define-key gnus-Browse-killed-mode-map "p" 'gnus-Group-prev-group)
X  (define-key gnus-Browse-killed-mode-map "y" 'gnus-Browse-killed-yank)
X  (define-key gnus-Browse-killed-mode-map "\C-y" 'gnus-Browse-killed-yank)
X  (define-key gnus-Browse-killed-mode-map "l" 'gnus-Browse-killed-groups)
X  (define-key gnus-Browse-killed-mode-map "q" 'gnus-Browse-killed-exit)
X  (define-key gnus-Browse-killed-mode-map "\C-c\C-c" 'gnus-Browse-killed-exit)
X  (define-key gnus-Browse-killed-mode-map "\C-c\C-i" 'gnus-Info-find-node))
X
X(defun gnus-Browse-killed-mode ()
X  "Major mode for browsing the killed newsgroups.
XAll normal editing commands are turned off.
XInstead, these commands are available:
X\\{gnus-Browse-killed-mode-map}
X
XThe killed newsgroups are saved in the quick startup file (.newsrc.el)
Xunless it against the options line in the startup file (.newsrc).
X
XEntry to this mode calls gnus-Browse-killed-mode-hook with no arguments,
Xif that value is non-nil."
X  (interactive)
X  (kill-all-local-variables)
X  ;; Gee.  Why don't you upgrade?
X  (cond ((boundp 'mode-line-modified)
X	 (setq mode-line-modified "--- "))
X	((listp (default-value 'mode-line-format))
X	 (setq mode-line-format
X	       (cons "--- " (cdr (default-value 'mode-line-format)))))
X	(t
X	 (setq mode-line-format
X	       "--- GNUS: Killed Newsgroups  %[(%m)%]----%3p-%-")))
X  (setq major-mode 'gnus-Browse-killed-mode)
X  (setq mode-name "Browse-Killed")
X  (setq mode-line-buffer-identification	"GNUS: Killed Newsgroups")
X  (use-local-map gnus-Browse-killed-mode-map)
X  (buffer-flush-undo (current-buffer))
X  (setq buffer-read-only t)		;Disable modification
X  (run-hooks 'gnus-Browse-killed-mode-hook))
X
X(defun gnus-Browse-killed-groups ()
X  "Browse the killed newsgroups.
XThe keys y and C-y yank the newsgroup on the current line into the
XNewsgroups buffer."
X  (interactive)
X  (or gnus-killed-assoc
X      (error "No killed newsgroups"))
X  (pop-to-buffer (get-buffer-create gnus-Browse-killed-buffer))
X  (gnus-Browse-killed-mode)
X  (let ((buffer-read-only nil)
X	(killed-assoc gnus-killed-assoc))
X    (erase-buffer)
X    (while killed-assoc
X      (insert (gnus-Group-prepare-line (car killed-assoc)))
X      (setq killed-assoc (cdr killed-assoc)))
X    (goto-char (point-min))
X    ))
X
X(defun gnus-Browse-killed-yank ()
X  "Yank current newsgroup to Newsgroup buffer."
X  (interactive)
X  (let ((group (gnus-Group-group-name)))
X    (if group
X	(let* ((buffer-read-only nil)
X	       (killed (assoc group gnus-killed-assoc)))
X	  (pop-to-buffer gnus-Group-buffer) ;Needed to adjust point.
X	  (if killed
X	      (gnus-Group-insert-group killed))
X	  (pop-to-buffer gnus-Browse-killed-buffer)
X	  (beginning-of-line)
X	  (delete-region (point)
X			 (progn (forward-line 1) (point)))
X	  )))
X  (gnus-Browse-killed-check-buffer))
X
X(defun gnus-Browse-killed-check-buffer ()
X  "Exit if the buffer is empty by deleting the window and killing the buffer."
X  (and (null gnus-killed-assoc)
X       (get-buffer gnus-Browse-killed-buffer)
X       (gnus-Browse-killed-exit)))
X
X(defun gnus-Browse-killed-exit ()
X  "Exit this mode by deleting the window and killing the buffer."
X  (interactive)
X  (and (get-buffer-window gnus-Browse-killed-buffer)
X       (delete-window (get-buffer-window gnus-Browse-killed-buffer)))
X  (kill-buffer gnus-Browse-killed-buffer))
X
X
X;;;
X;;; kill/yank newsgroup commands of GNUS Group Mode
X;;;
X
X(defun gnus-Group-kill-group (n)
X  "Kill newsgroup on current line, repeated prefix argument N times.
XThe killed newsgroups can be yanked by using \\[gnus-Group-yank-group]."
X  (interactive "p")
X  (let ((buffer-read-only nil)
X	(group nil))
X    (while (> n 0)
X      (setq group (gnus-Group-group-name))
X      (or group
X	  (signal 'end-of-buffer nil))
X      (beginning-of-line)
X      (delete-region (point)
X		     (progn (forward-line 1) (point)))
X      (gnus-kill-newsgroup group)
X      (setq n (1- n))
X      ;; Add to killed newsgroups in the buffer if exists.
X      (if (get-buffer gnus-Browse-killed-buffer)
X	  (save-excursion
X	    (set-buffer gnus-Browse-killed-buffer)
X	    (let ((buffer-read-only nil))
X	      (goto-char (point-min))
X	      (insert (gnus-Group-prepare-line (car gnus-killed-assoc)))
X	      )))
X      )
X    (search-forward ":" nil t)
X    ))
X
X(defun gnus-Group-yank-group ()
X  "Yank the last newsgroup killed with \\[gnus-Group-kill-group],
Xinserting it before the newsgroup on the line containging point."
X  (interactive)
X  (gnus-Group-insert-group (car gnus-killed-assoc))
X  ;; Remove killed newsgroups from the buffer if exists.
X  (if (get-buffer gnus-Browse-killed-buffer)
X      (save-excursion
X	(set-buffer gnus-Browse-killed-buffer)
X	(let ((buffer-read-only nil))
X	  (goto-char (point-min))
X	  (delete-region (point-min)
X			 (progn (forward-line 1) (point)))
X	  )))
X  (gnus-Browse-killed-check-buffer))
X
X(defun gnus-Group-insert-group (info)
X  "Insert newsgroup at current line using gnus-newsrc-assoc INFO."
X  (if (null gnus-killed-assoc)
X      (error "No killed newsgroups"))
X  (if (not gnus-have-all-newsgroups)
X      (error
X       (substitute-command-keys
X	"Not all newsgroups are displayed.  Type \\[gnus-Group-list-all-groups] to display all newsgroups.")))
X  (let ((buffer-read-only nil)
X	(group (gnus-Group-group-name)))
X    (gnus-insert-newsgroup info group)
X    (beginning-of-line)
X    (insert (gnus-Group-prepare-line info))
X    (forward-line -1)
X    (search-forward ":" nil t)
X    ))
SHAR_EOF
chmod 0644 gnusmisc.el || echo "restore of gnusmisc.el fails"
set `wc -c gnusmisc.el`;Sum=$1
if test "$Sum" != "7496"
then echo original size 7496, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnuspost.el &&
X;;; Post news commands for GNUS newsreader
X;; Copyright (C) 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1989 Masanobu UMEDA
X;; $Header: gnuspost.el,v 1.1 89/06/19 13:38:01 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X(provide 'gnuspost)
X(require 'gnus)
X
X(defvar gnus-organization-file "/usr/lib/news/organization"
X  "*Local news organization file.")
X
X(autoload 'news-reply-mode "rnewspost")
X
X;;;
X;;; Post a News using NNTP
X;;;
X
X(defun gnus-post-news ()
X  "Begin editing a new USENET news article to be posted.
XType \\[describe-mode] once editing the article to get a list of commands."
X  (interactive)
X  (if (or (not gnus-novice-user)
SHAR_EOF
echo "End of part 5, continue with part 6"
echo "6" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 6 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnuspost.el continued
#
CurArch=6
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnuspost.el
X	  (y-or-n-p "Are you sure you want to post to all of USENET? "))
X      (let ((artbuf (current-buffer))
X	    (newsgroups			;Default newsgroup.
X	     (if (eq major-mode 'gnus-Article-mode) gnus-newsgroup-name))
X	    (subject nil)
X	    (distribution nil))
X	(save-restriction
X	  (and (not (zerop (buffer-size)))
X	       ;;(equal major-mode 'news-mode)
X	       (equal major-mode 'gnus-Article-mode)
X	       (progn
X		 ;;(news-show-all-headers)
X		 (gnus-Article-show-all-headers)
X		 (narrow-to-region (point-min)
X				   (progn (goto-char (point-min))
X					  (search-forward "\n\n")
X					  (- (point) 2)))))
X	  (setq news-reply-yank-from (mail-fetch-field "from")
X		news-reply-yank-message-id (mail-fetch-field "message-id")))
X	(pop-to-buffer "*post-news*")
X	(news-reply-mode)
X	(gnus-replace-functions)
X	(if (and (buffer-modified-p)
X		 (not (y-or-n-p "Unsent article being composed; erase it? ")))
X	    ;; Continue composition.
X	    ;; Make news-reply-yank-original work on the current article.
X	    (setq mail-reply-buffer artbuf)
X	  (erase-buffer)
X	  (if gnus-interactive-post
X	      ;; Newsgroups, subject and distribution are asked for.
X	      ;; Suggested by yuki@flab.fujitsu.junet.
X	      (progn
X		;; Subscribed newsgroup names are required for
X		;; completing read of newsgroup.
X		(or gnus-newsrc-assoc
X		    (gnus-read-newsrc-file))
X		;; Which do you like? (UMERIN)
X		;; (setq newsgroups (read-string "Newsgroups: " "general"))
X		(or newsgroups		;Use the default newsgroup.
X		    (setq newsgroups
X			  (completing-read "Newsgroup: " gnus-newsrc-assoc
X					   nil 'require-match
X					   newsgroups ;Default newsgroup.
X					   )))
X		(setq subject (read-string "Subject: "))
X		(setq distribution
X		      (substring newsgroups 0 (string-match "\\." newsgroups)))
X		(if (string-equal distribution newsgroups)
X		    ;; Newsgroup may be general or control. In this
X		    ;; case, use default distribution.
X		    (setq distribution gnus-default-distribution))
X		(setq distribution
X		      (read-string "Distribution: " distribution))
X		;; An empty string is ok to ignore gnus-default-distribution.
X		;;(if (string-equal distribution "")
X		;;    (setq distribution nil))
X		))
X	  (news-setup () subject () newsgroups artbuf)
X	  ;; Make sure the article is posted by GNUS.
X	  ;;(mail-position-on-field "Posting-Software")
X	  ;;(insert "GNUS: NNTP-based News Reader for GNU Emacs")
X	  ;; Insert Distribution: field.
X	  ;; Suggested by ichikawa@flab.fujitsu.junet.
X	  (mail-position-on-field "Distribution")
X	  (insert (or distribution gnus-default-distribution ""))
X	  ;; Handle author copy using FCC field.
X	  (if gnus-author-copy
X	      (progn
X		(mail-position-on-field "FCC")
X		(insert gnus-author-copy)))
X	  (if gnus-interactive-post
X	      ;; All fields are filled in.
X	      (goto-char (point-max))
X	    ;; Move point to Newsgroup: field.
X	    (goto-char (point-min))
X	    (end-of-line))
X	  ))
X    (message "")))
X
X(defun gnus-news-reply (&optional yank)
X  "Compose and post a reply (aka a followup) to the current article on USENET.
XWhile composing the followup, use \\[news-reply-yank-original] to yank the
Xoriginal message into it."
X  (interactive)
X  (if (or (not gnus-novice-user)
X	  (y-or-n-p "Are you sure you want to followup to all of USENET? "))
X      (let (from cc subject date to followup-to newsgroups message-of
X		 references distribution message-id
X		 (artbuf (current-buffer)))
X	(save-restriction
X	  (and (not (zerop (buffer-size)))
X	       ;;(equal major-mode 'news-mode)
X	       (equal major-mode 'gnus-Article-mode)
X	       (progn
X		 ;; (news-show-all-headers)
X		 (gnus-Article-show-all-headers)
X		 (narrow-to-region (point-min)
X				   (progn (goto-char (point-min))
X					  (search-forward "\n\n")
X					  (- (point) 2)))))
X	  (setq from (mail-fetch-field "from")
X		news-reply-yank-from from
X		subject (mail-fetch-field "subject")
X		date (mail-fetch-field "date")
X		followup-to (mail-fetch-field "followup-to")
X		newsgroups (or followup-to
X			       (mail-fetch-field "newsgroups"))
X		references (mail-fetch-field "references")
X		distribution (mail-fetch-field "distribution")
X		message-id (mail-fetch-field "message-id")
X		news-reply-yank-message-id message-id))
X	(pop-to-buffer "*post-news*")
X	(news-reply-mode)
X	(gnus-replace-functions)
X	(if (and (buffer-modified-p)
X		 (not (y-or-n-p "Unsent article being composed; erase it? ")))
X	    ;; Continue composition.
X	    ;; Make news-reply-yank-original work on current article.
X	    (setq mail-reply-buffer artbuf)
X	  (erase-buffer)
X	  (and subject
X	       (setq subject
X		     (concat "Re: " (gnus-simplify-subject subject 're-only))))
X	  (and from
X	       (progn
X		 (let ((stop-pos
X			(string-match "  *at \\|  *@ \\| *(\\| *<" from)))
X		   (setq message-of
X			 (concat
X			  (if stop-pos (substring from 0 stop-pos) from)
X			  "'s message of "
X			  date)))))
X	  (news-setup nil subject message-of newsgroups artbuf)
X	  (if followup-to
X	      (progn (news-reply-followup-to)
X		     (insert followup-to)))
X	  ;; Fold long references line to follow RFC1036.
X	  (mail-position-on-field "References")
X	  (let ((begin (point))
X		(fill-column 79)
X		(fill-prefix "\t"))
X	    (if references
X		(insert references))
X	    (if (and references message-id)
X		(insert " "))
X	    (if message-id
X		(insert message-id))
X	    ;; The region must end with a newline to fill the region
X	    ;; without inserting extra newline.
X	    (fill-region-as-paragraph begin (1+ (point))))
X	  ;; Make sure the article is posted by GNUS.
X	  ;;(mail-position-on-field "Posting-Software")
X	  ;;(insert "GNUS: NNTP-based News Reader for GNU Emacs")
X	  ;; Distribution must be the same as original article.
X	  (mail-position-on-field "Distribution")
X	  (insert (or distribution ""))
X	  ;; Handle author copy using FCC field.
X	  (if gnus-author-copy
X	      (progn
X		(mail-position-on-field "FCC")
X		(insert gnus-author-copy)))
X	  (goto-char (point-max)))
X	;; Yank original article automatically.
X	(if yank
X	    (let ((last (point)))
X	      (goto-char (point-max))
X	      (news-reply-yank-original nil)
X	      (goto-char last)))
X	)
X    (message "")))
X
X(defun gnus-inews-news ()
X  "Send a news message."
X  (interactive)
X  (let* ((case-fold-search nil)
X	 (server-running (gnus-server-opened)))
X    (save-excursion
X      ;; It is possible to post a news without reading news using
X      ;; `gnus' before.
X      ;; Suggested by yuki@flab.fujitsu.junet.
X      (gnus-start-news-server)		;Use default NNTP server.
X      ;; NNTP server must be opened before current buffer is modified.
X      (widen)
X      (goto-char (point-min))
X      (run-hooks 'news-inews-hook)
X      (goto-char (point-min))
X      (search-forward (concat "\n" mail-header-separator "\n"))
X      (replace-match "\n\n")
X      (goto-char (point-max))
X      ;; require a newline at the end for inews to append .signature to
X      (or (= (preceding-char) ?\n)
X	  (insert ?\n))
X      (message "Posting to USENET...")
X      ;; Post to NNTP server. 
X      (if (gnus-inews-article)
X	  (message "Posting to USENET... done")
X	;; We cannot signal an error.
X	(ding) (message "Article rejected: %s" (gnus-status-message)))
X      (goto-char (point-min))		;restore internal header separator
X      (search-forward "\n\n")
X      (replace-match (concat "\n" mail-header-separator "\n"))
X      (set-buffer-modified-p nil))
X    ;; If NNTP server is opened by gnus-inews-news, close it by myself.
X    (or server-running
X	(gnus-close-server))
X    (and (fboundp 'bury-buffer) (bury-buffer))))
X
X(defun gnus-cancel-news ()
X  "Cancel an article you posted."
X  (interactive)
X  (if (yes-or-no-p "Do you really want to cancel this article? ")
X      (let ((from nil)
X	    (newsgroups nil)
X	    (message-id nil)
X	    (distribution nil))
X	(save-excursion
X	  ;; Get header info. from original article.
X	  (save-restriction
X	    (gnus-Article-show-all-headers)
X	    (goto-char (point-min))
X	    (search-forward "\n\n")
X	    (narrow-to-region (point-min) (point))
X	    (setq from (mail-fetch-field "from"))
X	    (setq newsgroups (mail-fetch-field "newsgroups"))
X	    (setq message-id (mail-fetch-field "message-id"))
X	    (setq distribution (mail-fetch-field "distribution")))
X	  ;; Verify if the article is absolutely user's by comparing
X	  ;; user id with value of its From: field.
X	  (if (not
X	       (string-equal
X		(downcase (mail-strip-quoted-names from))
X		(downcase (mail-strip-quoted-names (gnus-inews-user-name)))))
X	      (progn
X		(ding) (message "This article is not yours"))
X	    ;; Make control article.
X	    (set-buffer (get-buffer-create " *GNUS-posting*"))
X	    (buffer-flush-undo (current-buffer))
X	    (erase-buffer)
X	    (insert "Newsgroups: " newsgroups "\n"
X		    "Subject: cancel " message-id "\n"
X		    "Control: cancel " message-id "\n"
X		    ;; We should not use the value of
X		    ;;  `gnus-default-distribution' as default value,
X		    ;;  because distribution must be as same as original
X		    ;;  article.
X		    "Distribution: " (or distribution "") "\n"
X		    )
X	    ;; Prepare article headers.
X	    (gnus-inews-insert-headers)
X	    (goto-char (point-max))
X	    ;; Insert empty line.
X	    (insert "\n")
X	    ;; Send the control article to NNTP server.
X	    (message "Canceling your article...")
X	    (if (gnus-request-post)
X		(message "Canceling your article... done")
X	      (ding) (message "Failed to cancel your article"))
X	    (kill-buffer (current-buffer))
X	    )))
X    ))
X
X
X
X(defun gnus-inews-article ()
X  "NNTP inews interface."
X  (let ((signature
X	 (if gnus-signature-file
X	     (expand-file-name gnus-signature-file nil)))
X	(distribution nil)
X	(artbuf (current-buffer))
X	(tmpbuf (get-buffer-create " *GNUS-posting*")))
X    (save-excursion
X      (set-buffer tmpbuf)
X      (buffer-flush-undo (current-buffer))
X      (erase-buffer)
X      (insert-buffer-substring artbuf)
X      ;; Get distribution.
X      (save-restriction
X	(goto-char (point-min))
X	(search-forward "\n\n")
X	(narrow-to-region (point-min) (point))
X	(setq distribution (mail-fetch-field "distribution")))
X      (widen)
X      (if signature
X	  (progn
X	    ;; Change signature file by distribution.
X	    ;; Suggested by hyoko@flab.fujitsu.junet.
X	    (if (file-exists-p (concat signature "-" distribution))
X		(setq signature (concat signature "-" distribution)))
X	    ;; Insert signature.
X	    (if (file-exists-p signature)
X		(progn
X		  (goto-char (point-max))
X		  (insert "--\n")
X		  (insert-file-contents signature)))
X	    ))
X      ;; Prepare article headers.
X      (save-restriction
X	(goto-char (point-min))
X	(search-forward "\n\n")
X	(narrow-to-region (point-min) (point))
X	(gnus-inews-insert-headers)
X	;; Save author copy of posted article. The article must be
X	;;  copied before being posted because `gnus-request-post'
X	;;  modifies the buffer.
X	(let ((case-fold-search t))
X	  ;; Find and handle any FCC fields.
X	  (goto-char (point-min))
X	  (if (re-search-forward "^FCC:" nil t)
X	      (gnus-inews-do-fcc))))
X      (widen)
X      ;; Run final inews hooks.
X      (run-hooks 'gnus-Inews-article-hook)
X      ;; Post an article to NNTP server.
X      ;; Return NIL if post failed.
X      (prog1
X	  (gnus-request-post)
X	(kill-buffer (current-buffer)))
X      )))
X
X(defun gnus-inews-do-fcc ()
X  "Process FCC: fields."
X  (let ((fcc-list nil)
X	(fcc-file nil)
X	(case-fold-search t))		;Should ignore case.
X    (save-excursion
X      (save-restriction
X	(goto-char (point-min))
X	(while (re-search-forward "^FCC:[ \t]*" nil t)
X	  (setq fcc-list (cons (buffer-substring (point)
X						 (progn
X						   (end-of-line)
X						   (skip-chars-backward " \t")
X						   (point)))
X			       fcc-list))
X	  (delete-region (match-beginning 0)
X			 (progn (forward-line 1) (point))))
X	;; Process FCC operations.
X	(widen)
X	(while fcc-list
X	  (setq fcc-file (car fcc-list))
X	  (cond ((string-match "^[ \t]*|[ \t]*\\(.*\\)[ \t]*$" fcc-file)
X		 (let ((program (substring fcc-file
X					   (match-beginning 1) (match-end 1))))
X		   ;; Suggested by yuki@flab.fujitsu.junet.
X		   ;; Pipe out article to named program.
X		   (call-process-region (point-min) (point-max) shell-file-name
X					nil nil nil "-c" program)
X		   ))
X		(t
X		 ;; Suggested by hyoko@flab.fujitsu.junet.
X		 ;; Save article in Unix mail format.
X		 ;; This is much convenient for Emacs user.
X		 (rmail-output fcc-file)))
X	  (setq fcc-list (cdr fcc-list)))
X	))
X    ))
X
X(defun gnus-inews-insert-headers ()
X  "Prepare article headers.
XPath:, From:, Subject: and Distribution: are generated.
XMessage-ID:, Date:, and Organization: is optional."
X  (save-excursion
X    (let ((date (gnus-inews-date))
X	  (message-id (gnus-inews-message-id))
X	  (organization (gnus-inews-organization)))
X      ;; Insert from the top of headers.
X      (goto-char (point-min))
X      (insert "Path: " (gnus-inews-path) "\n")
X      (insert "From: " (gnus-inews-user-name) "\n")
X      ;; If there is no subject, make Subject: field.
X      (or (mail-fetch-field "subject")
X	  (insert "Subject: \n"))
X      ;; Insert random headers.
X      (if message-id
X	  (insert "Message-ID: " message-id "\n"))
X      (if date
X	  (insert "Date: " date "\n"))
X      (if organization
X	  (let ((begin (point))
X		(fill-column 79)
X		(fill-prefix "\t"))
X	    (insert "Organization: " organization "\n")
X	    (fill-region-as-paragraph begin (point))))
X      (or (mail-fetch-field "distribution")
X	  (insert "Distribution: \n"))
X      )))
X
X(defun gnus-inews-path ()
X  "Return uucp path."
X  (let ((login-name (gnus-inews-login-name)))
X    (cond ((null gnus-use-generic-path)
X	   (concat gnus-nntp-server "!" login-name))
X	  ((stringp gnus-use-generic-path)
X	   ;; Support GENERICPATH.  Suggested by vixie@decwrl.dec.com.
X	   (concat gnus-use-generic-path "!" login-name))
X	  (t login-name))
X    ))
X
X(defun gnus-inews-user-name ()
X  "Return user's network address as `NAME@DOMAIN (FULL NAME)'."
X  (let ((login-name (gnus-inews-login-name))
X	(full-name (gnus-inews-full-name)))
X    (concat login-name "@" (gnus-inews-domain-name gnus-use-generic-from)
X	    ;; User's full name.
X	    (cond ((string-equal full-name "") "")
X		  ((string-equal full-name "&")	;Unix hack.
X		   (concat " (" login-name ")"))
X		  (t
X		   (concat " (" full-name ")")))
X	    )))
X
X(defun gnus-inews-login-name ()
X  "Return user login name.
XGot from the variable gnus-user-login-name, the environment variables
XUSER and LOGNAME, and the function user-login-name."
X  (or gnus-user-login-name
X      (getenv "USER") (getenv "LOGNAME") (user-login-name)))
X
X(defun gnus-inews-full-name ()
X  "Return user full name.
XGot from the variable gnus-user-full-name, the environment variable
XNAME, and the function user-full-name."
X  (or gnus-user-full-name
X      (getenv "NAME") (user-full-name)))
X
X(defun gnus-inews-domain-name (&optional genericfrom)
X  "Return user's domain name.
XIf optional argument GENERICFROM is a string, use it as the domain
Xname; if it is non-nil, strip of local host name from the domain name.
XIf the function `system-name' returns full internet name and the
Xdomain is undefined, the domain name is got from it."
X  (let ((domain (or (if (stringp genericfrom) genericfrom)
X		    (getenv "DOMAINNAME")
X		    gnus-your-domain
X		    ;; Function `system-name' may return full internet name.
X		    ;; Suggested by Mike DeCorte <mrd@sun.soe.clarkson.edu>.
X		    (if (string-match "\\." (system-name))
X			(substring (system-name) (match-end 0)))
X		    (read-string "Domain name (no host): ")))
X	(host (or (if (string-match "\\." (system-name))
X		      (substring (system-name) 0 (match-beginning 0)))
X		  (system-name))))
X    (if (string-equal "." (substring domain 0 1))
X	(setq domain (substring domain 1)))
X    (if (null gnus-your-domain)
X	(setq gnus-your-domain domain))
X    ;; Support GENERICFROM as same as standard Bnews system.
X    ;; Suggested by ohm@kaba.junet and vixie@decwrl.dec.com.
X    (cond ((null genericfrom)
X	   (concat host "." domain))
X	  ;;((stringp genericfrom) genericfrom)
X	  (t domain))
X    ))
X
X(defun gnus-inews-message-id ()
X  "Generate unique Message-ID for user."
X  ;; Message-ID should not contain a slash and should be terminated by
X  ;; a number.  I don't know the reason why it is so.
X  (concat "<" (gnus-inews-unique-id) "@" (gnus-inews-domain-name) ">"))
X
X(defun gnus-inews-unique-id ()
X  "Generate unique ID from user name and current time."
X  (let ((date (current-time-string))
X	(name (gnus-inews-login-name)))
X    (if (string-match "^[^ ]+ \\([^ ]+\\)[ ]+\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) [0-9][0-9]\\([0-9][0-9]\\)"
X		      date)
X	(concat (upcase name) "."
X		(substring date (match-beginning 6) (match-end 6)) ;Year
X		(substring date (match-beginning 1) (match-end 1)) ;Month
X		(substring date (match-beginning 2) (match-end 2)) ;Day
X		(substring date (match-beginning 3) (match-end 3)) ;Hour
X		(substring date (match-beginning 4) (match-end 4)) ;Minute
X		(substring date (match-beginning 5) (match-end 5)) ;Second
X		)
X      (error "Cannot understand current-time-string: %s." date))
X    ))
X
X(defun gnus-inews-date ()
X  "Bnews date format string of today. Time zone is ignored."
X  ;; Insert buggy date (time zone is ignored), but I don't worry about
X  ;; it since inews will rewrite it.
X  (let ((date (current-time-string)))
X    (if (string-match "^[^ ]+ \\([^ ]+\\)[ ]+\\([0-9]+\\) \\([0-9:]+\\) [0-9][0-9]\\([0-9][0-9]\\)"
X		      date)
X	(concat (substring date (match-beginning 2) (match-end 2)) ;Day
X		" "
X		(substring date (match-beginning 1) (match-end 1)) ;Month
X		" "
X		(substring date (match-beginning 4) (match-end 4)) ;Year
X		" "
X		(substring date (match-beginning 3) (match-end 3))) ;Time
X      (error "Cannot understand current-time-string: %s." date))
X    ))
X
X(defun gnus-inews-organization ()
X  "Return user's organization.
XThe ORGANIZATION environment variable is used if defined.
XIf not, the variable gnus-your-organization is used instead.
XIf the value begins with a slash, it is taken as the name of a file
Xcontaining the organization."
X  ;; The organization must be got in this order since the ORGANIZATION
X  ;; environment variable is intended for user specific while
X  ;; gnus-your-organization is for machine or organization specific.
X  (let ((organization (or (getenv "ORGANIZATION")
X			  gnus-your-organization
X			  (expand-file-name "~/.organization" nil))))
X    (and (stringp organization)
X	 (string-equal (substring organization 0 1) "/")
X	 ;; Get it from the user and system file.
X	 ;; Suggested by roland@wheaties.ai.mit.edu (Roland McGrath).
X	 (let ((dist (mail-fetch-field "distribution")))
X	   (setq organization
X		 (cond ((file-exists-p (concat organization "-" dist))
X			(concat organization "-" dist))
X		       ((file-exists-p organization) organization)
X		       ((file-exists-p gnus-organization-file)
X			gnus-organization-file)
X		       (t organization)))
X	   ))
X    (cond ((not (stringp organization)) nil)
X	  ((and (string-equal (substring organization 0 1) "/")
X		(file-exists-p organization))
X	   ;; If the first character is `/', assume it is the name of
X	   ;; a file containing the organization.
X	   (save-excursion
X	     (let ((tmpbuf (get-buffer-create " *GNUS organization*")))
X	       (set-buffer tmpbuf)
X	       (erase-buffer)
X	       (insert-file-contents organization)
X	       (prog1 (buffer-string)
X		 (kill-buffer tmpbuf))
X	       )))
X	  (t organization))
X    ))
SHAR_EOF
chmod 0644 gnuspost.el || echo "restore of gnuspost.el fails"
set `wc -c gnuspost.el`;Sum=$1
if test "$Sum" != "20619"
then echo original size 20619, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > mhspool.el &&
X;;; MH folder access using NNTP for GNU Emacs
X;; Copyright (C) 1988, 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1988, 1989 Masanobu UMEDA
X;; $Header: mhspool.el,v 1.4 89/06/19 13:38:20 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X(provide 'mhspool)
X(require 'nntp)
X
X;; This package enables you to read mail or articles in MH folders, or
X;; articles saved by GNUS. In any case, the file names of mail or
X;; articles must consist of only numeric letters.
X
X;; Before using this package, you have to create a server specific
X;; startup file according to the directory which you want to read. For
X;; example, if you want to read mail under the directory named
X;; `~/Mail', the file must be a file named `.newsrc-:Mail'. (There is
X;; no way to specify hierarchical directory now.) In this case, the
X;; name of the NNTP server passed to GNUS must be `:Mail'.
X
X(defvar mhspool-list-directory-switches "-R"
X  "*Switches for nntp-request-list to pass to `ls' for gettting file lists.
XOne entry should appear on one line. You may need to add `-1' option.")
X
X
X
X(defconst mhspool-version "MHSPOOL 1.4"
X  "Version numbers of this version of MHSPOOL.")
X
X(defvar mhspool-spool-directory "~/Mail"
X  "Private mail directory.")
X
X(defvar mhspool-current-directory nil
X  "Current news group directory.")
X
X;;;
X;;; Replacement of Extended Command for retrieving many headers.
X;;;
X
X(defun mhspool-retrieve-headers (sequence)
X  "Return list of article headers specified by SEQUENCE of article id.
XThe format of list is `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID] ...)'.
XReader macros for the vector are defined as `nntp-header-FIELD'.
XWriter macros for the vector are defined as `nntp-set-header-FIELD'.
XNews group must be selected before calling me."
X  (save-excursion
X    (set-buffer nntp-server-buffer)
X    ;;(erase-buffer)
X    (let ((file nil)
X	  (number (length sequence))
X	  (count 0)
X	  (headers nil)			;Result list.
X	  (article 0)
X	  (subject nil)
X	  (message-id nil)
X	  (from nil)
X	  (xref nil)
X	  (lines 0)
X	  (date nil))
X      (while sequence
X	;;(nntp-send-strings-to-server "HEAD" (car sequence))
X	(setq article (car sequence))
X	(setq file
X	      (concat mhspool-current-directory (prin1-to-string article)))
X	(if (and (file-exists-p file)
X		 (not (file-directory-p file)))
X	    (progn
X	      (erase-buffer)
X	      (insert-file-contents file)
X	      (goto-char (point-min))
X	      (search-forward "\n\n" nil 'move)
X	      (narrow-to-region (point-min) (point))
X	      ;; Make it possible to search `\nFIELD'.
X	      (goto-char (point-min))
X	      (insert "\n")
X	      ;; Extract From:
X	      (goto-char (point-min))
X	      (if (search-forward "\nFrom: " nil t)
X		  (setq from (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq from "Unknown User"))
X	      ;; Extract Subject:
X	      (goto-char (point-min))
X	      (if (search-forward "\nSubject: " nil t)
X		  (setq subject (buffer-substring
X				 (point)
X				 (save-excursion (end-of-line) (point))))
X		(setq subject "(None)"))
X	      ;; Extract Message-ID:
X	      (goto-char (point-min))
X	      (if (search-forward "\nMessage-ID: " nil t)
X		  (setq message-id (buffer-substring
X				    (point)
X				    (save-excursion (end-of-line) (point))))
X		(setq message-id nil))
X	      ;; Extract Date:
X	      (goto-char (point-min))
X	      (if (search-forward "\nDate: " nil t)
X		  (setq date (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq date nil))
X	      ;; Extract Lines:
X	      (goto-char (point-min))
X	      (if (search-forward "\nLines: " nil t)
X		  (setq lines (string-to-int
X			       (buffer-substring
X				(point)
X				(save-excursion (end-of-line) (point)))))
X		(setq lines 0))
X	      ;; Extract Xref:
X	      (goto-char (point-min))
X	      (if (search-forward "\nXref: " nil t)
X		  (setq xref (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq xref nil))
X	      (setq headers
X		    (cons (vector article subject from
X				  xref lines date message-id)
X			  headers))
X	      ))
X	(setq sequence (cdr sequence))
X	(setq count (1+ count))
X	(if (and (> number nntp-large-newsgroup)
X		 (zerop (% count 20)))
X	    (message "MHSPOOL: %d%% of headers received."
X		     (/ (* count 100) number)))
X	)
X      (if (> number nntp-large-newsgroup)
X	  (message "MHSPOOL: 100%% of headers received."))
X      (nreverse headers)
X      )))
X
X;;;
X;;; Replacement of NNTP Raw Interface.
X;;;
X
X(defun mhspool-open-server (host &optional service)
X  "Open news server on HOST.
XIf HOST is nil, use value of environment variable `NNTPSERVER'.
XIf optional argument SERVICE is non-nil, open by the service name."
X  (let ((host (or host (getenv "NNTPSERVER")))
X	(status nil))
X    ;; Get directory name from HOST name.
X    (if (string-match ":\\(.+\\)$" host)
X	(progn
X	  (setq mhspool-spool-directory
X		(file-name-as-directory
X		 (expand-file-name
X		  (substring host (match-beginning 1) (match-end 1))
X		  (expand-file-name "~/" nil))))
X	  (setq host (system-name)))
X      (setq mhspool-spool-directory nil))
X    (setq nntp-status-message-string "")
X    (cond ((and (stringp host)
X		(stringp mhspool-spool-directory)
X		(file-directory-p mhspool-spool-directory)
X		(string-equal host (system-name)))
X	   (setq status (mhspool-open-server-internal host service)))
X	  ((string-equal host (system-name))
X	   (setq nntp-status-message-string
X		 (format "No such directory: %s.  Goodbye."
X			 mhspool-spool-directory)))
X	  ((null host)
X	   (setq nntp-status-message-string "NNTP server is not specified."))
X	  (t
X	   (setq nntp-status-message-string
X		 (format "MHSPOOL: cannot talk to %s." host)))
X	  )
X    status
X    ))
X
X(defun mhspool-close-server ()
X  "Close news server."
X  (mhspool-close-server-internal))
X
X(fset 'mhspool-request-quit (symbol-function 'mhspool-close-server))
X
X(defun mhspool-server-opened ()
X  "Return server process status, T or NIL.
XIf the stream is opened, return T, otherwise return NIL."
X  (and nntp-server-buffer
X       (get-buffer nntp-server-buffer)))
X
X(defun mhspool-status-message ()
X  "Return server status response as string."
X  nntp-status-message-string
X  )
X
X(defun mhspool-request-article (id)
X  "Select article by message ID (or number)."
X  (let ((file (concat mhspool-current-directory (prin1-to-string id))))
X    (if (and (stringp file)
X	     (file-exists-p file)
X	     (not (file-directory-p file)))
X	(save-excursion
X	  (mhspool-find-file file)))
X    ))
X
X(defun mhspool-request-body (id)
X  "Select article body by message ID (or number)."
X  (if (mhspool-request-article id)
X      (save-excursion
X	(set-buffer nntp-server-buffer)
X	(goto-char (point-min))
X	(if (search-forward "\n\n" nil t)
X	    (delete-region (point-min) (point)))
X	t
X	)
X    ))
X
X(defun mhspool-request-head (id)
X  "Select article head by message ID (or number)."
X  (if (mhspool-request-article id)
X      (save-excursion
X	(set-buffer nntp-server-buffer)
X	(goto-char (point-min))
X	(if (search-forward "\n\n" nil t)
X	    (delete-region (1- (point)) (point-max)))
X	t
X	)
X    ))
X
X(defun mhspool-request-stat (id)
X  "Select article by message ID (or number)."
X  (error "MHSPOOL: STAT is not implemented."))
X
X(defun mhspool-request-group (group)
X  "Select news GROUP."
X  (cond ((file-directory-p
X	  (mhspool-article-pathname group))
X	 ;; Mail/NEWS.GROUP/N
X	 (setq mhspool-current-directory
X	       (mhspool-article-pathname group)))
X	((file-directory-p
X	  (mhspool-article-pathname
X	   (mhspool-replace-chars-in-string group ?. ?/)))
X	 ;; Mail/NEWS/GROUP/N
X	 (setq mhspool-current-directory
X	       (mhspool-article-pathname
X		(mhspool-replace-chars-in-string group ?. ?/))))
X	))
X
X(defun mhspool-request-list ()
X  "List valid newsgoups."
X  (save-excursion
X    (let* ((newsgroup nil)
X	   (articles nil)
X	   (directory (file-name-as-directory
X		       (expand-file-name mhspool-spool-directory nil)))
X	   (folder-regexp (concat "^" (regexp-quote directory) "\\(.+\\):$"))
X	   (buffer (get-buffer-create " *GNUS file listing*")))
X      (set-buffer nntp-server-buffer)
X      (erase-buffer)
X      (set-buffer buffer)
X      (erase-buffer)
X      (call-process "ls" nil t nil mhspool-list-directory-switches directory)
X      (goto-char (point-min))
X      (while (re-search-forward folder-regexp nil t)
X	(setq newsgroup
X	      (mhspool-replace-chars-in-string
X	       (buffer-substring (match-beginning 1) (match-end 1)) ?/ ?.))
X	(setq articles nil)
X	(forward-line 1)		;(beginning-of-line)
X	;; Thank nobu@flab.fujitsu.junet for his bug fixes.
X	(while (and (not (eobp))
X		    (not (looking-at "^$")))
X	  (if (looking-at "^[0-9]+$")
X	      (setq articles
X		    (cons (string-to-int
X			   (buffer-substring
X			    (match-beginning 0) (match-end 0)))
X			  articles)))
X	  (forward-line 1))
X	(if articles
X	    (princ (format "%s %d %d n\n" newsgroup
X			   (apply (function max) articles)
X			   (apply (function min) articles))
X		   nntp-server-buffer))
X	)
X      (kill-buffer buffer)
X      (set-buffer nntp-server-buffer)
X      (buffer-size)
X      )))
X
X(defun mhspool-request-last ()
X  "Set current article pointer to the previous article
Xin the current news group."
X  (error "MHSPOOL: LAST is not implemented."))
X
X(defun mhspool-request-next ()
X  "Advance current article pointer."
X  (error "MHSPOOL: NEXT is not implemented."))
X
X(defun mhspool-request-post ()
X  "Post a new news in current buffer."
X  (setq nntp-status-message-string "MHSPOOL: what do you mean post?")
X  nil
X  )
X
X
X;;;
X;;; Replacement of Low-Level Interface to NNTP Server.
X;;; 
X
X(defun mhspool-open-server-internal (host &optional service)
X  "Open connection to news server on HOST by SERVICE (default is nntp)."
X  (save-excursion
X    (if (not (string-equal host (system-name)))
X	(error "MHSPOOL: cannot talk to %s." host))
X    ;; Initialize communication buffer.
X    (setq nntp-server-buffer (get-buffer-create " *nntpd*"))
X    (set-buffer nntp-server-buffer)
X    (buffer-flush-undo (current-buffer))
X    (erase-buffer)
X    (kill-all-local-variables)
X    (setq case-fold-search t)		;Should ignore case.
X    (setq nntp-server-process nil)
X    (setq nntp-server-name host)
X    ;; It is possible to change kanji-fileio-code in this hook.
X    (run-hooks 'nntp-server-hook)
X    t
X    ))
X
X(defun mhspool-close-server-internal ()
X  "Close connection to news server."
X  (if nntp-server-buffer
X      (kill-buffer nntp-server-buffer))
X  (setq nntp-server-buffer nil)
X  (setq nntp-server-process nil))
X
X(defun mhspool-find-file (file)
X  "Insert FILE in server buffer safely."
X  (set-buffer nntp-server-buffer)
X  (erase-buffer)
X  (condition-case ()
X      (progn
X	(insert-file-contents file)
X	(goto-char (point-min))
X	;; If there is no body, `^L' appears at end of file. Special
X	;; hack for MH folder.
X	(and (search-forward "\n\n" nil t)
X	     (string-equal (buffer-substring (point) (point-max)) "\^L")
X	     (delete-char 1))
X	t
X	)
X    (file-error nil)
X    ))
X
X(defun mhspool-article-pathname (group)
X  "Make pathname for GROUP."
X  (concat (file-name-as-directory mhspool-spool-directory) group "/"))
X
X(defun mhspool-replace-chars-in-string (string from to)
X  "Replace characters in STRING from FROM to TO."
X  (let ((string (substring string 0))	;Copy string.
X	(len (length string))
X	(idx 0))
X    ;; Replace all occurence of FROM with TO.
X    (while (< idx len)
X      (if (= (aref string idx) from)
X	  (aset string idx to))
X      (setq idx (1+ idx)))
X    string
X    ))
SHAR_EOF
chmod 0644 mhspool.el || echo "restore of mhspool.el fails"
set `wc -c mhspool.el`;Sum=$1
if test "$Sum" != "12157"
then echo original size 12157, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > nnspool.el &&
X;;; Spool access using NNTP for GNU Emacs
X;; Copyright (C) 1988, 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1988, 1989 Masanobu UMEDA
X;; $Header: nnspool.el,v 1.9 89/06/19 13:38:47 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X(provide 'nnspool)
X(require 'nntp)
X
X(defvar nnspool-inews-program news-inews-program
X  "*Program to post news.")
X
X(defvar nnspool-inews-switches "-h"
X  "*Switches for nnspool-request-post to pass to `inews' for posting news.")
X
X(defvar nnspool-spool-directory news-path
X  "*Local news spool directory.")
X
X(defvar nnspool-active-file "/usr/lib/news/active"
X  "*Local news active file.")
X
X(defvar nnspool-history-file "/usr/lib/news/history"
X  "*Local news history file.")
X
X
X
X(defconst nnspool-version "NNSPOOL 1.9"
X  "Version numbers of this version of NNSPOOL.")
X
X(defvar nnspool-current-directory nil
X  "Current news group directory.")
X
X;;;
X;;; Replacement of Extended Command for retrieving many headers.
X;;;
X
X(defun nnspool-retrieve-headers (sequence)
X  "Return list of article headers specified by SEQUENCE of article id.
XThe format of list is `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID] ...)'.
XReader macros for the vector are defined as `nntp-header-FIELD'.
XWriter macros for the vector are defined as `nntp-set-header-FIELD'.
XNews group must be selected before calling me."
X  (save-excursion
X    (set-buffer nntp-server-buffer)
X    ;;(erase-buffer)
X    (let ((file nil)
X	  (number (length sequence))
X	  (count 0)
X	  (headers nil)			;Result list.
X	  (article 0)
X	  (subject nil)
X	  (message-id nil)
X	  (from nil)
X	  (xref nil)
X	  (lines 0)
X	  (date nil))
X      (while sequence
X	;;(nntp-send-strings-to-server "HEAD" (car sequence))
X	(setq article (car sequence))
X	(setq file
X	      (concat nnspool-current-directory (prin1-to-string article)))
X	(if (and (file-exists-p file)
X		 (not (file-directory-p file)))
X	    (progn
X	      (erase-buffer)
X	      (insert-file-contents file)
X	      (goto-char (point-min))
X	      (search-forward "\n\n" nil 'move)
X	      (narrow-to-region (point-min) (point))
X	      ;; Make it possible to search `\nFIELD'.
X	      (goto-char (point-min))
X	      (insert "\n")
X	      ;; Extract From:
X	      (goto-char (point-min))
X	      (if (search-forward "\nFrom: " nil t)
X		  (setq from (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq from "Unknown User"))
X	      ;; Extract Subject:
X	      (goto-char (point-min))
X	      (if (search-forward "\nSubject: " nil t)
X		  (setq subject (buffer-substring
X				 (point)
X				 (save-excursion (end-of-line) (point))))
X		(setq subject "(None)"))
X	      ;; Extract Message-ID:
X	      (goto-char (point-min))
X	      (if (search-forward "\nMessage-ID: " nil t)
X		  (setq message-id (buffer-substring
X				    (point)
X				    (save-excursion (end-of-line) (point))))
X		(setq message-id nil))
X	      ;; Extract Date:
X	      (goto-char (point-min))
X	      (if (search-forward "\nDate: " nil t)
X		  (setq date (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq date nil))
X	      ;; Extract Lines:
X	      (goto-char (point-min))
X	      (if (search-forward "\nLines: " nil t)
X		  (setq lines (string-to-int
X			       (buffer-substring
X				(point)
X				(save-excursion (end-of-line) (point)))))
X		(setq lines 0))
X	      ;; Extract Xref:
X	      (goto-char (point-min))
X	      (if (search-forward "\nXref: " nil t)
X		  (setq xref (buffer-substring
X			      (point)
X			      (save-excursion (end-of-line) (point))))
X		(setq xref nil))
X	      (setq headers
X		    (cons (vector article subject from
X				  xref lines date message-id)
X			  headers))
X	      ))
X	(setq sequence (cdr sequence))
X	(setq count (1+ count))
X	(if (and (> number nntp-large-newsgroup)
X		 (zerop (% count 20)))
X	    (message "NNSPOOL: %d%% of headers received."
X		     (/ (* count 100) number)))
X	)
X      (if (> number nntp-large-newsgroup)
X	  (message "NNSPOOL: 100%% of headers received."))
X      (nreverse headers)
X      )))
X
X
X;;;
X;;; Replacement of NNTP Raw Interface.
X;;;
X
X(defun nnspool-open-server (host &optional service)
X  "Open news server on HOST.
XIf HOST is nil, use value of environment variable `NNTPSERVER'.
XIf optional argument SERVICE is non-nil, open by the service name."
X  (let ((host (or host (getenv "NNTPSERVER")))
X	(status nil))
X    (setq nntp-status-message-string "")
X    (cond ((and (file-directory-p nnspool-spool-directory)
X		(file-exists-p nnspool-active-file)
X		(string-equal host (system-name)))
X	   (setq status (nnspool-open-server-internal host service)))
X	  ((string-equal host (system-name))
X	   (setq nntp-status-message-string
X		 (format "%s has no news spool.  Goodbye." host)))
X	  ((null host)
X	   (setq nntp-status-message-string "NNTP server is not specified."))
X	  (t
X	   (setq nntp-status-message-string
X		 (format "NNSPOOL: cannot talk to %s." host)))
X	  )
X    status
X    ))
X
X(defun nnspool-close-server ()
X  "Close news server."
X  (nnspool-close-server-internal))
X
X(fset 'nnspool-request-quit (symbol-function 'nnspool-close-server))
X
X(defun nnspool-server-opened ()
X  "Return server process status, T or NIL.
XIf the stream is opened, return T, otherwise return NIL."
X  (and nntp-server-buffer
X       (get-buffer nntp-server-buffer)))
X
X(defun nnspool-status-message ()
X  "Return server status response as string."
X  nntp-status-message-string
X  )
X
X(defun nnspool-request-article (id)
X  "Select article by message ID (or number)."
X  (let ((file (if (stringp id)
X		  (nnspool-find-article-by-message-id id)
X		(concat nnspool-current-directory (prin1-to-string id)))))
X    (if (and (stringp file)
X	     (file-exists-p file)
X	     (not (file-directory-p file)))
X	(save-excursion
X	  (nnspool-find-file file)))
X    ))
X
X(defun nnspool-request-body (id)
X  "Select article body by message ID (or number)."
X  (if (nnspool-request-article id)
X      (save-excursion
X	(set-buffer nntp-server-buffer)
X	(goto-char (point-min))
X	(if (search-forward "\n\n" nil t)
X	    (delete-region (point-min) (point)))
X	t
X	)
X    ))
X
X(defun nnspool-request-head (id)
X  "Select article head by message ID (or number)."
X  (if (nnspool-request-article id)
X      (save-excursion
X	(set-buffer nntp-server-buffer)
X	(goto-char (point-min))
X	(if (search-forward "\n\n" nil t)
X	    (delete-region (1- (point)) (point-max)))
X	t
X	)
X    ))
X
X(defun nnspool-request-stat (id)
X  "Select article by message ID (or number)."
X  (error "NNSPOOL: STAT is not implemented."))
X
X(defun nnspool-request-group (group)
X  "Select news GROUP."
X  (let ((pathname (nnspool-article-pathname
X		   (nnspool-replace-chars-in-string group ?. ?/))))
X    (if (file-directory-p pathname)
X	(setq nnspool-current-directory pathname))
X    ))
X
X(defun nnspool-request-list ()
X  "List valid newsgoups."
X  (save-excursion
X    (nnspool-find-file nnspool-active-file)))
X
X(defun nnspool-request-last ()
X  "Set current article pointer to the previous article
Xin the current news group."
X  (error "NNSPOOL: LAST is not implemented."))
X
X(defun nnspool-request-next ()
X  "Advance current article pointer."
X  (error "NNSPOOL: NEXT is not implemented."))
X
X(defun nnspool-request-post ()
X  "Post a new news in current buffer."
X  (save-excursion
X    ;; We have to work in the server buffer because of NEmacs hack.
X    (copy-to-buffer nntp-server-buffer (point-min) (point-max))
X    (set-buffer nntp-server-buffer)
X    (call-process-region (point-min) (point-max)
X    			 nnspool-inews-program 'delete t nil
X			 nnspool-inews-switches
X			 )
X    (prog1
X	(or (zerop (buffer-size))
X	    ;; If inews returns strings, it must be error message 
X	    ;;  unless SPOOLNEWS is defined.  
X	    ;; This condition is very weak, but there is no good rule 
X	    ;;  identifying errors when SPOOLNEWS is defined.  
X	    ;; Suggested by ohm@kaba.junet.
X	    (string-match "spooled" (buffer-string)))
X      ;; Make status message by unfolding lines.
X      (subst-char-in-region (point-min) (point-max) ?\n ?\\ 'noundo)
X      (setq nntp-status-message-string (buffer-string))
X      (erase-buffer))
X    ))
X
X
X;;;
X;;; Replacement of Low-Level Interface to NNTP Server.
X;;; 
X
X(defun nnspool-open-server-internal (host &optional service)
X  "Open connection to news server on HOST by SERVICE (default is nntp)."
X  (save-excursion
X    (if (not (string-equal host (system-name)))
X	(error "NNSPOOL: cannot talk to %s." host))
X    ;; Initialize communication buffer.
X    (setq nntp-server-buffer (get-buffer-create " *nntpd*"))
X    (set-buffer nntp-server-buffer)
X    (buffer-flush-undo (current-buffer))
X    (erase-buffer)
X    (kill-all-local-variables)
X    (setq case-fold-search t)		;Should ignore case.
X    (setq nntp-server-process nil)
X    (setq nntp-server-name host)
X    ;; It is possible to change kanji-fileio-code in this hook.
X    (run-hooks 'nntp-server-hook)
X    t
X    ))
X
X(defun nnspool-close-server-internal ()
X  "Close connection to news server."
X  (if (get-file-buffer nnspool-history-file)
X      (kill-buffer (get-file-buffer nnspool-history-file)))
X  (if nntp-server-buffer
X      (kill-buffer nntp-server-buffer))
X  (setq nntp-server-buffer nil)
X  (setq nntp-server-process nil))
X
X(defun nnspool-find-article-by-message-id (id)
X  "Return full pathname of an artilce identified by message-ID."
X  (save-excursion
X    (let ((buffer (get-file-buffer nnspool-history-file)))
X      (if buffer
X	  (set-buffer buffer)
X	;; Finding history file may take lots of time.
X	(message "Reading history file...")
X	(set-buffer (find-file-noselect nnspool-history-file))
X	(message "Reading history file... done")))
X    ;; Search from end of the file. I think this is much faster than
X    ;; do from the beginning of the file.
X    (goto-char (point-max))
X    (if (re-search-backward
X	 (concat "^" (regexp-quote id)
X		 "[ \t].*[ \t]\\([^ \t/]+\\)/\\([0-9]+\\)[ \t]*$") nil t)
X	(let ((group (buffer-substring (match-beginning 1) (match-end 1)))
X	      (number (buffer-substring (match-beginning 2) (match-end 2))))
X	  (concat (nnspool-article-pathname
X		   (nnspool-replace-chars-in-string group ?. ?/))
X		  number))
X      )))
X
X(defun nnspool-find-file (file)
X  "Insert FILE in server buffer safely."
X  (set-buffer nntp-server-buffer)
X  (erase-buffer)
X  (condition-case ()
X      (progn (insert-file-contents file) t)
X    (file-error nil)
X    ))
X
X(defun nnspool-article-pathname (group)
X  "Make pathname for GROUP."
X  (concat (file-name-as-directory nnspool-spool-directory) group "/"))
X
X(defun nnspool-replace-chars-in-string (string from to)
X  "Replace characters in STRING from FROM to TO."
X  (let ((string (substring string 0))	;Copy string.
X	(len (length string))
X	(idx 0))
X    ;; Replace all occurence of FROM with TO.
X    (while (< idx len)
X      (if (= (aref string idx) from)
X	  (aset string idx to))
X      (setq idx (1+ idx)))
X    string
X    ))
SHAR_EOF
chmod 0644 nnspool.el || echo "restore of nnspool.el fails"
set `wc -c nnspool.el`;Sum=$1
if test "$Sum" != "11538"
then echo original size 11538, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > nntp.el &&
X;;; NNTP (RFC977) Interface for GNU Emacs
X;; Copyright (C) 1987, 1988, 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1987, 1988, 1989 Masanobu UMEDA
X;; $Header: nntp.el,v 3.9 89/06/19 13:38:51 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;; This implementation is tested on both 1.2a and 1.5 version of the
X;; NNTP package.
X
X;; Troubleshooting of NNTP
X;;
X;; (1) Select routine may signal an error or fall into infinite loop
X;;  while waiting for the server response. In this case, you'd better
X;;  not use byte-compiled codes but original source. If you still have
X;;  a problems with it, set the variable `nntp-buggy-select' to T.
X;;
X;; (2) Emacs may hang up while retrieving headers since too many
X;;  requests have been sent to the NNTP server without reading their
X;;  replies. In this case, reduce the number of the requests sent to
X;;  the server at one time by setting the variable
X;;  `nntp-maximum-request' to a lower value.
X;;
X;; (3) If the TCP/IP stream (open-network-stream) is not supported by
X;;  emacs, compile and install `tcp.el' and `tcp.c' which is an
X;;  emulation program of the stream. If you modified `tcp.c' for your
X;;  system, please send me the diffs. I'll include some of them in the
X;;  future releases.
X
X(provide 'nntp)
X
X(defvar nntp-server-hook nil
X  "*Hooks for the NNTP server.
XIf the kanji code of the NNTP server is different from the local kanji
Xcode, the correct kanji code of the buffer associated with the NNTP
Xserver must be specified as follows:
X
X(setq nntp-server-hook
X      '(lambda ()
X	 ;; Server's Kanji code is EUC (NEmacs hack).
X	 (make-local-variable 'kanji-fileio-code)
X	 (setq kanji-fileio-code 0)))
X
XIf you'd like to change something depending on the server in this
Xhook, use the variable `nntp-server-name'.")
X
X(defvar nntp-buggy-select (memq system-type '(usg-unix-v fujitsu-uts))
X  "*T if your select routine is buggy.
XIf the select routine signals error or fall into infinite loop while
Xwaiting for the server response, the variable must be set to t.  In
Xcase of Fujitsu UTS, it is set to T since `accept-process-output'
Xdoesn't work properly.")
X
X(defvar nntp-maximum-request 400
X  "*The maximum number of the requests sent to the NNTP server at one time.
XIf Emacs hangs up while retrieving headers, set the variable to a
Xlower value.")
X
X(defvar nntp-large-newsgroup 50
X  "*The number of the articles which indicates a large newsgroup.
XIf the number of the articles is greater than the value, verbose
Xmessages will be shown to indicate the current status.")
X
X
X(defconst nntp-version "NNTP 3.9"
X  "Version numbers of this version of NNTP.")
X
X(defvar nntp-server-name nil
X  "The name of the host running NNTP server.")
X
X(defvar nntp-server-buffer nil
X  "Buffer associated with NNTP server process.")
X
X(defvar nntp-server-process nil
X  "The NNTP server process.
XYou'd better not use this variable in NNTP front-end program but
Xinstead use `nntp-server-buffer'.")
X
X(defvar nntp-status-message-string nil
X  "Save the server response message.
XYou'd better not use this variable in NNTP front-end program but
Xinstead call function `nntp-status-message' to get status message.")
X
X;;;
X;;; Extended Command for retrieving many headers.
X;;;
X;; Retrieving lots of headers by sending command asynchronously.
X;; Access functions to headers are defined as macro.
X
X(defmacro nntp-header-number (header)
X  "Return article number in HEADER."
X  (` (aref (, header) 0)))
X
X(defmacro nntp-set-header-number (header number)
X  "Set article number of HEADER to NUMBER."
X  (` (aset (, header) 0 (, number))))
X
X(defmacro nntp-header-subject (header)
X  "Return subject string in HEADER."
X  (` (aref (, header) 1)))
X
X(defmacro nntp-set-header-subject (header subject)
X  "Set article subject of HEADER to SUBJECT."
X  (` (aset (, header) 1 (, subject))))
X
X(defmacro nntp-header-from (header)
X  "Return author string in HEADER."
X  (` (aref (, header) 2)))
X
X(defmacro nntp-set-header-from (header from)
SHAR_EOF
echo "End of part 6, continue with part 7"
echo "7" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 7 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file nntp.el continued
#
CurArch=7
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> nntp.el
X  "Set article author of HEADER to FROM."
X  (` (aset (, header) 2 (, from))))
X
X(defmacro nntp-header-xref (header)
X  "Return xref string in HEADER."
X  (` (aref (, header) 3)))
X
X(defmacro nntp-set-header-xref (header xref)
X  "Set article xref of HEADER to xref."
X  (` (aset (, header) 3 (, xref))))
X
X(defmacro nntp-header-lines (header)
X  "Return lines in HEADER."
X  (` (aref (, header) 4)))
X
X(defmacro nntp-set-header-lines (header lines)
X  "Set article lines of HEADER to LINES."
X  (` (aset (, header) 4 (, lines))))
X
X(defmacro nntp-header-date (header)
X  "Return date in HEADER."
X  (` (aref (, header) 5)))
X
X(defmacro nntp-set-header-date (header date)
X  "Set article date of HEADER to DATE."
X  (` (aset (, header) 5 (, date))))
X
X(defmacro nntp-header-id (header)
X  "Return date in HEADER."
X  (` (aref (, header) 6)))
X
X(defmacro nntp-set-header-id (header id)
X  "Set article ID of HEADER to ID."
X  (` (aset (, header) 6 (, id))))
X
X(defun nntp-retrieve-headers (sequence)
X  "Return list of article headers specified by SEQUENCE of article id.
XThe format of list is `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID] ...)'.
XReader macros for the vector are defined as `nntp-header-FIELD'.
XWriter macros for the vector are defined as `nntp-set-header-FIELD'.
XNews group must be selected before calling me."
X  (save-excursion
X    (set-buffer nntp-server-buffer)
X    (erase-buffer)
X    (let ((number (length sequence))
X	  (last-point (point-min))
X	  (received 0)
X	  (count 0)
X	  (headers nil)			;Result list.
X	  (article 0)
X	  (subject nil)
X	  (message-id)
X	  (from nil)
X	  (xref nil)
X	  (lines 0)
X	  (date nil))
X      ;; Send HEAD command.
X      (while sequence
X	(nntp-send-strings-to-server "HEAD" (car sequence))
X	(setq sequence (cdr sequence))
X	(setq count (1+ count))
X	;; Every 400 header requests we have to read stream in order
X	;;  to avoid deadlock.
X	(if (or (null sequence)		;All requests have been sent.
X		(zerop (% count nntp-maximum-request)))
X	    (progn
X	      (accept-process-output)
X	      (while (progn
X		       (goto-char last-point)
X		       ;; Count replies.
X		       (while (re-search-forward "^[0-9]" nil t)
X			 (setq received (1+ received)))
X		       (setq last-point (point))
X		       (< received count))
X		;; If number of headers is greater than 100, give
X		;;  informative messages.
X		(and (> number nntp-large-newsgroup)
X		     (zerop (% received 20))
X		     (message "NNTP: %d%% of headers received."
X			      (/ (* received 100) number)))
X		(nntp-accept-response))
X	      ))
X	)
X      ;; Wait for text of last command.
X      (goto-char (point-max))
X      (re-search-backward "^[0-9]" nil t)
X      (if (looking-at "^[23]")
X	  (while (progn
X		   (goto-char (- (point-max) 3))
X		   (not (looking-at "^\\.\r$")))
X	    (nntp-accept-response)
X	    ))
X      (if (> number nntp-large-newsgroup)
X	  (message "NNTP: 100%% of headers received."))
X      ;; Now all of replies are received.
X      ;; First, delete unnecessary lines.
X      (goto-char (point-min))
X      (delete-non-matching-lines
X       "^Subject:\\|^Xref:\\|^From:\\|^Lines:\\|^Date:\\|^[23]")
X      (if (> number nntp-large-newsgroup)
X	  (message "NNTP: Parsing headers..."))
X      (setq received number)
X      ;; Then examines replies.
X      (while (not (eobp))
X	(cond ((looking-at "^[23].*[ \t]+\\([0-9]+\\)[ \t]+\\(<.+>\\)")
X	       (setq article
X		     (string-to-int
X		      (buffer-substring (match-beginning 1) (match-end 1))))
X	       (setq message-id
X		     (buffer-substring (match-beginning 2) (match-end 2)))
X	       (forward-line 1)
X	       ;; Set default value.
X	       (setq subject nil)
X	       (setq xref nil)
X	       (setq from nil)
X	       (setq lines 0)
X	       (setq date nil)
X	       ;; It is better to extract From:, Subject:, Date:,
X	       ;;  Lines: and Xref: field values in *THIS* order.
X	       ;; Forward-line each time after getting expected value
X	       ;;  in order to reduce count of string matching.
X	       (while (looking-at "^[^23]")
X		 (if (looking-at "^From:[ \t]\\(.*\\)\r$")
X		     (progn
X		       (setq from (buffer-substring (match-beginning 1)
X						    (match-end 1)))
X		       (forward-line 1)))
X		 (if (looking-at "^Subject:[ \t]\\(.*\\)\r$")
X		     (progn
X		       (setq subject (buffer-substring (match-beginning 1)
X						       (match-end 1)))
X		       (forward-line 1)))
X		 (if (looking-at "^Date:[ \t]\\(.*\\)\r$")
X		     (progn
X		       (setq date (buffer-substring (match-beginning 1)
X						    (match-end 1)))
X		       (forward-line 1)))
X		 (if (looking-at "^Lines:[ \t]\\(.*\\)\r$")
X		     (progn
X		       (setq lines (string-to-int
X				    (buffer-substring (match-beginning 1)
X						      (match-end 1))))
X		       (forward-line 1)))
X		 (if (looking-at "^Xref:[ \t]\\(.*\\)\r$")
X		     (progn
X		       (setq xref (buffer-substring (match-beginning 1)
X						    (match-end 1)))
X		       (forward-line 1)))
X		 ;; Skip invalid field (ex. Subject:abc)
X		 (if (looking-at "^[^:]*:[^ \t]")
X		     (forward-line 1))
X		 )
X	       (if (null subject)
X		   (setq subject "(None)"))
X	       (if (null from)
X		   (setq from "Unknown User"))
X	       (setq headers
X		     (cons (vector article subject from
X				   xref lines date message-id)
X			   headers))
X	       )
X	      (t (forward-line 1))	;Skip invalid field (ex. Subject:abc)
X	      )
X	(setq received (1- received))
X	(and (> number nntp-large-newsgroup)
X	     (zerop (% received 20))
X	     (message "NNTP: Parsing headers... %d%%"
X		      (/ (* received 100) number)))
X	)
X      (if (> number nntp-large-newsgroup)
X	  (message "NNTP: Parsing headers... done"))
X      (nreverse headers)
X      )))
X
X
X;;;
X;;; Raw Interface to Network News Transfer Protocol (RFC977).
X;;;
X
X(defun nntp-open-server (host &optional service)
X  "Open news server on HOST.
XIf HOST is nil, use value of environment variable `NNTPSERVER'.
XIf optional argument SERVICE is non-nil, open by the service name."
X  (let ((host (or host (getenv "NNTPSERVER")))
X	(status nil))
X    (setq nntp-status-message-string "")
X    (cond ((and host (nntp-open-server-internal host service))
X	   (setq status (nntp-wait-for-response "^[23].*\r$"))
X	   ;; Do check unexpected close of connection.
X	   ;; Suggested by feldmark@hanako.stars.flab.fujitsu.junet.
X	   (if status
X	       (set-process-sentinel nntp-server-process
X				     'nntp-default-sentinel)
X	     ;; We have to close connection here, since function
X	     ;;  `nntp-server-opened' may return incorrect status.
X	     (nntp-close-server-internal)
X	     ))
X	  ((null host)
X	   (setq nntp-status-message-string "NNTP server is not specified."))
X	  )
X    status
X    ))
X
X(defun nntp-close-server ()
X  "Close news server."
X  (unwind-protect
X      (progn
X	;; Un-set default sentinel function before closing connection.
X	(and nntp-server-process
X	     (eq 'nntp-default-sentinel
X		 (process-sentinel nntp-server-process))
X	     (set-process-sentinel nntp-server-process nil))
X	;; We cannot send QUIT command unless the process is running.
X	(if (nntp-server-opened)
X	    (nntp-send-command nil "QUIT"))
X	)
X    (nntp-close-server-internal)
X    ))
X
X(fset 'nntp-request-quit (symbol-function 'nntp-close-server))
X
X(defun nntp-server-opened ()
X  "Return server process status, T or NIL.
XIf the stream is opened, return T, otherwise return NIL."
X  (and nntp-server-process
X       (memq (process-status nntp-server-process) '(open run))))
X
X(defun nntp-status-message ()
X  "Return server status response as string."
X  (if (and nntp-status-message-string
X	   ;; NNN MESSAGE
X	   (string-match "[0-9][0-9][0-9][ \t]+\\([^\r]*\\).*$"
X			 nntp-status-message-string))
X      (substring nntp-status-message-string (match-beginning 1) (match-end 1))
X    ;; Empty message if nothing.
X    ""
X    ))
X
X(defun nntp-request-article (id)
X  "Select article by message ID (or number)."
X  (prog1
X      ;; If NEmacs, end of message may look like: "\256\215" (".^M")
X      (nntp-send-command "^\\.\r$" "ARTICLE" id)
X    (nntp-decode-text)
X    ))
X
X(defun nntp-request-body (id)
X  "Select article body by message ID (or number)."
X  (prog1
X      ;; If NEmacs, end of message may look like: "\256\215" (".^M")
X      (nntp-send-command "^\\.\r$" "BODY" id)
X    (nntp-decode-text)
X    ))
X
X(defun nntp-request-head (id)
X  "Select article head by message ID (or number)."
X  (prog1
X      (nntp-send-command "^\\.\r$" "HEAD" id)
X    (nntp-decode-text)
X    ))
X
X(defun nntp-request-stat (id)
X  "Select article by message ID (or number)."
X  (nntp-send-command "^[23].*\r$" "STAT" id))
X
X(defun nntp-request-group (group)
X  "Select news GROUP."
X  ;; 1.2a NNTP's group command is buggy. "^M" (\r) is not appended to
X  ;;  end of the status message.
X  (nntp-send-command "^[23].*$" "GROUP" group))
X
X(defun nntp-request-list ()
X  "List valid newsgoups."
X  (prog1
X      (nntp-send-command "^\\.\r$" "LIST")
X    (nntp-decode-text)
X    ))
X
X(defun nntp-request-last ()
X  "Set current article pointer to the previous article
Xin the current news group."
X  (nntp-send-command "^[23].*\r$" "LAST"))
X
X(defun nntp-request-next ()
X  "Advance current article pointer."
X  (nntp-send-command "^[23].*\r$" "NEXT"))
X
X(defun nntp-request-post ()
X  "Post a new news in current buffer."
X  (if (nntp-send-command "^[23].*\r$" "POST")
X      (progn
X	(nntp-encode-text)
X	(nntp-send-region-to-server (point-min) (point-max))
X	;; 1.2a NNTP's post command is buggy. "^M" (\r) is not
X	;;  appended to end of the status message.
X	(nntp-wait-for-response "^[23].*$")
X	)))
X
X(defun nntp-default-sentinel (proc status)
X  "Default sentinel function for NNTP server process."
X  (if (and nntp-server-process
X	   (not (nntp-server-opened)))
X      (error "NNTP: Connection closed.")
X    ))
X
X;; Encoding and decoding of NNTP text.
X
X(defun nntp-decode-text ()
X  "Decode text transmitted by NNTP.
X0. Delete status line.
X1. Delete `^M' at end of line.
X2. Delete `.' at end of buffer (end of text mark).
X3. Delete `.' at beginning of line."
X  (save-excursion
X    (set-buffer nntp-server-buffer)
X    ;; Insert newline at end of buffer.
X    (goto-char (point-max))
X    (if (not (bolp))
X	(insert "\n"))
X    ;; Delete status line.
X    (goto-char (point-min))
X    (delete-region (point) (progn (forward-line 1) (point)))
X    ;; Delete `^M' at end of line.
X    ;; (replace-regexp "\r$" "")
X    (while (not (eobp))
X      (end-of-line)
X      (if (= (preceding-char) ?\r)
X	  (delete-char -1))
X      (forward-line 1)
X      )
X    ;; Delete `.' at end of buffer (end of text mark).
X    (goto-char (point-max))
X    (forward-line -1)			;(beginning-of-line)
X    (if (looking-at "^\\.$")
X	(delete-region (point) (progn (forward-line 1) (point))))
X    ;; Replace `..' at beginning of line with `.'.
X    (goto-char (point-min))
X    ;; (replace-regexp "^\\.\\." ".")
X    (while (search-forward "\n.." nil t)
X      (delete-char -1))
X    ))
X
X(defun nntp-encode-text ()
X  "Encode text in current buffer for NNTP transmission.
X1. Insert `.' at beginning of line.
X2. Insert `.' at end of buffer (end of text mark)."
X  (save-excursion
X    ;; Insert newline at end of buffer.
X    (goto-char (point-max))
X    (if (not (bolp))
X	(insert "\n"))
X    ;; Replace `.' at beginning of line with `..'.
X    (goto-char (point-min))
X    ;; (replace-regexp "^\\." "..")
X    (while (search-forward "\n." nil t)
X      (insert "."))
X    ;; Insert `.' at end of buffer (end of text mark).
X    (goto-char (point-max))
X    (insert ".\n")
X    ))
X
X
X;;;
X;;; Synchronous Communication with NNTP Server.
X;;;
X
X(defun nntp-send-command (response cmd &rest args)
X  "Wait for server RESPONSE after sending CMD and optional ARGS to server."
X  (save-excursion
X    ;; Clear communication buffer.
X    (set-buffer nntp-server-buffer)
X    (erase-buffer)
X    (apply 'nntp-send-strings-to-server cmd args)
X    (if response
X	(nntp-wait-for-response response)
X      t)
X    ))
X
X(defun nntp-wait-for-response (regexp)
X  "Wait for server response which matches REGEXP."
X  (save-excursion
X    (let ((status t)
X	  (wait t))
X      (set-buffer nntp-server-buffer)
X      ;; Wait for status response (RFC977).
X      ;; 1xx - Informative message.
X      ;; 2xx - Command ok.
X      ;; 3xx - Command ok so far, send the rest of it.
X      ;; 4xx - Command was correct, but couldn't be performed for some
X      ;;       reason.
X      ;; 5xx - Command unimplemented, or incorrect, or a serious
X      ;;       program error occurred.
X      (nntp-accept-response)
X      (while wait
X	(goto-char (point-min))
X	(cond ((looking-at "[23]")
X	       (setq wait nil))
X	      ((looking-at "[45]")
X	       (setq status nil)
X	       (setq wait nil))
X	      (t (nntp-accept-response))
X	      ))
X      ;; Save status message.
X      (end-of-line)
X      (setq nntp-status-message-string
X	    (buffer-substring (point-min) (point)))
X      (if status
X	  (progn
X	    (setq wait t)
X	    (while wait
X	      (goto-char (point-max))
X	      (forward-line -1)		;(beginning-of-line)
X	      ;;(message (buffer-substring
X	      ;;	 (point)
X	      ;;	 (save-excursion (end-of-line) (point))))
X	      (if (looking-at regexp)
X		  (setq wait nil)
X		(message "NNTP: Reading...")
X		(nntp-accept-response)
X		(message "")
X		))
X	    ;; Successfully received server response.
X	    t
X	    ))
X      )))
X
X
X;;;
X;;; Low-Level Interface to NNTP Server.
X;;; 
X
X(defun nntp-send-strings-to-server (&rest strings)
X  "Send list of STRINGS to news server as command and its arguments."
X  (let ((cmd (car strings))
X	(strings (cdr strings)))
X    ;; Command and each argument must be separeted by one or more spaces.
X    (while strings
X      (setq cmd (concat cmd " " (car strings)))
X      (setq strings (cdr strings)))
X    ;; Command line must be terminated by a CR-LF.
X    (process-send-string nntp-server-process (concat cmd "\n"))
X    ))
X
X(defun nntp-send-region-to-server (begin end)
X  "Send current buffer region (from BEGIN to END) to news server."
X  (save-excursion
X    ;; We have to work in the buffer associated with NNTP server
X    ;;  process because of NEmacs hack.
X    (copy-to-buffer nntp-server-buffer begin end)
X    (set-buffer nntp-server-buffer)
X    (setq begin (point-min))
X    (setq end (point-max))
X    ;; `process-send-region' does not work if text to be sent is very
X    ;;  large. I don't know maximum size of text sent correctly.
X    (let ((last nil)
X	  (size 100))			;Size of text sent at once.
X      (save-restriction
X	(narrow-to-region begin end)
X	(goto-char begin)
X	(while (not (eobp))
X	  ;;(setq last (min end (+ (point) size)))
X	  ;; NEmacs gets confused if character at `last' is Kanji.
X	  (setq last (save-excursion
X		       (goto-char (min end (+ (point) size)))
X		       (or (eobp) (forward-char 1)) ;Adjust point
X		       (point)))
X	  (process-send-region nntp-server-process (point) last)
X	  ;; I don't know whether the next codes solve the known
X	  ;;  problem of communication error of GNU Emacs.
X	  (accept-process-output)
X	  ;;(sit-for 0)
X	  (goto-char last)
X	  )))
X    ;; We cannot erase buffer, because reply may be received.
X    (delete-region begin end)
X    ))
X
X(defun nntp-open-server-internal (host &optional service)
X  "Open connection to news server on HOST by SERVICE (default is nntp)."
X  (save-excursion
X    ;; Use TCP/IP stream emulation package if needed.
X    (or (fboundp 'open-network-stream)
X	(require 'tcp))
X    ;; Initialize communication buffer.
X    (setq nntp-server-buffer (get-buffer-create " *nntpd*"))
X    (set-buffer nntp-server-buffer)
X    (buffer-flush-undo (current-buffer))
X    (erase-buffer)
X    (kill-all-local-variables)
X    (setq case-fold-search t)		;Should ignore case.
X    (setq nntp-server-process
X	  (open-network-stream "nntpd" (current-buffer)
X			       host (or service "nntp")))
X    (setq nntp-server-name host)
X    ;; It is possible to change kanji-fileio-code in this hook.
X    (run-hooks 'nntp-server-hook)
X    ;; Return the server process.
X    nntp-server-process
X    ))
X
X(defun nntp-close-server-internal ()
X  "Close connection to news server."
X  (if nntp-server-process
X      (delete-process nntp-server-process))
X  (if nntp-server-buffer
X      (kill-buffer nntp-server-buffer))
X  (setq nntp-server-buffer nil)
X  (setq nntp-server-process nil))
X
X(defun nntp-accept-response ()
X  "Read response of server.
XIt is well-known that the communication speed will be much improved by
Xdefining this function as macro."
X  ;; To deal with server process exiting before
X  ;;  accept-process-output is called.
X  ;; Suggested by Jason Venner <jason@violet.berkeley.edu>.
X  ;; This is a copy of `nntp-default-sentinel'.
X  (or (memq (process-status nntp-server-process) '(open run))
X      (error "NNTP: Connection closed."))
X  (if nntp-buggy-select
X      (progn
X	;; We cannot use `accept-process-output'.
X	;; Fujitsu UTS requires messages during sleep-for. I don't know why.
X	(message "NNTP: Reading...")
X	(sleep-for 1)
X	(message ""))
X    (condition-case errorcode
X	(accept-process-output nntp-server-process)
X      (error
X       (cond ((string-equal "select error: Invalid argument" (nth 1 errorcode))
X	      ;; Ignore select error.
X	      nil
X	      )
X	     (t
X	      (signal (car errorcode) (cdr errorcode))))
X       ))
X    ))
SHAR_EOF
chmod 0644 nntp.el || echo "restore of nntp.el fails"
set `wc -c nntp.el`;Sum=$1
if test "$Sum" != "21708"
then echo original size 21708, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > tcp.el &&
X;;; TCP/IP stream emulation for GNU Emacs
X;; Copyright (C) 1988, 1989 Fujitsu Laboratories LTD.
X;; Copyright (C) 1988, 1989 Masanobu UMEDA
X;; $Header: tcp.el,v 1.4 89/06/19 13:38:59 umerin Exp $
X
X;; This file is part of GNU Emacs.
X
X;; GNU Emacs is distributed in the hope that it will be useful,
X;; but WITHOUT ANY WARRANTY.  No author or distributor
X;; accepts responsibility to anyone for the consequences of using it
X;; or for whether it serves any particular purpose or works at all,
X;; unless he says so in writing.  Refer to the GNU Emacs General Public
X;; License for full details.
X
X;; Everyone is granted permission to copy, modify and redistribute
X;; GNU Emacs, but only under the conditions described in the
X;; GNU Emacs General Public License.   A copy of this license is
X;; supposed to have been given to you along with GNU Emacs so you
X;; can know your rights and responsibilities.  It should be in a
X;; file named COPYING.  Among other things, the copyright notice
X;; and this notice must be preserved on all copies.
X
X;; Notes on TCP package:
X;;
X;; This package provides a TCP/IP stream emulation on GNU Emacs. If
X;; the function `open-network-stream' is not defined in Emacs, but
X;; your operating system has a capability of network stream
X;; connection, this tcp package can be used for communicating with
X;; NNTP server.
X;;
X;; The tcp package runs inferior process named `tcp' which actually
X;; does the role of `open-network-stream'. Before loading the package,
X;; compile `tcp.c' and install it as `tcp' in a direcotry in the emacs
X;; search path. If you modify `tcp.c', please send diffs to the author
X;; of GNUS.  I'll include some of them in the next releases.
X
X(provide 'tcp)
X
X(defvar tcp-program-name "tcp"
X  "A name of the program emulating open-network-stream function.")
X
X(defun open-network-stream (name buffer host service)
X  "Open a TCP connection for a service to a host.
XReturns a subprocess-object to represent the connection.
XInput and output work as for subprocesses; `delete-process' closes it.
XArgs are NAME BUFFER HOST SERVICE.
XNAME is name for process.  It is modified if necessary to make it unique.
XBUFFER is the buffer (or buffer-name) to associate with the process.
X Process output goes at end of that buffer, unless you specify
X an output stream or filter function to handle the output.
X BUFFER may be also nil, meaning that this process is not associated
X with any buffer
XThird arg is name of the host to connect to.
XFourth arg SERVICE is name of the service desired, or an integer
X specifying a port number to connect to."
X  (let ((proc
X	 (start-process name buffer 
X			tcp-program-name
X			"-h" host 
X			"-s" (if (stringp service)
X				 service
X			       (int-to-string service))
X			)))
X    (process-kill-without-query proc)
X    ;; Return process
X    proc
X    ))
SHAR_EOF
chmod 0644 tcp.el || echo "restore of tcp.el fails"
set `wc -c tcp.el`;Sum=$1
if test "$Sum" != "2808"
then echo original size 2808, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > tcp.c &&
X/*
X * TCP/IP stream emulation for GNU Emacs.
X * Copyright (C) 1988, 1989 Fujitsu Laboratories LTD.
X * Copyright (C) 1988, 1989 Masanobu UMEDA
X * $Header: tcp.c,v 1.3 89/06/19 13:39:12 umerin Exp $
X
X * This file is part of GNU Emacs.
X
X * GNU Emacs is distributed in the hope that it will be useful,
X * but WITHOUT ANY WARRANTY.  No author or distributor
X * accepts responsibility to anyone for the consequences of using it
X * or for whether it serves any particular purpose or works at all,
X * unless he says so in writing.  Refer to the GNU Emacs General Public
X * License for full details.
X
X * Everyone is granted permission to copy, modify and redistribute
X * GNU Emacs, but only under the conditions described in the
X * GNU Emacs General Public License.   A copy of this license is
X * supposed to have been given to you along with GNU Emacs so you
X * can know your rights and responsibilities.  It should be in a
X * file named COPYING.  Among other things, the copyright notice
X * and this notice must be preserved on all copies.
X 
X * If you modify the source for your system, please send me the diffs.
X * I'll includes some of them in the future releases.
X *
X * Yasunari,Itoh at PFU limited contributed for Fujitsu UTS and SX/A.
X *
X * Thu Apr  6 13:47:37 JST 1989
X * USG fixes by Sakaeda <saka@mickey.trad.pf.fujitsu.junet>
X *
X * For Fujitsu UTS compile with:
X *	cc -O -o tcp tcp.c -DFUJITSU_UTS -lu -lsocket
X */
X
X#ifndef lint
Xstatic char *rcsId = "$Header: tcp.c,v 1.3 89/06/19 13:39:12 umerin Exp $";
X#endif
X
X#include <stdio.h>
X#include <fcntl.h>
X#include <ctype.h>
X#include <sys/types.h>
X
X#ifdef FUJITSU_UTS
X#define USG
X#include <sys/ucbtypes.h>
X#include <sys/tisp/socket.h>
X#include <netdb.h>
X#include <sys/tisp/in.h>
X#else
X#include <sys/socket.h>
X#include <netdb.h>
X#include <netinet/in.h>
X#endif
X
X#ifdef USG
X#include <sys/stat.h>
X#include <signal.h>
X#endif
X
X#ifdef FUJITSU_UTS
X#define bcopy(f,t,n)    memcpy(t,f,n)
X#define bcmp(b1,b2,n)   (memcmp(b1,b2,n)!=0)
X#define bzero(b,n)      memset(b,0,n)
X#endif
X
X#ifdef USG
Xint selectable = 1;
X
Xsigout()
X{
X  fcntl(fileno(stdin),F_SETFL,0);
X  exit(-1);
X}
X#endif
X
Xmain(argc, argv)
Xint	argc;
Xchar	*argv[];
X{
X  struct hostent	*host;
X  struct sockaddr_in	sockin, sockme;
X  struct servent	*serv;
X  char	*hostname;
X  char	*service = "nntp";
X  int	port;
X  int	readfds;
X  int   writefds;
X  int	server;			/* NNTP Server */
X  int	emacsIn = fileno(stdin); /* Emacs intput */
X  int	emacsOut = fileno(stdout); /* Emacs output */
X  char	buffer[1024];
X  int	nbuffer;		/* Number of bytes in buffer */
X  int   wret;
X  char  *retry;                  /* retry bufferp */
X
X  while(--argc > 0){
X    switch(**(++argv)){
X    case '-':
X      {
X	char	*p = &argv[0][1];
X	if(strcmp(p,"s")==0){	/* Service name */
X	  service = *(++argv);
X	  --argc;
X	} else if(strcmp(p,"h")==0){ /* Host name */
X	  hostname = *(++argv);
X	  --argc;
X	} else {
X	  fprintf(stderr, "Usage: tcp -h HOST -s SERVICE\n");
X	  exit(1);
X	}
X      }
X      break;
X    default:
X      fprintf(stderr, "Usage: tcp -h HOST [-s SERVICE]\n");
X      exit(1);
X      break;
X    }
X  }
X
X  if((host = gethostbyname(hostname)) == NULL){
X    perror("gethostbyname");
X    exit(1);
X  }
X  if(isdigit(service[0]))
X    port = atoi(service);
X  else {
X    serv = getservbyname(service, "tcp");
X    if(serv == NULL){
X      perror("getservbyname");
X      exit(1);
X    }
X    port = serv->s_port;
X  }
X
X  bzero(&sockin, sizeof(sockin));
X  sockin.sin_family = host->h_addrtype;
X  bcopy(host->h_addr, &sockin.sin_addr, host->h_length);
X  sockin.sin_port = htons(port);
X  if((server = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
X    perror("socket");
X    exit(1);
X  }
X  if(setsockopt(server, SOL_SOCKET, SO_REUSEADDR, 0, 0)) {
X    perror("setsockopt");
X    exit(1);
X  }
X  bzero(&sockme, sizeof(sockme));
X  sockme.sin_family = sockin.sin_family;
X  sockme.sin_addr.s_addr = INADDR_ANY;
X  if(bind(server, &sockme, sizeof(sockme)) < 0){
X    perror("bind");
X    exit(1);
X  }
X  if(connect(server, &sockin, sizeof (sockin)) < 0){
X    perror("connect");
X    close(server);
X    exit(1);
X  }
X
X#ifdef O_NDELAY
X  fcntl(server, F_SETFL, O_NDELAY);
X
X#ifdef USG
X  /* USG pipe cannot not select emacsIn */
X  {
X    struct stat statbuf;
X    fstat (emacsIn,&statbuf);
X    if (statbuf.st_mode & 010000)
X      selectable = 0;
X    if (!selectable){
X      signal(SIGINT,sigout);
X      fcntl(emacsIn, F_SETFL, O_NDELAY);
X    }
X  }
X#endif
X#endif
X
X  /* Connection established. */
X  while(1){
X    readfds = (1 << server) | (1 << emacsIn);
X    if(select(32, &readfds, NULL, NULL, (struct timeval *)NULL) == -1){
X      perror("select");
X      exit(1);
X    }
X    if(readfds & (1 << emacsIn)){
X      /* From Emacs */
X      nbuffer = read(emacsIn, buffer, sizeof buffer -1);
X
X#ifdef USG
X      if (selectable && nbuffer == 0){
X	goto finish;
X      } else if (!(readfds & (1 << server)) && nbuffer == 0){
X	sleep (1);
X      } else 
X#else
X      if(nbuffer == 0)
X	goto finish;
X#endif
X      for(retry = buffer; nbuffer > 0; nbuffer -= wret, retry += wret){
X	writefds = 1 << server;
X	if(select(server+1,NULL,&writefds,NULL,(struct timeval*)NULL) == -1){
X	  perror("select");
X	  exit(1);
X	}
X	wret = write(server, retry, nbuffer);
X	if(wret < 0) goto finish;
X      }
X    }
X    if(readfds & (1 << server)){
X      /* From NNTP server */
X      nbuffer = read(server, buffer, sizeof buffer -1);
X      if(nbuffer == 0)
X	goto finish;
X      for(retry = buffer; nbuffer > 0; nbuffer -= wret, retry += wret){
X	writefds = 1 << emacsOut;
X#ifdef USG
X	if(selectable)
X#endif
X	  if(select(emacsOut+1,NULL,&writefds,NULL,(struct timeval*)NULL) == -1){
X	    perror("select");
X	    exit(1);
X	  }
X	wret = write(emacsOut, retry, nbuffer);
X	if(wret < 0) goto finish;
X      }
X    }
X  }
X
X  /* End of communication. */
X finish:
X  close(server);
X#ifdef USG
X  if (!selectable) fcntl(emacsIn, F_SETFL,0);
X#endif
X  close(emacsIn);
X  close(emacsOut);
X  exit(0);
X}
SHAR_EOF
chmod 0644 tcp.c || echo "restore of tcp.c fails"
set `wc -c tcp.c`;Sum=$1
if test "$Sum" != "5851"
then echo original size 5851, current size $Sum;fi
sed 's/^X//' << 'SHAR_EOF' > gnus.texinfo &&
X\input texinfo                  @c -*-texinfo-*-
X@comment %**start of header (This is for running Texinfo on a region.)
X@setfilename ../info/gnus
X@settitle GNUS 3.12 Manual
X@iftex
X@finalout
X@end iftex
X@setchapternewpage odd
X@c      @smallbook
X@comment %**end of header (This is for running Texinfo on a region.)
X
X@tex
X\overfullrule=0pt
X%\global\baselineskip 30pt      % For printing in double spaces
X@end tex
X
X@ifinfo
XThis file documents GNUS, the GNU Emacs newsreader.
X
XCopyright (C) 1989 Fujitsu Laboratories LTD.
XCopyright (C) 1989 Masanobu UMEDA.
X
XPermission is granted to make and distribute verbatim copies of this
Xmanual provided the copyright notice and this permission notice are
Xpreserved on all copies.
X
X@ignore
XPermission is granted to process this file through TeX and print the
Xresults, provided the printed document carries copying permission notice
Xidentical to this one except for the removal of this paragraph (this
Xparagraph not being relevant to the printed manual).
X
X@end ignore
XPermission is granted to copy and distribute modified versions of this
Xmanual under the conditions for verbatim copying, provided also that the
Xsections entitled ``Distribution'' and ``GNUS General Public License''
Xare included exactly as in the original, and provided that the entire
Xresulting derived work is distributed under the terms of a permission
Xnotice identical to this one.
X
XPermission is granted to copy and distribute translations of this manual
Xinto another language, under the above conditions for modified versions,
Xexcept that the sections entitled ``Distribution'' and ``GNUS General
XPublic License'' may be included in a translation approved by the author
Xinstead of in the original English.
X@end ifinfo
X
X@titlepage
X@sp 6
X@center @titlefont{GNUS Manual}
X@sp 4
X@center Second Edition, GNUS Version 3.12
X@sp 1
X@center June 1989
X@sp 5
X@center Masanobu UMEDA
X@page
X
X@vskip 0pt plus 1filll
XCopyright @copyright{} 1989 Fujitsu Laboratories LTD.
X
XPermission is granted to make and distribute verbatim copies of
Xthis manual provided the copyright notice and this permission notice
Xare preserved on all copies.
X
XPermission is granted to copy and distribute modified versions of this
Xmanual under the conditions for verbatim copying, provided also that the
Xsections entitled ``Distribution'' and ``GNUS General Public License''
Xare included exactly as in the original, and provided that the entire
Xresulting derived work is distributed under the terms of a permission
Xnotice identical to this one.
X
XPermission is granted to copy and distribute translations of this manual
Xinto another language, under the above conditions for modified versions,
Xexcept that the sections entitled ``Distribution'' and ``GNUS General
XPublic License'' may be included in a translation approved by the author
Xinstead of in the original English.
X@end titlepage
X@page
X
X@ifinfo
X@node Top, Introduction,, (DIR)
X
XThe GNUS Newsreader
X*******************
X
X  GNUS is a network newsreader for GNU Emacs.  This Info file describes
Xhow to read and write USENET articles using GNUS and how to customize GNUS.
X
X@end ifinfo
X@menu
X* Distribution::        How to get the latest GNUS distribution.
X* License::             Permission to redistribute GNUS on certain terms.
X* Acknowledgments::     I would like to thank many people who have helped me.
X
X* Introduction::        An introduction to GNUS.
X* Installation::        How to install GNUS.
X* Starting up::         How to get started with GNUS.
X* Buffers of GNUS::     Buffers used by GNUS.
X* Newsgroup Commands::  Browsing through newsgroups.
X* Subject Commands::    Browsing through headers and messages.
X* Article Commands::    Commands for an article.
X* KILL File::           How to use KILL files.
X
X* Customization::       How to customize GNUS.
X* Problems::            How to solve problems with GNUS.
X* Reporting Bugs::      Mailing lists and USENET newsgroups for GNUS lovers.
X                        How to report bugs.
X
X* Key Index::           An item for each standard GNUS key sequence.
X* Command Index::       An item for each command name.
X* Variable Index::      An item for each documented variable.
X* Program Index::       An item for each program.
X* Concept Index::       An item for each concept.
X@end menu
X
X@node Distribution, License, Top, Top
X@unnumbered Distribution
X
XGNUS is @dfn{free}; this means that everyone is free to use it and free
Xto redistribute it on a free basis.  GNUS is not in the public domain;
Xit is copyrighted and there are restrictions on its distribution, but
Xthese restrictions are designed to permit everything that a good
Xcooperating citizen would want to do.  What is not allowed is to try to
Xprevent others from further sharing any version of GNUS that they might
Xget from you.  The precise conditions appears following this section.
X
XThe easiest way to get a copy of GNUS is from someone else who has it.
XYou need not ask for permission to do so, or tell any one else; just
Xcopy it.
X
XIf you have access to the Internet, you can get the latest version of
XGNUS from tut.cis.ohio-state.edu [128.146.8.60] using anonymous ftp.
XYou can also get it from osu-cis using anonymous uucp.
X
XYou may also receive GNUS when you buy a computer.  Computer
Xmanufacturers are free to distribute copies on the same terms that apply
Xto everyone else.  These terms require them to give you the full
Xsources, including whatever changes they may have made, and to permit
Xyou to redistribute the GNUS received from them under the usual terms of
Xthe General Public License.  In other words, the program must be free
Xfor you when you get it, not just free for the manufacturer.
X
XIf you cannot get a copy in any of those ways, you can order one from
Xthe author using electronic mail.  For further information, write to:
X
X@display
Xumerin@@flab.Fujitsu.CO.JP, or
Xumerin%flab.Fujitsu.JUNET@@uunet.uu.NET
X@end display
X
XIf you cannot reach the author using these addresses, try the following
Xmailing list:
X
X@cindex info-gnus-english
X@display
Xinfo-gnus-english@@tut.cis.ohio-state.edu
X@end display
X
X@noindent
XThe list is intended to exchange useful information about GNUS, such as
Xbug reports, useful hooks, and extensions.  Feel free to ask about the
Xnearest machine that has GNUS installed.  Subscription requests for this
Xlist should be sent to:
X
X@display
Xinfo-gnus-english-request@@tut.cis.ohio-state.edu
X@end display
X
X@noindent
X@xref{Reporting Bugs}, for more information on the mailing list.@refill
X
X@node License, Acknowledgments, Distribution, Top
X@unnumbered GNUS General Public License
X@center (Clarified 13 Jan 1989)
X
X  The license agreements of most software companies keep you at the
Xmercy of those companies.  By contrast, our general public license is
Xintended to give everyone the right to share GNUS.  To make sure that
Xyou get the rights we want you to have, we need to make restrictions
Xthat forbid anyone to deny you these rights or to ask you to surrender
Xthe rights.  Hence this license agreement.
X
X  Specifically, we want to make sure that you have the right to give
Xaway copies of GNUS, that you receive source code or else can get it if
Xyou want it, that you can change GNUS or use pieces of it in new free
Xprograms, and that you know you can do these things.
X
X  To make sure that everyone has such rights, we have to forbid you to
Xdeprive anyone else of these rights.  For example, if you distribute
Xcopies of GNUS, you must give the recipients all the rights that you
Xhave.  You must make sure that they, too, receive or can get the source
Xcode.  And you must tell them their rights.
X
X  Also, for our own protection, we must make certain that everyone finds
Xout that there is no warranty for GNUS.  If GNUS is modified by someone
Xelse and passed on, we want its recipients to know that what they have
Xis not what we distributed, so that any problems introduced by others
Xwill not reflect on our reputation.
X
X  Therefore I (Masanobu Umeda)@: use the following terms, which are
Xwritten for GNU Emacs by Richard Stallman and the Free Software
XFoundation, Inc.  They say what you must do to be allowed to distribute
Xor change GNU Emacs.  You can know your right to distribute or change
XGNUS by replacing any occurrences of GNU Emacs with GNUS.  Please apply
Xthe same policies to GNUS as GNU Emacs.@refill
X
X@unnumberedsec Copying Policies
X
X@enumerate
X@item
XYou may copy and distribute verbatim copies of GNU Emacs source code as
Xyou receive it, in any medium, provided that you conspicuously and
Xappropriately publish on each file a valid copyright notice ``Copyright
X@copyright{} 1988 Free Software Foundation, Inc.'' (or with whatever
Xyear is appropriate); keep intact the notices on all files that refer to
Xthis License Agreement and to the absence of any warranty; and give any
Xother recipients of the GNU Emacs program a copy of this License
XAgreement along with the program.  You may charge a distribution fee for
Xthe physical act of transferring a copy.
X
X@item
XYou may modify your copy or copies of GNU Emacs source code or
Xany portion of it, and copy and distribute such modifications under
Xthe terms of Paragraph 1 above, provided that you also do the following:
X
X@itemize @bullet
X@item
Xcause the modified files to carry prominent notices stating
Xwho last changed such files and the date of any change; and
X
X@item
Xcause the whole of any work that you distribute or publish, that
Xin whole or in part contains or is a derivative of GNU Emacs or any
Xpart thereof, to be licensed at no charge to all third parties on
Xterms identical to those contained in this License Agreement
X(except that you may choose to grant more extensive warranty
Xprotection to some or all third parties, at your option).
X
X@item
Xif the modified program serves as a text editor, cause it, when
Xstarted running in the simplest and usual way, to print an
Xannouncement including a valid copyright notice ``Copyright
X@copyright{} 1988 Free Software Foundation, Inc.'' (or with the
Xyear that is appropriate), saying that there is no warranty (or
Xelse, saying that you provide a warranty) and that users may
Xredistribute the program under these conditions, and telling the
Xuser how to view a copy of this License Agreement.
X
X@item
XYou may charge a distribution fee for the physical act of
Xtransferring a copy, and you may at your option offer warranty
Xprotection in exchange for a fee.
X@end itemize
X
XMere aggregation of another unrelated program with this program (or its
Xderivative) on a volume of a storage or distribution medium does not bring
Xthe other program under the scope of these terms.
X
X@item
XYou may copy and distribute GNU Emacs (or a portion or derivative of it,
Xunder Paragraph 2) in object code or executable form under the terms
Xof Paragraphs 1 and 2 above provided that you also do one of the
Xfollowing:
X
X@itemize @bullet
X@item
Xaccompany it with the complete corresponding machine-readable
Xsource code, which must be distributed under the terms of
XParagraphs 1 and 2 above; or,
X
X@item
Xaccompany it with a written offer, valid for at least three
Xyears, to give any third party free (except for a nominal
Xshipping charge) a complete machine-readable copy of the
Xcorresponding source code, to be distributed under the terms of
XParagraphs 1 and 2 above; or,
X
X@item
Xaccompany it with the information you received as to where the
Xcorresponding source code may be obtained.  (This alternative is
Xallowed only for noncommercial distribution and only if you
Xreceived the program in object code or executable form alone.)
X@end itemize
X
XFor an executable file, complete source code means all the source code
Xfor all modules it contains; but, as a special exception, it need not
Xinclude source code for modules which are standard libraries that
Xaccompany the operating system on which the executable file runs.
X
X@item
XYou may not copy, sublicense, distribute or transfer GNU Emacs except
Xas expressly provided under this License Agreement.  Any attempt
Xotherwise to copy, sublicense, distribute or transfer GNU Emacs is
Xvoid and your rights to use GNU Emacs under this License agreement
Xshall be automatically terminated.  However, parties who have received
Xcomputer software programs from you with this License Agreement will
Xnot have their licenses terminated so long as such parties remain in
Xfull compliance.
X
X@item
XIf you wish to incorporate parts of GNU Emacs into other free programs
Xwhose distribution conditions are different, write to the Free Software
XFoundation.  We have not yet worked out a simple rule that can be stated
Xhere, but we will often permit this.  We will be guided by the two goals of
Xpreserving the free status of all derivatives of our free software and of
Xpromoting the sharing and reuse of software.
X@end enumerate
X
XYour comments and suggestions about our licensing policies and our
Xsoftware are welcome!  Please contact the Free Software Foundation, Inc.,
X675 Mass Ave, Cambridge, MA 02139.
X
X@iftex
X@vfil
X@eject
X@end iftex
X@unnumberedsec NO WARRANTY
X
X  BECAUSE GNUS IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO
XWARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT WHEN
XOTHERWISE STATED IN WRITING, FUJITSU LABORATORIES LTD., MASANOBU UMEDA
XAND/OR OTHER PARTIES PROVIDE GNUS ``AS IS'' WITHOUT WARRANTY OF ANY
XKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
XIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
XPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
XPROGRAM IS WITH YOU.  SHOULD THE GNUS PROGRAM PROVE DEFECTIVE, YOU
XASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
X
X IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL FUJITSU LABORATORIES
XLTD., MASANOBU UMEDA, AND/OR ANY OTHER PARTY WHO MAY MODIFY AND
XREDISTRIBUTE GNUS AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
XINCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
XCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
X(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
XINACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
XPROGRAM TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY MASANOBU UMEDA) THE
XPROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
XDAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
X
X@node Acknowledgments, Introduction, License, Top
X@unnumbered Acknowledgments
X
X  The author would like to thank all those who have helped design and
Xdevelop GNUS, and who tested non stable code at their own risk.
X
X  Haruo Yokota, Hiroyuki Yoshida, and Kohji Akiyama contributed many
Xvaluable suggestions in the early stages of the development of GNUS.
XNobuyuki Hiraoka, Tsuneo Nakata, and Mark Feldman patiently tested non
Xstable code and contributed valuable comments.  Mark Feldman also helped
Xwith proofreading.  Mike Khaw, Kouich Kumon, and Mitsuhiro Kishimoto
Xhelped contribute the name GNUS.  Itaru Ichikawa helped implement the
Xcaesar rotations for Japanese characters.  Yasunari Itoh, Akio Shibata,
Xand Ken-ichi Sakaeda made this software available on SX/A Emacs and some
Xold versions of GNU Emacs.  Leonard H.  Tower Jr., Bob Sutterfield, and
XKarl Kleinpaste helped create mailing lists for GNUS users.  Bob
XSutterfield has also been managing the info-gnus-english mailing list.
XJordan K.  Hubbard helped with proofreading of this Texinfo manual.
X
X  The author would also like to thank many other GNUS users who have
Xsent comments, suggestions, and bug fixes.  Thanks also go to Richard
XStallman and the Free Software Foundation for their good work.
X
X@node Introduction, Installation, Top, Top
X@unnumbered Introduction
X
X  GNUS is a program for reading and writing USENET news using GNU Emacs.
XThis manual documents the use and simple customization of GNUS.
X
X@pindex rn
X  Unlike other conventional newsreaders such as rn which was (:-) the
Xmost popular newsreader in the world, GNUS runs inside the GNU Emacs
Xeditor as a subsystem.  This means that there is no need to invoke an
Xeditor when composing articles or mail.  The reading and writing of
Xarticles can be done in the same Emacs environment you usually work in.
X
X@pindex rrn
X@cindex NNTP
X  Like rrn, a remote version of rn, GNUS can use computer networks for
Xretrieving articles.  This means that there is no need to have a local
Xcopy of the news spool, to mount a remote file system over the network,
Xor to run Emacs on a remote machine.  Its great advantage is to balance
Xloads and exploit resources of the entire computer system in a
Xdistributed environment.  The protocol used by GNUS is @dfn{NNTP}, the
XNetwork News Transfer Protocol, defined by RFC977.@refill
X
X  Unlike rrn, GNUS can talk to many NNTP servers easily.  The only thing
Xyou have to do is to create startup files for each NNTP server.
X
X  Like other libraries of GNU Emacs, GNUS is completely written in Emacs
Xlisp.  This means that GNUS is highly extensible and customizable just
Xlike GNU Emacs.  It is possible to change the behavior of GNUS and
Xextend its functions by using variables and hooks.
X
X  GNUS is pronounced @strong{``NUZ''}.  Never call it
X@strong{``ghu-NUZ''} nor @strong{``ghu-NAS''}.@refill
X
X  This manual is currently in progress and thus is incomplete.  Your
Xsuggestions, bug fixes, and contributions are welcome.
X
X@node Installation, Starting up, Introduction, Top
X@chapter Installing GNUS
X@cindex install GNUS
X@cindex how to install GNUS
X
X  Installation of GNUS and some initialization of your computing
Xenvironment are described in this chapter.  Please read the following
Xsections carefully before getting started with GNUS.
X
X@menu
X* Files of GNUS::       How many files of GNUS are there?
X* Compilation::         How to byte-compile lisp sources.
X* Autoloading::         How to define autoload entries.
X* Environment::         How to define your environment.
X* Texinfo Manual::      How to install an Info file and print the manual.
X@end menu
X
X@node Files of GNUS, Compilation, Installation, Installation
X@section Files of GNUS
X@cindex GNUS files
X@cindex files of GNUS
X
X  Unpacking the shar files will produce the following files.  They are
Xthe Emacs lisp sources, a C source, a Texinfo manual of GNUS, and a
XMakefile.
X
X@table @file
X@pindex gnus.el
X@item gnus.el
XMain part of GNUS newsreader.
X
X@pindex gnuspost.el
X@item gnuspost.el
XPost news commands.
X
X@pindex gnusmisc.el
X@item gnusmisc.el
XMiscellaneous commands.
X
X@pindex nntp.el
X@item nntp.el
XNNTP package.
X
X@pindex nnspool.el
X@item nnspool.el
XA package accessing local news spool like NNTP.
X
X@pindex mhspool.el
X@item mhspool.el
XA package accessing private directory like NNTP.
X
X@pindex tcp.el
X@findex open-network-stream
X@item tcp.el
XPatches to some versions of GNU Emacs which do not have the function
X@code{open-network-stream}.@refill
X
X@pindex tcp.c
X@item tcp.c
XC program for external TCP/IP implementation.  This is used with
X@file{tcp.el}.@refill
X
X@pindex gnus.texinfo
X@item gnus.texinfo
XTexinfo manual of GNUS.
X
X@pindex Makefile
X@pindex make
X@item Makefile
XMakefile to byte-compile the lisp files using the @file{make} command.
X@end table
X
X@node Compilation, Autoloading, Files of GNUS, Installation
X@section Byte-Compilation
X@cindex byte-compilation
X@cindex compilation of lisp files
X
X@pindex make
X@vindex load-path
X  Move the lisp files, the C file, and @file{Makefile} to the
Xappropriate directory in the search path defined by the variable
X@code{load-path}.  Before actually byte-compiling the lisp files, make
Xsure there are no byte-compiled files of older versions of GNUS in that
Xdirectory.  Remove or rename such files as the byte-compiler may be
Xconfused by old macro definitions.  If you can use the @file{make}
Xcommand, you don't have to take care of the dependencies.@refill
X
X@vindex exec-path
X@pindex tcp.c
X  The C file @file{tcp.c} should be compiled with a C compiler and
Xinstalled in a directory in the search path defined by the variable
X@code{exec-path}, if this is required.@refill
X
X  If you can use the @file{make} command, just type @code{make} in a
XUnix shell.  All the lisp files will be byte-compiled.  Otherwise,
Xbyte-compile lisp files in the following order according to your
Xcomputing environment by yourself:@refill
X
X@enumerate
X@item
X@pindex nntp.el
X@pindex gnus.el
X@pindex gnuspost.el
X@pindex gnusmisc.el
XByte-compile @file{nntp.el}, @file{gnus.el}, @file{gnuspost.el}, and
X@file{gnusmisc.el} in this order.@refill
X
X@item
X@pindex nnspool.el
XByte-compile @file{nnspool.el} if you want to use the local news spool
Xof your machine instead of NNTP (@pxref{Local News Spool}).@refill
X
X@item
X@pindex mhspool.el
XByte-compile @file{mhspool.el} if you want to read articles or mail in
Xyour private directory using GNUS (@pxref{Private Directory}).@refill
X
X@item
X@cindex TCP/IP
X@pindex tcp.el
X@pindex tcp.c
XCompile and install @file{tcp.el} and @file{tcp.c} if TCP/IP is not
Xsupported by Emacs but is supported by your operating system.@refill
X@end enumerate
X
X@findex open-network-stream
X  @file{tcp.el} defines the function @code{open-network-stream}, and
X@file{tcp.c} is an emulation program for the stream used by the
Xfunction.  If you modified @file{tcp.c} for your system, please send the
Xauthor the diffs.  Some of them will be included in the future releases
Xof GNUS.@refill
X
X@node Autoloading, Environment, Compilation, Installation
X@section Autoloading
X@cindex autoload
X
X  It is useful to define autoload entries in @file{.emacs},
X@file{site-init.el} or @file{default.el} as follows:@refill
X
X@example
X(autoload 'gnus "gnus" "Read network news." t)
X(autoload 'gnus-post-news "gnuspost" "Post a new news." t)
X@end example
X
X@node Environment, Texinfo Manual, Autoloading, Installation
X@section Environment
X
X  The NNTP server and its service name, your domain and organization,
SHAR_EOF
echo "End of part 7, continue with part 8"
echo "8" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 8 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.texinfo continued
#
CurArch=8
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.texinfo
Xand other important definitions of your computing environment are
Xdescribed in this section.  Since these definitions depend heavily on
Xyour environment, you'd better be familiar with the operating system you
Xare using. Knowledge of the USENET software is also important.
X
X@menu
X* Server:  NNTP Server.         How to define NNTP server.
X* Service: NNTP Service.        How to define NNTP service.
X* Domain::                      How to define your domain and organization.
X* GENERICFROM::                 How to use GENERICFROM feature.
X* GENERICPATH::                 How to use GENERICPATH feature.
X* Startup File::                About the startup files of GNUS.
X@end menu
X
X@node NNTP Server, NNTP Service, Environment, Environment
X@subsection NNTP Server
X@cindex NNTP server
X
X@vindex gnus-nntp-server
X  The variable @code{gnus-nntp-server} specifies the default NNTP
Xserver.  To define the server @samp{flab}, put the following code in
X@file{.emacs}, @file{site-init.el} or @file{default.el}:@refill
X
X@example
X(setq gnus-nntp-server "flab")
X@end example
X
X@vindex NNTPSERVER
X  The variable @code{gnus-nntp-server} is initialized from the
X@code{NNTPSERVER} environment variable.  To define the server using the
X@code{NNTPSERVER} environment variable, put the following code in
X@file{.login}:@refill
X
X@example
Xsetenv NNTPSERVER "flab"
X@end example
X
X@cindex private directory
X@pindex MH
X  If an NNTP server is preceded by a colon such as @samp{:Mail}, the
Xuser's private directory @file{~/Mail} is used as the news spool.  This
Xmakes it possible to read mail stored in MH folders or articles saved by
XGNUS.  @xref{Private Directory}, for more information.@refill
X
X  GNUS will ask you for the NNTP server at start up time unless it is
Xdefined.  Even if the default server is defined, it is possible to
Xchoose another server by invoking GNUS with a prefix argument like
X@kbd{C-u M-x gnus} (@pxref{Getting Started}).@refill
X
X@node NNTP Service, Domain, NNTP Server, Environment
X@subsection NNTP Service
X@cindex NNTP service
X
X@vindex gnus-nntp-service
X  The default service name of NNTP is @code{"nntp"}.  You may, however,
Xhave to define the service name as the number @code{119} as
Xfollows:@refill
X
X@example
X(setq gnus-nntp-service 119)
X@end example
X
X@cindex local news spool
X  If you'd like to use a local news spool of your machine directly
Xinstead of NNTP, set the variable to @code{nil} as follows:@refill
X
X@example
X(setq gnus-nntp-service nil)
X@end example
X
X@findex system-name
X@noindent
XIn this case, the NNTP server must be a local host name returned by the
Xfunction @code{system-name} (@pxref{Local News Spool}).@refill
X
X@node Domain, GENERICFROM, NNTP Service, Environment
X@subsection Domain and Organization
X@cindex domain
X@cindex organization
X
X  @dfn{Domain} and @dfn{organization} must be defined before you post
Xyour first article, because they are included in all articles you post
Xand will be used for identifying who you are.@refill
X
X@findex system-name
X  @dfn{Domain} is the domain part of your mail address excluding the
Xlocal host name.  For example, if your mail address is
X@samp{umerin@@photon.stars.flab.Fujitsu.CO.JP} and the local host name
Xis @samp{photon}, your domain is @samp{stars.flab.Fujitsu.CO.JP}.  If
Xthe function @code{system-name} of your Emacs returns the full Internet
Xname, you do not have to define the domain.@refill
X
X  @dfn{Organization} is the organization you belong to.  It must be
Xdefined unless it is defined in the file
X@file{/usr/lib/news/organization}.@refill
X
X@vindex gnus-your-domain
X@vindex gnus-your-organization
X  To define the domain @samp{stars.flab.Fujitsu.CO.JP} and the
Xorganization @samp{Fujitsu Laboratories Ltd., Kawasaki, Japan.} using
Xlisp variables, put the following code in @file{.emacs},
X@file{site-init.el} or @file{default.el}.  If you are a system
Xadministrator and are installing GNUS for other users,
X@file{site-init.el} is the best place to define this because the domain
Xand organization are common to all users of the system.@refill
X
X@example
X(setq gnus-your-domain "stars.flab.Fujitsu.CO.JP")
X(setq gnus-your-organization
X      "Fujitsu Laboratories Ltd., Kawasaki, Japan.")
X@end example
X
X@vindex DOMAINNAME
X@vindex ORGANIZATION
X  The @code{DOMAINNAME} and @code{ORGANIZATION} environment variables
Xare used instead, if defined.  To define these variables, put the
Xfollowing code in @file{.login}.@refill
X
X@example
Xsetenv DOMAINNAME   "stars.flab.Fujitsu.CO.JP"
Xsetenv ORGANIZATION "Fujitsu Laboratories Ltd., Kawasaki, Japan."
X@end example
X
X@cindex .organization
X@cindex /usr/lib/news/organization
X  If the value of the @code{ORGANIZATION} environment variable or the
Xvariable @code{gnus-your-organization} begins with a slash, it is taken
Xas the name of a file whose contents are read for the value.  If neither
Xof these is defined, and a file
X@file{~/.organization-@var{distribution}} or @file{~/.organization}
Xexists, the contents of that file are used.  If neither of them does not
Xexist, and the file @file{/usr/lib/news/organization} exists, its
Xcontents are used.@refill
X
X@node GENERICFROM, GENERICPATH, Domain, Environment
X@subsection GENERICFROM
X@cindex GENERICFROM
X@cindex From field
X
X@vindex gnus-use-generic-from
X  If the variable @code{gnus-use-generic-from} is non-@code{nil}, the
Xlocal host name of your machine will not appear in the @samp{From:}
Xfield of article headers you post.  This is called the @dfn{GENERICFROM}
Xfeature in the Bnews system.  This may be useful if there are many
Xworkstations connected to each other in a local area network, and
Xaliases service or automatic forwarding of mail is supported between the
Xworkstations.@refill
X
X  To use the GENERICFROM, put the following code in @file{.emacs},
X@file{site-init.el} or @file{default.el}.  If you are a system
Xadministrator and are installing GNUS for other users,
X@file{site-init.el} is the best place to define it because the
Xdefinition is common to all users of the system having the same domain
Xand organization (@pxref{Domain,, Domain and Organization}).@refill
X
X@example
X(setq gnus-use-generic-from t)
X@end example
X
X@vindex gnus-your-domain
X@vindex DOMAINNAME
X  As a special case of the GENERICFROM feature, if the variable
X@code{gnus-use-generic-from} is a string, it is used as your domain
Xinstead of the definition of the environment variable @code{DOMAINNAME}
Xor the variable @code{gnus-your-domain} (@pxref{Domain,, Domain and
XOrganization}).@refill
X
X@node GENERICPATH, Startup File, GENERICFROM, Environment
X@subsection GENERICPATH
X@cindex GENERICPATH
X@cindex Path field
X
X@vindex gnus-use-generic-path
X  If the variable @code{gnus-use-generic-path} is @code{nil}, the NNTP
Xserver name followed by the user login name is used in the @samp{Path:}
Xfield of article headers you post.  If it is a string, the string
Xfollowed by the user login name is used instead.  Otherwise, if it is
Xnon-@code{nil}, only the user login name is used.  This is called the
X@dfn{GENERICPATH} feature in the Bnews system.@refill
X
X  For example, to define the generic path @samp{flab}, put the following
Xcodes in @file{.emacs}, @file{site-init.el} or @file{default.el}.  If
Xyou are a system administrator and are installing GNUS for other users,
X@file{site-init.el} is the best place to define it because the
Xdefinition is common to all users of the system having the same domain
Xand organization (@pxref{Domain,, Domain and Organization}).@refill
X
X@example
X(setq gnus-use-generic-path "flab")
X@end example
X
X@noindent
XIn this case, the @samp{Path:} field will be generated as
X@samp{Path:@: flab!@var{user}}.@refill
X
X@node Startup File,, GENERICPATH, Environment
X@subsection Startup File
X@cindex startup file
X@cindex .newsrc
X
X@vindex gnus-startup-file
X@cindex server specific startup file
X  @dfn{Startup file} is a file recording information on articles you
Xhave already read.  GNUS uses @file{.newsrc} for the startup file as in
Xthe Bnews system.  If you think you will talk to exactly one NNTP
Xserver, you can use it without any problems.  Otherwise, if you want to
Xtalk to several NNTP servers, you'd better use server specific startup
Xfiles since startup files are not portable between servers.  The server
Xspecific startup file for an NNTP server on a machine @var{server} is a
Xfile named @file{.newsrc-@var{server}}.  For example,
X@file{.newsrc-photon} is for an NNTP server on a machine named
X@samp{photon}.  The primary name of the startup file, @file{.newsrc}, is
Xspecified by the variable @code{gnus-startup-file}
X(@pxref{Variables}).@refill
X
X@kindex U (Group Mode)
X@findex gnus-Group-unsubscribe-group
X@kindex C-k (Group Mode)
X@findex gnus-Group-kill-group
X@cindex options -n in startup file
X@cindex add newsgroups
X@cindex new newsgroups
X@cindex kill newsgroups
X  GNUS automatically adds newly created newsgroups to a startup file
Xwhen getting started.  To prevent adding the newsgroups under some
Xnewsgroup hierarchies, you can use the options line in the startup file.
XOption @code{-n} of the options line in the startup file is recognized
Xproperly the same as for the Bnews system.  For example, if the options
Xline is @samp{options -n !talk talk.rumors}, newsgroups under the
X@samp{talk} hierarchy except for @samp{talk.rumors} are ignored while
Xchecking new newsgroups.  These ignored newsgroups can be added manually
Xusing the command @kbd{U} (@code{gnus-Group-unsubscribe-group}) in the
XNewsgroup buffer.  Use the command @kbd{C-k}
X(@code{gnus-Group-kill-group}) to kill newsgroups from the startup file
Xper a newsgroup basis.  @xref{Maintenance}, for more information.@refill
X
X@kindex R (Group Mode)
X@findex gnus-Group-restart
X@cindex quick startup file
X@cindex .newsrc.el
X  Once a startup file is updated by GNUS, the @dfn{quick startup file}
Xof which the file name is generated by appending @file{.el} to that of
Xthe raw startup file is also created.  The quick startup file can be
Xread by Emacs faster than the raw startup file since all information in
Xthe file is in lisp form.  If there is a quick startup file and it is
Xnewer than the raw startup file, the quick startup file is loaded
Xinstead of the raw startup file.  If the raw startup file is newer, it
Xis normally read after loading the quick startup file.  You should not
Xremove the quick startup file because it contains additional
Xinformation.  Instead, make the raw startup file newer than that by
Xtouching it or force GNUS to read it by using the command @kbd{R}
X(@code{gnus-Group-restart}) in the Newsgroup buffer if you want to
Xreflect the changes of the raw startup file to GNUS.@refill
X
X@node Texinfo Manual,, Environment, Installation
X@section Texinfo Manual
X@pindex gnus.texinfo
X@cindex Texinfo
X@cindex Info
X@cindex @TeX{}
X
X  @file{gnus.texinfo} is a manual of GNUS written in Texinfo format.
XThis file can be printed using @TeX{}, and also can be read using Info
XMode of Emacs.@refill
X
X@vindex Info-directory
X@vindex gnus-Info-directory
X@cindex create Info file
X@cindex install Info file
X  @inforef{Creating an Info File, Creating an Info File, texinfo}, to
Xcreate an on-line Info file from the Texinfo manual.  If you are not
Xallowed to create the Info file in the standard Info directory specified
Xby the variable @code{Info-directory}, create it in your private
Xdirectory and set the variable @code{gnus-Info-directory} to the
Xdirectory.@refill
X
X@kindex C-c C-i
X@findex gnus-Info-find-node
X@cindex read Info file
X@cindex Info
X  If this Info file is installed, you can read the documentation of GNUS
Xaccording to the current major mode of GNUS.  The command
X@code{gnus-Info-find-node} for reading appropriate Info nodes of the
XInfo file is assigned to @kbd{C-c C-i} in all major modes of
XGNUS.@refill
X
X@cindex print Texinfo manual
X  @inforef{Printing Hardcopy, Printing Hardcopy, texinfo}, to print a
Xhardcopy of the manual.@refill
X
X@node Starting up, Buffers of GNUS, Installation, Top
X@chapter Starting up GNUS
X
X@ifinfo
X  This chapter describes how to get started GNUS, how to use a local
Xnews spool directly, and how to read private directory.
X@end ifinfo
X
X@menu
X* Getting Started::     How to get started GNUS.
X* Local News Spool::    How to use a local news spool.
X* Private Directory::   How to read a private directory.
X@end menu
X
X@node Getting Started, Local News Spool, Starting up, Starting up
X@section Getting Started GNUS
X@cindex invoke GNUS
X@cindex run GNUS
X
X@kindex M-x gnus
X@findex gnus
X  Type @kbd{M-x gnus} at the top level of GNU Emacs to invoke GNUS.
XUnless a default NNTP server is defined, you will be asked for the name
Xof the server.  The NNTP server can be changed at startup time by giving
Xa prefix argument to the command even if a default server is defined.
X@xref{NNTP Server}, to define the default server.@refill
X
X@table @kbd
X@item M-x gnus
X@kindex M-x gnus
XRun GNUS using the default NNTP server.
X
X@item C-u M-x gnus
X@kindex C-u M-x gnus
XRun GNUS without using the default NNTP server.
X@end table
X
X@node Local News Spool, Private Directory, Getting Started, Starting up
X@section Using Local News Spool
X@cindex local news spool
X
X@vindex gnus-nntp-service
X@findex system-name
X  If the NNTP server is the local host name (exactly the same as the
Xvalue returned by the function @code{system-name}), and the variable
X@code{gnus-nntp-service} is nil, GNUS looks up the local news spool of
Xyour machine directly instead of NNTP (@pxref{NNTP Service}).@refill
X
X  It may be a good idea not to use NNTP if you wish to reduce network
Xtraffic (even if an NNTP server is running on the local machine) though
Xcommands for retrieving articles by Message-IDs may take longer or not
Xwork at all.  @xref{Referencing Articles}, to refer to articles by the
XMessage-IDs, and @pxref{Spool Variables}, for more information on the
Xrestrictions.@refill
X
X@node Private Directory,, Local News Spool, Starting up
X@section Reading a Private Directory
X@cindex private directory
X@cindex MH folder
X
X@cindex active file
X@pindex MH
X  If an NNTP server is preceded by a colon such as @samp{:Mail}, the
Xuser's private directory @file{~/Mail} is used as the news spool.  This
Xmakes it possible to read mail stored in MH folders or articles saved by
XGNUS.  An active file for the directory is generated from files of which
Xthe file name consists of only numeric characters, and other files
Xcontaining non-numeric characters in their file name are ignored.@refill
X
X  A server specific startup file for each directory must be created
Xbefore starting GNUS.  For example, a startup file for the directory
X@file{~/Mail} is a file named @file{.newsrc-:Mail}.  @xref{Startup
XFile}, for more information on the server specific startup file.@refill
X
X@node Buffers of GNUS, Newsgroup Commands, Starting up, Top
X@chapter Buffers of GNUS
X@cindex GNUS buffers
X@cindex buffers of GNUS
X@cindex GNUS windows
X@cindex windows of GNUS
X@cindex GNUS major modes
X@cindex major modes of GNUS
X
X@vindex gnus-window-configuration
X@cindex window configuration
X@cindex configure windows
X  Basically GNUS uses three buffers in Emacs: Newsgroup buffer, Subject
Xbuffer, and Article buffer.  Each of them is associated with a specific
Xmajor mode of Emacs.  The configuration of the windows displaying these
Xbuffers are customizable by using the variable
X@code{gnus-window-configuration}.  @xref{Variables}, for more
Xinformation on customizing the window configuration.
X
X@menu
X* Newsgroup Buffer:: a buffer for listing newsgroups.
X* Subject Buffer::   a buffer for listing subjects and other important headers.
X* Article Buffer::   a buffer for displaying messages of articles.
X@end menu
X
X@node Newsgroup Buffer, Subject Buffer, Buffers of GNUS, Buffers of GNUS
X@section Newsgroup Buffer
X@cindex Newsgroup buffer
X@cindex Group Mode
X
X  @dfn{Newsgroup buffer} is for listing newsgroups.  The major mode of
Xthis buffer is @dfn{Group Mode}.  The buffer is created and popped up
Xwhen GNUS starts.  Newsgroups which are subscribed to and contain unread
Xarticles are usually listed in the buffer.  If there is no such
Xnewsgroup, the buffer will be empty and a message @samp{No news is good
Xnews.} will be displayed in the echo area of Emacs.@refill
X
X  The contents of a Newsgroup buffer looks something like the following:
X
X@example
X@var{SM  NUMBER}: @var{NEWSGROUP}
X@end example
X
X@table @var
X@item S
XA character indicating whether the newsgroup is subscribed to.  @samp{U}
Xmeans the newsgroup is unsubscribed.  @samp{ } means it is subscribed
Xto.@refill
X
X@item M
XA character indicating whether there are unread articles in the
Xnewsgroup.  @samp{*} means there are no newly arrived articles in the
Xnewsgroup.  @samp{ } means there are newly arrived articles.@refill
X
X@item NUMBER
XThe number of unread articles in the newsgroup.
X
X@item NEWSGROUP
XThe name of the newsgroup.
X@end table
X
X@node Subject Buffer, Article Buffer, Newsgroup Buffer, Buffers of GNUS
X@section Subject Buffer
X@cindex Subject buffer
X@cindex Subject Mode
X
X  @dfn{Subject buffer} is for listing subjects and other important
Xheaders of articles.  The major mode of the buffer is @dfn{Subject
XMode}.  The buffer is created for each newsgroup when the newsgroup is
Xselected in the Newsgroup buffer.@refill
X
X  The contents of a Subject buffer looks something like the following:
X
X@example
X@var{S NUMBER}:@var{C}[@var{LINES}:@var{AUTHOR}] @var{SUBJECT}
X@end example
X
X@table @var
X@item S
XA character indicating whether an article is newly arrived.  @samp{ }
Xmeans the article is newly arrived.  @samp{D} means it was read and
Xmarked so.  @samp{-} means it was read once but marked as unread
Xagain.@refill
X
X@item NUMBER
XThe number assigned to the article.
X
X@item C
XA character indicating which article is currently selected.  @samp{+} is
Xplaced on the current article.@refill
X
X@item LINES
XThe number of lines of the article body.
X
X@item AUTHOR
XMail address of the author of the article.
X
X@item SUBJECT
XSubject of the article.
X@end table
X
X@vindex gnus-optional-headers
X  Strings between @samp{[} and @samp{]} are optional, and can be
Xcustomized using the variable @code{gnus-optional-headers}.
X@xref{Variables}, and @pxref{Hooks}, for more information on
Xcustomization.@refill
X
X@node Article Buffer,, Subject Buffer, Buffers of GNUS
X@section Article Buffer
X@cindex Article buffer
X@cindex Article Mode
X
X  @dfn{Article buffer} is for displaying articles.  The major mode of
Xthe buffer is @dfn{Article Mode}.  Very few commands are available in
Xthis buffer because most operations on the buffer can be done in the
XSubject buffer.@refill
X
X@node Newsgroup Commands, Subject Commands, Buffers of GNUS, Top
X@chapter Newsgroup Commands
X
X  The Newsgroup buffer is intended to show newsgroups which are
Xsubscribed to and contain unread articles.  Unsubscribed newsgroups or
Xnewsgroups containing no unread articles are not usually displayed in
Xthe buffer.
X
X  Commands for browsing through newsgroups, selecting newsgroups to
Xread, and maintaining newsgroups are described in this chapter.
X
X@menu
X* Browsing Newsgroups::         Browsing through newsgroups.
X* Selecting a Newsgroup::       Selecting a newsgroup to read articles.
X* Maintenance::                 Maintaining newsgroups.
X* Exiting GNUS::                How to exit GNUS.
X* Other Newsgroup Commands::    Other miscellaneous commands.
X@end menu
X
X@node Browsing Newsgroups, Selecting a Newsgroup, Newsgroup Commands, Newsgroup Commands
X@section Walking Around Newsgroups
X
X  First of all, you have to move the point to a newsgroup to read
Xarticles in it.
X
X@table @kbd
X@item n
X@kindex n (Group Mode)
X@findex gnus-Group-next-unread-group
XMove point to the next newsgroup containing unread articles
X(@code{gnus-Group-next-unread-group}).@refill
X
X@item p
X@itemx DEL
X@kindex p (Group Mode)
X@kindex DEL (Group Mode)
X@findex gnus-Group-prev-unread-group
XMove point to the previous newsgroup containing unread articles
X(@code{gnus-Group-prev-unread-group}).@refill
X
X@item N
X@itemx C-n
X@kindex N (Group Mode)
X@kindex C-n (Group Mode)
X@findex gnus-Group-next-group
XMove point to the next newsgroup (@code{gnus-Group-next-group}).
X
X@item P
X@itemx C-p
X@kindex P (Group Mode)
X@kindex C-p (Group Mode)
X@findex gnus-Group-prev-group
XMove point to the previous newsgroup (@code{gnus-Group-prev-group}).
X
X@item j @var{newsgroup} RET
X@kindex j (Group Mode)
X@findex gnus-Group-jump-to-group
XMove point to the specified @var{newsgroup}
X(@code{gnus-Group-jump-to-group}).@refill
X
X@item /
X@kindex / (Group Mode)
XDo an incremental search forward (@code{isearch-forward}).
X
X@item <
X@kindex < (Group Mode)
XMove point to the beginning of the buffer (@code{beginning-of-buffer}).
X
X@item >
X@kindex > (Group Mode)
XMove point to the end of the buffer (@code{end-of-buffer}).
X
X@item r
X@kindex r (Group Mode)
X@findex gnus-Group-restrict-groups
X@cindex restrict newsgroups
XRestrict visible newsgroups to the current region specified by the point
Xand the mark (@code{gnus-Group-restrict-groups}).@refill
X@end table
X
X@kindex j (Group Mode)
X@findex gnus-Group-jump-to-group
X  The command @kbd{j} (@code{gnus-Group-jump-to-group}) reads a
Xnewsgroup name interactively, and moves the point to it.  If there is no
Xsuch newsgroup in the buffer, a line for the newsgroup is inserted at
Xthe beginning of the buffer.@refill
X
X@kindex r (Group Mode)
X@kindex C-x w
X@findex gnus-Group-restrict-groups
X@findex widen
X@cindex restrict newsgroups
X  The command @kbd{r} (@code{gnus-Group-restrict-groups}) restricts
Xvisible newsgroups to the current region specified by the point and the
Xmark.  This is useful if you want to concentrate on a restricted set of
Xnewsgroups in a region.  Type @kbd{C-x w} (@code{widen}) to remove the
Xrestriction.@refill
X
X@node Selecting a Newsgroup, Maintenance, Browsing Newsgroups, Newsgroup Commands
X@section Selecting a Newsgroup
X@cindex select newsgroup
X@cindex read newsgroup
X
X@kindex SPC (Group Mode)
X@findex gnus-Group-read-group
X@kindex = (Group Mode)
X@findex gnus-Group-select-group
X  If you successfully move the point to a desired newsgroup, you can
Xselect the newsgroup to read articles by typing @kbd{SPC}
X(@code{gnus-Group-read-group}) or @kbd{=}
X(@code{gnus-Group-select-group}) on that line.@refill
X
X@table @kbd
X@item SPC
X@kindex SPC (Group Mode)
X@findex gnus-Group-read-group
XSelect the newsgroup, and then select the first unread article
Xautomatically (@code{gnus-Group-read-group}).@refill
X
X@item =
X@kindex = (Group Mode)
X@findex gnus-Group-select-group
XSelect the newsgroup (@code{gnus-Group-select-group}). No article is
Xselected automatically.@refill
X@end table
X
X@kindex SPC (Group Mode)
X@findex gnus-Group-read-group
X@vindex gnus-auto-select-first
X@vindex gnus-Select-group-hook
X  To prevent automatic selection of the first unread article even when
Xthe newsgroup is selected by the command @key{SPC}
X(@code{gnus-Group-read-group}), set the variable
X@code{gnus-auto-select-first} to @code{nil}.  If you want to change the
Xvalue of the variable according to the selected newsgroups, set the
Xvariable in the hook @code{gnus-Select-group-hook}.@refill
X
X@kindex SPC (Group Mode)
X@findex gnus-Group-read-group
X@kindex = (Group Mode)
X@findex gnus-Group-select-group
X@cindex select all articles
X@cindex read all articles
X  If unread articles are contained in a selected newsgroup, they become
Xready to be read.  Otherwise, all articles in the newsgroup become ready
Xto be read.  All articles in a newsgroup can be selected unconditionally
Xby giving a prefix argument to the commands @key{SPC} and @key{=}
X(@code{gnus-Group-read-group} and
X@code{gnus-Group-select-group}).@refill
X
X@vindex gnus-large-newsgroup
X@cindex large newsgroup
X  If the number of articles being selected is larger than the variable
X@code{gnus-large-newsgroup}, the number of articles actually selected is
Xasked for.  If the given value @var{n} is positive, the last @var{n}
Xarticles will be selected.  If @var{n} is negative, the first @var{n}
Xarticles will be selected.  An empty string means to select all
Xarticles.@refill
X
X  @xref{Variables}, and @pxref{Hooks}, for more information on
Xcustomization.@refill
X
X@node Maintenance, Exiting GNUS, Selecting a Newsgroup, Newsgroup Commands
X@section Maintaining Newsgroups
X
X  Subscription of newsgroups, deletion of bogus newsgroups, and other
Xrelated operations are described in this section.
X
X@table @kbd
X@item c
X@kindex c (Group Mode)
X@findex gnus-Group-catch-up
XMark all articles as read in the newsgroup, preserving articles marked
Xas unread (@code{gnus-Group-catch-up}).@refill
X
X@item C
X@kindex C (Group Mode)
X@findex gnus-Group-catch-up-all
XMark all articles as read in the newsgroup
X(@code{gnus-Group-catch-up-all}).@refill
X
X@item l
X@kindex l (Group Mode)
X@findex gnus-Group-list-groups
XRedisplay newsgroups which are subscribed to and containing unread
Xarticles (@code{gnus-Group-list-groups}).@refill
X
X@item L
X@kindex L (Group Mode)
X@findex gnus-Group-list-all-groups 
XDisplay all newsgroups unconditionally
X(@code{gnus-Group-list-all-groups}).@refill
X
X@item u
X@kindex u (Group Mode)
X@findex gnus-Group-unsubscribe-current-group
XUnsubscribe from (or subscribe to) the newsgroup
X(@code{gnus-Group-unsubscribe-current-group}).@refill
X
X@item U @var{newsgroup} RET
X@kindex U (Group Mode)
X@findex gnus-Group-unsubscribe-group
XUnsubscribe from (or subscribe to) the specified @var{newsgroup}
X(@code{gnus-Group-unsubscribe-group}).  If it is not contained in the
Xstartup file, it is added to the file.@refill
X
X@item C-k
X@kindex C-k (Group Mode)
X@findex gnus-Group-kill-group
X@cindex kill newsgroups
XKill the newsgroup from the startup file (@code{gnus-Group-kill-group}).
X
X@item C-y
X@kindex C-y (Group Mode)
X@findex gnus-Group-yank-group
X@cindex yank newsgroups
XYank the last newsgroup killed with the command @kbd{C-k} before the
Xcurrent line (@code{gnus-Group-yank-group}).@refill
X
X@item C-c C-y
X@kindex C-c C-y (Group Mode)
X@findex gnus-Browse-killed-groups
XPop up a buffer for browsing the killed newsgroups
X(@code{gnus-Browse-killed-groups}).@refill
X
X@item b
X@kindex b (Group Mode)
X@findex gnus-Group-check-bogus-groups
XCheck bogus newsgroups (@code{gnus-Group-check-bogus-groups}).  Bogus
Xmeans non-active.@refill
X
X@item g
X@kindex g (Group Mode)
X@findex gnus-Group-get-new-news
X@cindex active file
XGet newly arrived articles (@code{gnus-Group-get-new-news}).  In fact,
XGNUS reads the active file from the NNTP server again.@refill
X
X@item R
X@kindex R (Group Mode)
X@findex gnus-Group-restart
X@cindex startup file
X@cindex .newsrc
XForce to read the raw startup file and get newly arrived articles
X(@code{gnus-Group-restart}).
X@end table
X
X@kindex c (Group Mode)
X@findex gnus-Group-catch-up
X@kindex C (Group Mode)
X@findex gnus-Group-catch-up-all
X@kindex c (Subject Mode)
X@findex gnus-Subject-catch-up-and-exit
X@cindex catch up
X@cindex cross-references
X@cindex Xref field
X  The commands @kbd{c} and @kbd{C} (@code{gnus-Group-catch-up} and
X@code{gnus-Group-catch-up-all}) mark all articles as read in a
Xnewsgroup.  These commands do not take account of the cross-reference
Xinformation in the @samp{Xref:} field, while the command @kbd{c}
X(@code{gnus-Subject-catch-up-and-exit}) in Subject Mode does.@refill
X
X@kindex L (Group Mode)
X@findex gnus-Group-list-all-groups
X  Only subscribed newsgroups containing unread articles are usually
Xdisplayed in the Newsgroup buffer.  Type @kbd{L}
X(@code{gnus-Group-list-all-groups}) to show all newsgroups which are
Xcurrently active.@refill
X
X@kindex U (Group Mode)
X@findex gnus-Group-unsubscribe-group
X@cindex options -n in startup file
X@cindex add newsgroups
X@cindex new newsgroups
X  The command @kbd{U} (@code{gnus-Group-unsubscribe-group}) reads a
Xnewsgroup name interactively, and toggles its subscription flag if it is
Xalready in the startup file.  Otherwise, if it is not contained in the
Xstartup file, it is added to the file.  Thus, you can add newly created
Xnewsgroups manually which are not added automatically because of the
Xoptions line in the startup file.  @xref{Startup File}, for more
Xinformation on the startup file and options line.@refill
X
X@kindex C-k (Group Mode)
X@findex gnus-Group-kill-group
X@kindex C-y (Group Mode)
X@findex gnus-Group-yank-group
X@kindex C-c C-y (Group Mode)
X@findex gnus-Browse-killed-groups
X@cindex kill newsgroups
X@cindex yank newsgroups
X@cindex order of newsgroups
X@cindex change the order of newsgroups
X@cindex startup file
X@cindex .newsrc
X  The command @kbd{C-k} (@code{gnus-Group-kill-group}) kills a newsgroup
Xfrom both the Newsgroup buffer and the raw startup file.  The last
Xnewsgroup killed with the @kbd{C-k} command can be yanked using the
Xcommand @kbd{C-y} (@code{gnus-Group-yank-group}).  The command @kbd{C-c
XC-y} (@code{gnus-Browse-killed-groups}) pops up the @dfn{Browse-Killed
Xbuffer} for browsing the killed newsgroups.  In this buffer, the killed
Xnewsgroups can be yanked in any order using the command @kbd{y} or
X@kbd{C-y} (@code{gnus-Browse-killed-yank}).  Thus, you can change the
Xorder of newsgroups in the Newsgroup buffer without editing the raw
Xstartup file directly.  Since the information on the killed newsgroups
Xwill be stored in the quick startup file, they can be restored any time
Xunless you lose the file.@refill
X
X@kindex b (Group Mode)
X@findex gnus-Group-check-bogus-groups
X@cindex bogus newsgroups
X@cindex delete newsgroups
X  A @dfn{bogus newsgroup} is one not in the list of active newsgroups in
Xthe active file.  Bogus newsgroups which are deleted or renamed must be
Xdeleted from the startup file (@pxref{Startup File}) explicitly by the
Xcommand @kbd{b} (@code{gnus-Group-check-bogus-groups}).@refill
X
X@kindex R (Group Mode)
X@findex gnus-Group-restart
X@cindex startup file
X@cindex .newsrc
X  The command @kbd{R} (@code{gnus-Group-restart}) is useful to restart
XGNUS using the raw startup file instead of the quick startup file.
XGenerally speaking, if you want changes to the raw startup file to be
Xnoticed by GNUS, it must be newer than the quick startup file.
X@xref{Startup File}, for more information on the startup file.@refill
X
X@kindex g (Group Mode)
X@findex gnus-Group-get-new-news
X@cindex active file
X  GNUS reads the active file at start up time to know about currently
Xactive articles.  This information is not updated unless you force GNUS
Xto do so with the command @kbd{g} (@code{gnus-Group-get-new-news}) or
Xthe command @kbd{R} (@code{gnus-Group-restart}).@refill
X
X@node Exiting GNUS, Other Newsgroup Commands, Maintenance, Newsgroup Commands
X@section Exiting GNUS
X
X@table @kbd
X@item s
X@itemx x
X@kindex s (Group Mode)
X@kindex x (Group Mode)
X@findex gnus-Group-force-update
X@cindex update startup file
X@cindex save startup file
XUpdate the startup file @file{.newsrc} (@code{gnus-Group-force-update}).
X
X@item z
X@kindex z (Group Mode)
X@findex gnus-Group-suspend
XSuspend the current GNUS session to make it possible to resume it later
X(@code{gnus-Group-suspend}).@refill
X
X@item q
X@kindex q (Group Mode)
X@findex gnus-Group-exit
XUpdate the startup file @file{.newsrc}, and then exit GNUS
X(@code{gnus-Group-exit}).@refill
X
X@item Q
X@kindex Q (Group Mode)
X@findex gnus-Group-quit
XExit GNUS without updating the startup file @file{.newsrc}
X(@code{gnus-Group-quit}).@refill
X@end table
X
X@kindex z (Group Mode)
X@findex gnus-Group-suspend
X@kindex g (Group Mode)
X@findex gnus-Group-get-new-news
X  If a GNUS session is suspended by the command @kbd{z}
X(@code{gnus-Group-suspend}), it is possible to resume it later without
Xany time-consuming initializations.  Switch to the Newsgroup buffer and
Xtype @kbd{g} (@code{gnus-Group-get-new-news}) to get newly arrived
Xarticles if you want to resume the suspended GNUS session.  It is a good
Xidea to update the startup file (@pxref{Startup File}) before suspending
XGNUS.@refill
X
X@kindex q (Group Mode)
X@findex gnus-Group-exit
X@kindex Q (Group Mode)
X@findex gnus-Group-quit
X  If you want to forget what you read this GNUS session, exit GNUS by
Xthe command @kbd{Q} (@code{gnus-Group-quit}).  Otherwise, exit by the
Xcommand @kbd{q} (@code{gnus-Group-exit}) to update the startup
Xfile.@refill
X
X@vindex gnus-Exit-gnus-hook
X@vindex gnus-Suspend-gnus-hook
X  The hook @code{gnus-Exit-gnus-hook} is called when exiting GNUS, and
Xthe hook @code{gnus-Suspend-gnus-hook} is called when suspending GNUS.
XIf you want to clear out Emacs buffers which were created by GNUS and
Xremain afterwards, use these hooks.@refill
X
X@node Other Newsgroup Commands,, Exiting GNUS, Newsgroup Commands
X@section Miscellaneous Commands
X
X  Other miscellaneous commands are described here.
X
X@table @kbd
X@item a
X@kindex a (Group Mode)
X@findex gnus-Group-post-news
XCompose a new article (@code{gnus-Group-post-news}).  @xref{Followup and
XReply}, for more information.@refill
X
X@item M-k
X@kindex M-k (Group Mode)
X@findex gnus-Group-edit-local-kill
X@cindex edit local KILL file
XEdit a local KILL file (@code{gnus-Group-edit-local-kill}).  @xref{KILL
XFile}, for more information.@refill
X
X@item M-K
X@kindex M-K (Group Mode)
X@findex gnus-Group-edit-global-kill
X@cindex edit global KILL file
XEdit a global KILL file (@code{gnus-Group-edit-global-kill}).
X@xref{KILL File}, for more information.@refill
X
X@item V
X@kindex V (Group Mode)
X@findex gnus-version
X@cindex version number of GNUS
X@cindex GNUS version number
XPrint version number of this GNUS (@code{gnus-version}).
X
X@item ?
X@kindex ? (Group Mode)
X@findex gnus-Group-describe-briefly
X@cindex brief help message
X@cindex help briefly
XDescribe Group Mode commands briefly
X(@code{gnus-Group-describe-briefly}).@refill
X
X@item C-c C-i
X@kindex C-c C-i (Group Mode)
X@findex gnus-Info-find-node
X@cindex read Info file
X@cindex Info
XRead Info on Group Mode (@code{gnus-Info-find-node}).
X@xref{Texinfo Manual}, to prepare an Info file of GNUS.@refill
X@end table
X
X@node Subject Commands, Article Commands, Newsgroup Commands, Top
X@chapter Subject Commands
X
X  The Subject buffer is intended to show interesting headers of articles
Xin a newsgroup and to help you know what kind of discussions are being
Xheld there.  Messages of articles are displayed in the Article buffer
Xwhich is usually popped up automatically when necessary.  Scrolling of
Xthe messages and most other commands on articles can be done in the
XSubject buffer.
X
X@menu
X* Reading Articles::            How to read articles.
X* Searching Articles::          Searching for articles.
X* Referencing Articles::        Referencing parent articles.
X* Saving Articles::             Saving articles in your favorite format.
X* Sorting Headers::             Sorting subjects and other headers.
X* Followup and Reply::          Followup and reply commands.
X* Exiting Newsgroup::           How to exit the current newsgroup.
X* Other Subject Commands::      Other miscellaneous commands.
X@end menu
X
X@node Reading Articles, Searching Articles, Subject Commands, Subject Commands
X@section Reading Articles
X
X@ifinfo
X  Commands for browsing headers and reading messages are described here.
X@end ifinfo
X
X@menu
X* Browsing Headers::            Browsing through headers.
X* Moving Among Articles::       Selecting articles.
X* Scrolling::                   Browsing through a message.
X* Marking Articles::            Marking articles as (un)read.
X* Digest Articles::             How to read digest articles.
X@end menu
X
X@node Browsing Headers, Moving Among Articles, Reading Articles, Reading Articles
X@subsection Walking Around Headers
X
X@table @kbd
X@item C-n
X@kindex C-n (Subject Mode)
X@findex gnus-Subject-next-subject
XMove point to the next header (@code{gnus-Subject-next-subject}).
X
X@item C-p
X@kindex C-p (Subject Mode)
X@findex gnus-Subject-prev-subject
XMove point to the previous header (@code{gnus-Subject-prev-subject}).
X
X@item M-n
X@kindex M-n (Subject Mode)
X@findex gnus-Subject-next-unread-subject
XMove point to the next header, skipping marked articles
X(@code{gnus-Subject-next-unread-subject}).@refill
X
X@item M-p
X@kindex M-p (Subject Mode)
X@findex gnus-Subject-prev-unread-subject
XMove point to the previous header, skipping marked articles
X(@code{gnus-Subject-prev-unread-subject}).@refill
X
X@item j @var{number} RET
X@kindex j (Subject Mode)
X@findex gnus-Subject-goto-subject
XMove point to the header specified by the article @var{number}
X(@code{gnus-Subject-goto-subject}).@refill
X
X@item /
X@kindex / (Subject Mode)
XDo an incremental search on headers (@code{isearch-forward}).
X@end table
X
X@kindex SPC (Subject Mode)
X@findex gnus-Subject-next-page
X@kindex g (Subject Mode)
X@findex gnus-Subject-show-article
X  These commands are for moving the point on headers.  Type @key{SPC}
X(@code{gnus-Subject-next-page}) or @kbd{g}
X(@code{gnus-Subject-show-article}) to read an article on the line
X(@pxref{Scrolling}).@refill
X
X@table @kbd
X@item =
X@kindex = (Subject Mode)
X@findex gnus-Subject-expand-window
XExpand the Subject Mode window to show the headers full window
X(@code{gnus-Subject-expand-window}).@refill
X
X@item C-t
X@kindex C-t (Subject Mode)
X@findex gnus-Subject-toggle-truncation
XToggle truncation of the Subjet buffer
X(@code{gnus-Subject-toggle-truncation}).@refill
X@end table
X
X@kindex = (Subject Mode)
X@findex gnus-Subject-expand-window
X@kindex C-x 1
X@findex delete-other-windows
X  The command @kbd{=} (@code{gnus-Subject-expand-window}) expands the
XSubject Mode window by deleting the Article Mode window.  It is very
Xuseful for displaying the Subject buffer full window when browsing
Xthrough many headers.  The command behaves different from the command
X@kbd{C-x 1} (@code{delete-other-windows}) if windows more than two are
Xdisplayed.@refill
X
X@kindex C-t (Subject Mode)
X@findex gnus-Subject-toggle-truncation
X@cindex truncation of lines
X  Long lines in the Subject buffer are truncated and the continuation
Xlines are not displayed normally.  The command @kbd{C-t}
X(@code{gnus-Subject-toggle-truncation}) toggles the truncation of the
Xlines in the buffer.@refill
X
X@node Moving Among Articles, Scrolling, Browsing Headers, Reading Articles
X@subsection Moving Among Articles
X
X  The commands described here are for moving the point on headers, and
Xthen automatically selecting articles.
X
X@table @kbd
X@item n
X@kindex n (Subject Mode)
X@findex gnus-Subject-next-unread-article
XRead the next article, skipping marked articles
X(@code{gnus-Subject-next-unread-article}).@refill
X
X@item p
X@kindex p (Subject Mode)
X@findex gnus-Subject-prev-unread-article
XRead the previous article, skipping marked articles
X(@code{gnus-Subject-prev-unread-article}).@refill
X
X@item N
X@kindex N (Subject Mode)
X@findex gnus-Subject-next-article
XRead the next article (@code{gnus-Subject-next-article}).
X
X@item P
X@kindex P (Subject Mode)
X@findex gnus-Subject-prev-article
XRead the previous article (@code{gnus-Subject-prev-article}).
X
X@item M-C-n
X@kindex M-C-n (Subject Mode)
X@findex gnus-Subject-next-same-subject
XRead the next article with the same subject as the current article
X(@code{gnus-Subject-next-same-subject}).@refill
X
X@item M-C-p
X@kindex M-C-p (Subject Mode)
X@findex gnus-Subject-prev-same-subject
XRead the previous article with the same subject as the current article
X(@code{gnus-Subject-prev-same-subject}).@refill
X
X@item M-x gnus-Subject-next-unread-same-subject
X@findex gnus-Subject-next-unread-same-subject
XRead the next article with the same subject as the current article,
Xskipping marked articles.@refill
X
X@item M-x gnus-Subject-prev-unread-same-subject
X@findex gnus-Subject-prev-unread-same-subject
XRead the previous article with the same subject as the current article,
Xskipping marked articles.@refill
X
X@item .
X@kindex . (Subject Mode)
X@findex gnus-Subject-first-unread-article
XRead the first unread article
X(@code{gnus-Subject-first-unread-article}).@refill
X
X@item l
X@kindex l (Subject Mode)
X@findex gnus-Subject-goto-last-article
XRead the article selected last (@code{gnus-Subject-goto-last-article}).
X
X@item J @var{number} RET
X@kindex J (Subject Mode)
X@findex gnus-Subject-goto-article
XRead the article specified by the article @var{number}
X(@code{gnus-Subject-goto-article}).@refill
X@end table
X
X@kindex n (Subject Mode)
X@findex gnus-Subject-next-unread-article
X@kindex p (Subject Mode)
X@findex gnus-Subject-prev-unread-article
X@vindex gnus-auto-select-same
X@pindex rn
X  If the variable @code{gnus-auto-select-same} is non-@code{nil}, the
Xcommands @kbd{n} and @kbd{p} (@code{gnus-Subject-next-unread-article}
Xand @code{gnus-Subject-prev-unread-article}) move the point to unread
Xarticles with the same subject as the current article like the commands
X@kbd{M-x gnus-Subject-next-unread-same-subject} and @kbd{M-x
Xgnus-Subject-prev-unread-same-subject}, respectively.  If you are used
Xto running @samp{rn -S}, set the variable to non-@code{nil}.@refill
X
X@vindex gnus-auto-select-next
X  The variable @code{gnus-auto-select-next} defines the behavior of GNUS
Xwhen there is no unread article in the current newsgroup and a command
Xselecting the next unread article is executed.  If the variable is
Xnon-@code{nil}, the next newsgroup containing unread articles is
Xselected automatically.@refill
X
X  @xref{Variables}, for more information on customization.@refill
X
X@node Scrolling, Marking Articles, Moving Among Articles, Reading Articles
X@subsection Scrolling Within an Article
X
X@kindex SPC (Subject Mode)
X@findex gnus-Subject-next-page
X  Type @key{SPC} (@code{gnus-Subject-next-page}) to scroll to the next
Xpage of the current article.  If no article is selected yet, an article
Xnear the point is selected and its first page is displayed in the
XArticle buffer.  The next unread article is selected automatically if
X@key{SPC} is typed at the end of the message.@refill
X
X@table @kbd
X@item SPC
X@kindex SPC (Subject Mode)
X@findex gnus-Subject-next-page
XScroll to the next page of the current article
X(@code{gnus-Subject-next-page}).  Select it first if no article is
Xselected yet.  Select the next unread article automatically at the end of
Xthe message.@refill
X
X@item DEL
X@kindex DEL (Subject Mode)
X@findex gnus-Subject-prev-page
XScroll to the previous page of the current article
X(@code{gnus-Subject-prev-page}).@refill
X
X@item RET
X@kindex RET (Subject Mode)
X@findex gnus-Subject-scroll-up
XScroll up or down one line of the current article
X(@code{gnus-Subject-scroll-up}).@refill
X
X@item <
X@kindex < (Subject Mode)
X@findex gnus-Subject-beginning-of-article
XMove point to the beginning of the current article
X(@code{gnus-Subject-beginning-of-article}).@refill
X
X@item >
X@kindex > (Subject Mode)
X@findex gnus-Subject-end-of-article
XMove point to the end of the current article
X(@code{gnus-Subject-end-of-article}).@refill
X
X@item w
X@kindex w (Subject Mode)
X@findex gnus-Subject-stop-page-breaking
X@cindex page break
X@cindex break into pages
XStop page breaking (@code{gnus-Subject-stop-page-breaking}).@refill
X
X@item v
X@kindex v (Subject Mode)
X@findex gnus-Subject-show-all-headers
XShow all headers of the current article
X(@code{gnus-Subject-show-all-headers}).@refill
X
X@item t
X@kindex t (Subject Mode)
X@findex gnus-Subject-toggle-header
XShow all headers of the current article if pruned header currently
Xshown, or vice versa (@code{gnus-Subject-toggle-header}).@refill
X
X@item C-c C-r
X@kindex C-c C-r (Subject Mode)
X@findex gnus-Subject-caesar-message
X@cindex rot 13/47
X@cindex caesar messages
X@cindex encrypted articles
XCaesar rotate letters by 13 places and Japanese characters by 47 places
X(@code{gnus-Subject-caesar-message}).@refill
X
X@item g
X@kindex g (Subject Mode)
X@findex gnus-Subject-show-article
XForce to read the current article again
X(@code{gnus-Subject-show-article}).
X@end table
X
X@vindex gnus-window-configuration
X@cindex window configuration
X@cindex configure windows
X  If the Article buffer is not visible, it is popped up under the
XSubject buffer when necessary.  The height of the Subject buffer and
Xthat of the Article buffer can be customized by using the variable
X@code{gnus-window-configuration}.@refill
X
X@cindex rot 13/47
X@cindex caesar messages
X@cindex encrypted articles
X@kindex C-c C-r (Subject Mode)
X@findex gnus-Subject-caesar-message
X  The command @kbd{C-c C-r} (@code{gnus-Subject-caesar-message}) rotates
Xall letters in the message body of the current article by 13 places.
XJapanese characters are rotated by 47 places.  Running the command twice
Xon the same article results the original message.@refill
X
X@vindex gnus-break-pages
X@vindex gnus-page-delimiter
X@cindex page break
X@cindex break into pages
X  If the variable @code{gnus-break-pages} is non-@code{nil}, the message
Xis broken into pages at page delimiters specified by the variable
X@code{gnus-page-delimiter}.  The variable @code{gnus-more-message}
Xspecifies a message displayed at the end of the pages.  The command
X@kbd{w} (@code{gnus-Subject-stop-page-breaking}) temporary suspends page
Xbreaks.@refill
X
X@kindex t (Subject Mode)
X@findex gnus-Subject-toggle-header
X@vindex gnus-ignored-headers
X  The variable @code{gnus-ignored-headers} specifies header fields which
Xshould be ignored.  The command @kbd{v}
X(@code{gnus-Subject-show-all-headers}) shows all headers of the current
Xarticle, while the command @kbd{t} (@code{gnus-Subject-toggle-header})
Xtoggles the headers.@refill
X
X  @xref{Variables}, and @pxref{Hooks}, for more information on
Xcustomization.@refill
X
X@node Marking Articles, Digest Articles, Scrolling, Reading Articles
X@subsection Marking Articles
X@cindex article marks
X@cindex mark articles
X
X  GNUS uses three kinds of marks to indicate article status.
X
X@itemize @bullet
X@item
XWhite space @samp{ } for newly arrived articles.
X@item
XDash @samp{-} for articles marked as unread.
X@item
XAny other characters for articles marked as read.
X@end itemize
X
X  The status is displayed at the beginning of each line of the Subject
Xbuffer.  Commands for marking or removing these marks are as follows:
X
X@table @kbd
X@item d
X@kindex d (Subject Mode)
X@findex gnus-Subject-mark-as-read-forward
XMark article as read, and then move to the next subject
X(@code{gnus-Subject-mark-as-read-forward}).@refill
X
X@item D
X@kindex D (Subject Mode)
X@findex gnus-Subject-mark-as-read-backward
XMark article as read, and then move to the previous subject
X(@code{gnus-Subject-mark-as-read-backward}).@refill
X
X@item u
X@kindex u (Subject Mode)
X@findex gnus-Subject-mark-as-unread-forward
XMark article as unread, and then move to the next subject
X(@code{gnus-Subject-mark-as-unread-forward}).@refill
X
X@item U
X@kindex U (Subject Mode)
X@findex gnus-Subject-mark-as-unread-backward
XMark article as unread, and then move to the previous subject
X(@code{gnus-Subject-mark-as-unread-backward}).@refill
X
X@item M-u
X@kindex M-u (Subject Mode)
X@findex gnus-Subject-clear-mark-forward
XClear marks, and then move to the next subject
X(@code{gnus-Subject-clear-mark-forward}).@refill
X
X@item M-U
X@kindex M-U (Subject Mode)
X@findex gnus-Subject-clear-mark-backward
XClear marks, and then move to the previous subject
X(@code{gnus-Subject-clear-mark-backward}).@refill
X
X@item k
X@kindex k (Subject Mode)
X@findex gnus-Subject-kill-same-subject-and-select
XMark articles with the same subject as the current article as read, and
Xthen select the next unread article
X(@code{gnus-Subject-kill-same-subject-and-select}).@refill
X
X@item C-k
X@kindex C-k (Subject Mode)
X@findex gnus-Subject-kill-same-subject
XMark articles with the same subject as the current article as read
X(@code{gnus-Subject-kill-same-subject}).@refill
X
X@item c
X@itemx M-x gnus-Subject-catch-up-and-exit
X@kindex c (Subject Mode)
X@findex gnus-Subject-catch-up-and-exit
X@cindex catch up
XMark all articles, which are not marked as unread, as read, and then
Xexit the current newsgroup.@refill
X
X@item M-x gnus-Subject-catch-up-all-and-exit
X@findex gnus-Subject-catch-up-all-and-exit
X@cindex catch up
XMark all articles as read, and then exit the current newsgroup.@refill
X
X@item M-x gnus-Subject-catch-up
X@findex gnus-Subject-catch-up
X@cindex catch up
XMark all articles as read, preserving articles marked as unread.
X
X@item M-x gnus-Subject-catch-up-all
X@findex gnus-Subject-catch-up-all
X@cindex catch up
SHAR_EOF
echo "End of part 8, continue with part 9"
echo "9" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 9 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.texinfo continued
#
CurArch=9
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.texinfo
XMark all articles as read.
X@end table
X
X@kindex x (Subject Mode)
X@findex gnus-Subject-delete-marked-as-read
X@kindex X (Subject Mode)
X@findex gnus-Subject-delete-marked-with
X@cindex large newsgroup
X  It is helpful to delete headers marked as read while reading a large
Xnewsgroup.  The command @kbd{x}
X(@code{gnus-Subject-delete-marked-as-read}) deletes headers marked as
Xread.  The command @kbd{X} (@code{gnus-Subject-delete-marked-with})
Xdeletes headers which have a specific mark.@refill
X
X@table @kbd
X@item x
X@kindex x (Subject Mode)
X@findex gnus-Subject-delete-marked-as-read
XDelete headers marked as read
X(@code{gnus-Subject-delete-marked-as-read}).@refill
X
X@item X @var{mark} RET
X@kindex X (Subject Mode)
X@findex gnus-Subject-delete-marked-with
XDelete headers marked with @var{mark}
X(@code{gnus-Subject-delete-marked-with}).@refill
X@end table
X
X@node Digest Articles,, Marking Articles, Reading Articles
X@subsection Reading Digest Articles
X@cindex digest articles
X
X  @dfn{Digest article} is a message containing many messages in
X@dfn{digest} format.  Since a digest article contains many messages in
Xone article, it is a little bit difficult to read it on a per message
Xbasis.  The following commands make it easier to read each message in a
Xdigest.@refill
X
X@table @kbd
X@item C-c C-n
X@kindex C-c C-n (Subject Mode)
X@findex gnus-Subject-next-digest
XScroll to the next digest message of the current article
X(@code{gnus-Subject-next-digest}).@refill
X
X@item C-c C-p
X@kindex C-c C-p (Subject Mode)
X@findex gnus-Subject-prev-digest
XScroll to the previous digest message of the current article
X(@code{gnus-Subject-prev-digest}).@refill
X
X@item C-d
X@kindex C-d (Subject Mode)
X@findex gnus-Subject-rmail-digest
X@cindex Rmail
XRead the current digest article using Rmail
X(@code{gnus-Subject-rmail-digest}).@refill
X@end table
X
X@kindex C-c C-n (Subject Mode)
X@findex gnus-Subject-next-digest
X@kindex C-c C-p (Subject Mode)
X@findex gnus-Subject-prev-digest
X@vindex gnus-digest-separator
X@cindex digest separator
X  The commands @kbd{C-c C-n} and @kbd{C-c C-p}
X(@code{gnus-Subject-next-digest} and @code{gnus-Subject-prev-digest})
Xscroll a digest article to the next and previous digested message,
Xrespectively.  The variable @code{gnus-digest-separator} specifies a
Xregexp which separates digested messages.@refill
X
X@kindex C-d (Subject Mode)
X@findex gnus-Subject-rmail-digest
X@vindex gnus-Select-article-hook
X@cindex Rmail
X  The command @kbd{C-d} (@code{gnus-Subject-rmail-digest}) runs Rmail on
Xa digest article and makes it possible to read messages not in digest
Xform using Rmail Mode.  @inforef{Rmail, Rmail, emacs}, for more
Xinformation on Rmail Mode.  Use the hook @code{gnus-Select-article-hook}
Xto run Rmail on digest articles automatically.@refill
X
X@vindex gnus-Select-digest-hook
X@cindex incomplete digest articles
X  Digest articles in some newsgroups of USENET cannot be read using
XRmail.  In this case, a message @samp{Article is not a digest} is
Xdisplayed in the echo area of Emacs.  This means that these articles are
Xnot written in the proper digest format.  It is, however, possible to
Xread these incomplete digest articles by modifying the message headers
Xor bodies appropriately using the hook @code{gnus-Select-digest-hook}.
X@xref{Hooks}, to modify incomplete digest articles.@refill
X
X@vindex gnus-digest-show-summary
X@cindex digest summary
X@cindex summary of digest
X  If the variable @code{gnus-digest-show-summary} is non-@code{nil}, a
Xsummary of the digest article is also displayed automatically when Rmail
Xis invoked.@refill
X
X@node Searching Articles, Referencing Articles, Reading Articles, Subject Commands
X@section Searching Articles
X@cindex search for articles
X
X@table @kbd
X@item s
X@kindex s (Subject Mode)
X@findex gnus-Subject-isearch-article
XDo incremental search on the current article
X(@code{gnus-Subject-isearch-article}).@refill
X
X@item M-s @var{regexp} RET
X@kindex M-s (Subject Mode)
X@findex gnus-Subject-search-article-forward
XSearch for articles containing a match for @var{regexp} forward
X(@code{gnus-Subject-search-article-forward}).  If @var{regexp} is empty,
Xthe last regexp used is used again.@refill
X
X@item M-S @var{regexp} RET
X@kindex M-S (Subject Mode)
X@findex gnus-Subject-search-article-backward
XSearch for articles containing a match for @var{regexp} backward
X(@code{gnus-Subject-search-article-backward}).  If @var{regexp} is empty,
Xthe last regexp used is used again.@refill
X
X@item & @var{field} RET @var{regexp} RET @var{command} RET
X@kindex & (Subject Mode)
X@findex gnus-Subject-execute-command
XExecute @var{command} on articles containing a match for @var{regexp} in
X@var{field} of the headers (@code{gnus-Subject-execute-command}).  If
X@var{field} is empty, the entire article is searched for.@refill
X@end table
X
X@kindex s (Subject Mode)
X@findex gnus-Subject-isearch-article
X@kindex M-s (Subject Mode)
X@findex gnus-Subject-search-article-forward
X@kindex M-S (Subject Mode)
X@findex gnus-Subject-search-article-backward
X  The command @kbd{s} (@code{gnus-Subject-isearch-article}) does an
Xincremental search on the current article.  The commands @kbd{M-s} and
X@kbd{M-S} (@code{gnus-Subject-search-article-forward} and
X@code{gnus-Subject-search-article-backward}) search for articles
Xcontaining a match for regexp.  The search starts from the current point
Xof the current article.@refill
X
X@kindex & (Subject Mode)
X@findex gnus-Subject-execute-command
X  The command @kbd{&} (@code{gnus-Subject-execute-command})
Xinteractively reads the field name of article headers, regexp, and a
Xvalid command key sequence.  It then searches for articles having a
Xfield that contains a match for the regexp, and then executes the
Xcommand specified by the key sequence on them.@refill
X
X@node Referencing Articles, Saving Articles, Searching Articles, Subject Commands
X@section Referencing Articles
X@cindex refer to articles
X
X@table @kbd
X@item ^
X@kindex ^ (Subject Mode)
X@findex gnus-Subject-refer-parent-article
XRefer to parent of the current article
X(@code{gnus-Subject-refer-parent-article}).  With a prefix argument, go
Xback to the child.@refill
X
X@item M-r @var{Message-ID} RET
X@kindex M-r (Subject Mode)
X@findex gnus-Subject-refer-article
XRefer to the article by using the @var{Message-ID}
X(@code{gnus-Subject-refer-article}).  With an empty @var{Message-ID}, go
Xback to the origin.@refill
X@end table
X
X@kindex ^ (Subject Mode)
X@findex gnus-Subject-refer-parent-article
X  The command @kbd{^} (@code{gnus-Subject-refer-parent-article}) refers
Xto parent article of the current article.  The child article is remembered in
Xinternal history, and it is possible to return to the child by giving a
Xprefix argument to the command.@refill
X
X@kindex ^ (Subject Mode)
X@findex gnus-Subject-refer-parent-article
X@kindex M-r (Subject Mode)
X@findex gnus-Subject-refer-article
X  The commands @kbd{^} and @kbd{M-r}
X(@code{gnus-Subject-refer-parent-article} and
X@code{gnus-Subject-refer-article}) share the same internal history.  You
Xcan thus go back to a child using the command @kbd{M-r} with an empty
XMessage-ID.@refill
X
X@kindex g (Subject Mode)
X@findex gnus-Subject-show-article
X  Type @kbd{g} (@code{gnus-Subject-show-article}) to go back to the
Xorigin from the visited articles directly.@refill
X
X  @xref{Article Commands}, to refer to articles by using Message-IDs
Xincluded in the messages.@refill
X
X@node Saving Articles, Sorting Headers, Referencing Articles, Subject Commands
X@section Saving Articles
X@cindex save articles
X
X@kindex o (Subject Mode)
X@findex gnus-Subject-save-article
X@findex gnus-Subject-save-in-rmail
X@vindex gnus-default-article-saver
X@cindex Rmail file
X@cindex Unix mailbox
X@cindex MH folder
X@pindex MH
X  GNUS provides four different formats for saving articles: Rmail
Xformat, Unix mailbox format, MH folder, and article format.  If you set
Xthe variable @code{gnus-default-article-saver} to your favorite article
Xsaver, you can save an article using the command @kbd{o}
X(@code{gnus-Subject-save-article}) in your favorite format.  The default
Xsaver is the function @code{gnus-Subject-save-in-rmail}.@refill
X
X@table @kbd
X@item o
X@kindex o (Subject Mode)
X@findex gnus-Subject-save-article
XSave the current article using the default saver specified by the
Xvariable @code{gnus-default-article-saver}
X(@code{gnus-Subject-save-article}).@refill
X
X@item C-o
X@itemx M-x gnus-Subject-save-in-mail
X@kindex C-o (Subject Mode)
X@findex gnus-Subject-save-in-mail
XSave the current article in Unix mailbox format.
X
X@item M-x gnus-Subject-save-in-rmail
X@findex gnus-Subject-save-in-rmail
XSave the current article in Rmail format.
X
X@item M-x gnus-Subject-save-in-folder
X@findex gnus-Subject-save-in-folder
XSave the current article in an MH folder.
X
X@item M-x gnus-Subject-save-in-file
X@findex gnus-Subject-save-in-file
XSave the current article in article format.
X
X@item | @var{command} RET
X@kindex | (Subject Mode)
X@findex gnus-Subject-pipe-output
XSend contents of the current article to the @var{command} subprocess
X(@code{gnus-Subject-pipe-output}).@refill
X@end table
X
X@vindex gnus-save-all-headers
X  If the variable @code{gnus-save-all-headers} is non-@code{nil}, all
Xheaders of an article are saved.@refill
X
X@vindex gnus-article-save-directory
X@vindex SAVEDIR
X@findex gnus-Subject-save-in-mail
X@findex gnus-Subject-save-in-rmail
X@findex gnus-Subject-save-in-file
X  The variable @code{gnus-article-save-directory} specifies a directory
Xin which articles are saved to by the functions
X@code{gnus-Subject-save-in-mail}, @code{gnus-Subject-save-in-rmail}, and
X@code{gnus-Subject-save-in-file}.  It is initialized from the
X@code{SAVEDIR} environment variable.  The default directory is
X@samp{~/News}.@refill
X
X@vindex gnus-mail-save-name
X@vindex gnus-rmail-save-name
X@vindex gnus-folder-save-name
X@vindex gnus-file-save-name
X  The variables @code{gnus-mail-save-name}, @code{gnus-rmail-save-name},
X@code{gnus-folder-save-name}, and @code{gnus-file-save-name} specify
Xfunctions generating default file name to which articles are saved using
X@code{gnus-Subject-save-in-mail}, @code{gnus-Subject-save-in-rmail},
X@code{gnus-Subject-save-in-folder}, and
X@code{gnus-Subject-save-in-file}, respectively.  The function is called
Xwith @var{newsgroup}, @var{headers}, and optional
X@var{last-name}.@refill
X
X  @xref{Variables}, for more information on customization.@refill
X
X@node Sorting Headers, Followup and Reply, Saving Articles, Subject Commands
X@section Sorting Headers
X@cindex sort headers
X
X  The headers listed in the Subject buffer can be sorted by number,
Xsubject, date, or author of articles.  Sorting is stable, so it is
Xpossible to combine them to sort the headers with multiple keys.  To
Xsort in reverse order, give a prefix argument to the commands.
X
X@table @kbd
X@item C-c C-s n
X@itemx C-c C-s C-n
X@kindex C-c C-s n (Subject Mode)
X@kindex C-c C-s C-n (Subject Mode)
X@findex gnus-Subject-sort-by-number
XSort the headers by number (@code{gnus-Subject-sort-by-number}).@refill
X
X@item C-c C-s s
X@itemx C-c C-s C-s
X@kindex C-c C-s s (Subject Mode)
X@kindex C-c C-s C-s (Subject Mode)
X@findex gnus-Subject-sort-by-subject
XSort the headers by subject
X(@code{gnus-Subject-sort-by-subject}).@refill
X
X@item C-c C-s d
X@itemx C-c C-s C-d
X@kindex C-c C-s d (Subject Mode)
X@kindex C-c C-s C-d (Subject Mode)
X@findex gnus-Subject-sort-by-date
XSort the headers by date (@code{gnus-Subject-sort-by-date}).
X
X@item C-c C-s a
X@itemx C-c C-s C-a
X@kindex C-c C-s a (Subject Mode)
X@kindex C-c C-s C-a (Subject Mode)
X@findex gnus-Subject-sort-by-author
XSort the headers by author (@code{gnus-Subject-sort-by-author}).
X@end table
X
X@vindex gnus-Select-group-hook
X  It is also possible to sort the headers automatically when a newsgroup
Xis selected using the hook @code{gnus-Select-group-hook}
X(@pxref{Hooks}).@refill
X
X@node Followup and Reply, Exiting Newsgroup, Sorting Headers, Subject Commands
X@section Followup and Reply
X@cindex followup to article
X@cindex reply to articles
X@cindex cancel article
X@cindex post articles
X@cindex mail
X
X@table @kbd
X@item f
X@kindex f (Subject Mode)
X@findex gnus-Subject-post-reply
XFollowup to the current article (@code{gnus-Subject-post-reply}).
X
X@item F
X@kindex F (Subject Mode)
X@findex gnus-Subject-post-reply-with-original
XFollowup to the current article with the original article
X(@code{gnus-Subject-post-reply-with-original}).@refill
X
X@item a
X@kindex a (Subject Mode)
X@findex gnus-Subject-post-news
XCompose a new article (@code{gnus-Subject-post-news}).
X@end table
X
X@kindex a (Subject Mode)
X@findex gnus-Subject-post-news
X@kindex f (Subject Mode)
X@findex gnus-Subject-post-reply
X@kindex F (Subject Mode)
X@findex gnus-Subject-post-reply-with-original
X@vindex gnus-interactive-post
X@vindex gnus-novice-user
X@kindex C-c C-y (News Mode)
X@findex news-reply-yank-original
X  Type @kbd{a} (@code{gnus-Subject-post-news}) to post a new article.
XIf the variable @code{gnus-interactive-post} is non-@code{nil}, the
Xnewsgroup, subject, and distribution are asked for interactively.  The
Xcommand @kbd{f} (@code{gnus-Subject-post-reply}) fills these values in
Xautomatically from those of the original article.  Type @kbd{C-c C-y}
X(@code{news-reply-yank-original}) to include the original article.  The
Xcommand @kbd{F} (@code{gnus-Subject-post-reply-with-original}) yanks the
Xoriginal article automatically.  If the variable @code{gnus-novice-user}
Xis non-@code{nil}, your confirmations will be required for composing a
Xnew article.@refill
X
X@cindex News Mode
X@kindex C-h m
X@findex describe-mode
X  The major mode for composing a new article is @dfn{News Mode} which is
Xborrowed from @file{rnewspost.el}.  Type @kbd{C-h m}
X(@code{describe-mode}) to get more help on News Mode.@refill
X
X@table @kbd
X@item C
X@kindex C (Subject Mode)
X@cindex cancel article
X@findex gnus-Subject-cancel-article
XCancel the current article you posted
X(@code{gnus-Subject-cancel-article}).@refill
X@end table
X
X@kindex C (Subject Mode)
X@cindex cancel article
X@findex gnus-Subject-cancel-article
X  Suppose you post an article and then later realize that you made a
Xhorrible mistake.  You really do not want anyone to see your article.
XYou want the article to be removed from any machines that it may have
Xreached.  The command @kbd{C} (@code{gnus-Subject-cancel-article}) is
Xintended to do this.  First select the offending article as current,
Xthen type @kbd{C}.@refill
X
X@table @kbd
X@item r
X@kindex r (Subject Mode)
X@findex gnus-Subject-mail-reply
XReply to the author of the current article (@code{gnus-Subject-mail-reply}).
X
X@item R
X@kindex R (Subject Mode)
X@findex gnus-Subject-mail-reply-with-original
XReply to the author of the current article with the original article
X(@code{gnus-Subject-mail-reply-with-original}).@refill
X
X@item m
X@kindex m (Subject Mode)
X@findex gnus-Subject-mail-other-window
XCompose a mail message in other window (@code{gnus-Subject-mail-other-window}).
X@end table
X
X@cindex Mail Mode
X@kindex r (Subject Mode)
X@findex gnus-Subject-mail-reply
X@kindex C-c C-y (Mail Mode)
X@findex mail-yank-original
X@kindex R (Subject Mode)
X@findex gnus-Subject-mail-reply-with-original
X  Use the command @kbd{r} (@code{gnus-Subject-mail-reply}) to reply to
Xthe author of the article.  Type @kbd{C-c C-y}
X(@code{mail-yank-original}) to include the original article.  The
Xcommand @kbd{R} (@code{gnus-Subject-mail-reply-with-original}) yanks the
Xoriginal article automatically.  @inforef{Mail Mode, Mail Mode, emacs},
Xfor more information.@refill
X
X@node Exiting Newsgroup, Other Subject Commands, Followup and Reply, Subject Commands
X@section Exiting the Current Newsgroup
X
X@table @kbd
X@item q
X@kindex q (Subject Mode)
X@findex gnus-Subject-exit
XExit the current newsgroup, and return to Group Mode
X(@code{gnus-Subject-exit}).@refill
X
X@item Q
X@kindex Q (Subject Mode)
X@findex gnus-Subject-quit
XExit the current newsgroup without recording unread articles information
X(@code{gnus-Subject-quit}).@refill
X
X@item c
X@itemx M-x gnus-Subject-catch-up-and-exit
X@kindex c (Subject Mode)
X@findex gnus-Subject-catch-up-and-exit
X@cindex catch up
XMark all articles, which are not marked as unread, as read, then exit
Xthe current newsgroup.@refill
X
X@item M-x gnus-Subject-catch-up-all-and-exit
X@kindex c (Subject Mode)
X@findex gnus-Subject-catch-up-all-and-exit
X@cindex catch up
XMark all articles as read, then exit the current newsgroup.@refill
X
X@item G
X@kindex G (Subject Mode)
X@findex gnus-Subject-reselect-current-group
XRecord unread articles information, then reselect the current newsgroup
X(@code{gnus-Subject-reselect-current-group}).@refill
X
X@item M-x gnus-Subject-next-group
X@findex gnus-Subject-next-group
XRecord unread articles information, then select the next newsgroup
Xcontaining unread articles.@refill
X
X@item M-x gnus-Subject-prev-group
X@findex gnus-Subject-prev-group
XRecord unread articles information, then select the previous newsgroup
Xcontaining unread articles.@refill
X@end table
X
X@kindex G (Subject Mode)
X@findex gnus-Subject-reselect-current-group
X  The command @kbd{G} (@code{gnus-Subject-reselect-current-group})
Xselects the current newsgroup again after temporary exiting the
Xnewsgroup.  If no articles remain unread, all articles in the newsgroup
Xwill be selected.  A prefix argument to the command means to select all
Xarticles in the newsgroup.@refill
X
X@node Other Subject Commands,, Exiting Newsgroup, Subject Commands
X@section Miscellaneous Commands
X
X  Other miscellaneous commands are described here.
X
X@table @kbd
X@item M-k
X@kindex M-k (Subject Mode)
X@findex gnus-Subject-edit-local-kill
X@cindex edit local KILL file
XEdit a local KILL file applied to the current newsgroup
X(@code{gnus-Subject-edit-local-kill}).  @xref{KILL File}, for more
Xinformation.@refill
X
X@item M-K
X@kindex M-K (Subject Mode)
X@findex gnus-Subject-edit-global-kill
X@cindex edit global KILL file
XEdit a global KILL file applied to all newsgroups
X(@code{gnus-Subject-edit-local-kill}).  @xref{KILL File}, for more
Xinformation.@refill
X
X@item V
X@kindex V (Subject Mode)
X@findex gnus-version
X@cindex version number of GNUS
X@cindex GNUS version number
XPrint the version number of this GNUS (@code{gnus-version}).
X
X@item ?
X@kindex ? (Subject Mode)
X@findex gnus-Subject-describe-briefly
X@cindex brief help message
X@cindex help briefly
XDescribe Subject Mode commands briefly
X(@code{gnus-Subject-describe-briefly}).@refill
X
X@item C-c C-i
X@kindex C-c C-i (Subject Mode)
X@findex gnus-Info-find-node
X@cindex read Info file
X@cindex Info
XRead Info on Subject Mode (@code{gnus-Info-find-node}).
X@xref{Texinfo Manual}, to prepare an Info file of GNUS.@refill
X@end table
X
X@node Article Commands, KILL File, Subject Commands, Top
X@chapter Article Commands
X
X  In the Article buffer the following commands are available:
X
X@table @kbd
X@item SPC
X@kindex SPC (Article Mode)
X@findex gnus-Article-next-page
XScroll text of the current window (@code{gnus-Article-next-page}).
X
X@item DEL
X@kindex DEL (Article Mode)
X@findex gnus-Article-prev-page
XScroll text of the current window (@code{gnus-Article-prev-page}).
X
X@item r
X@kindex r (Article Mode)
X@findex gnus-Article-refer-article
XRefer to article specified by the Message-ID close to the point
X(@code{gnus-Article-refer-article}).@refill
X
X@item o
X@kindex o (Article Mode)
X@findex gnus-Article-pop-article
XReturn to the previous article from the referenced article
X(@code{gnus-Article-pop-article}).@refill
X
X@item h
X@itemx s
X@kindex h (Article Mode)
X@kindex s (Article Mode)
X@findex gnus-Article-show-subjects
XReconfigure Emacs windows to show the Subject buffer above the Article
Xbuffer and move the point to the Subject buffer
X(@code{gnus-Article-show-subjects}).@refill
X
X@item ?
X@kindex ? (Article Mode)
X@findex gnus-Article-describe-briefly
X@cindex brief help message
X@cindex help briefly
XDescribe Article Mode commands briefly
X(@code{gnus-Article-describe-briefly}).@refill
X
X@item C-c C-i
X@kindex C-c C-i (Article Mode)
X@findex gnus-Info-find-node
X@cindex read Info file
X@cindex Info
XRead Info on Article Mode (@code{gnus-Info-find-node}).
X@xref{Texinfo Manual}, to prepare an Info file of GNUS.@refill
X@end table
X
X@kindex r (Article Mode)
X@findex gnus-Article-refer-article
X@kindex o (Article Mode)
X@findex gnus-Article-pop-article
X  The command @kbd{r} (@code{gnus-Article-refer-article}) searches for
Xthe Message-ID around the point, and refers to the article specified by
Xit if found.  Use the command @kbd{o} (@code{gnus-Article-pop-article})
Xto return to the previous article.  @xref{Referencing Articles}, for
Xreferencing parent articles easily.@refill
X
X@node KILL File, Customization, Article Commands, Top
X@chapter KILL File
X@cindex KILL file
X
X@ifinfo
X  The purpose of a KILL file and its usage are described here.
X@end ifinfo
X
X@menu
X* What KILL Files Do::          An introduction to a KILL file.
X* Making a KILL File::          How to make a KILL file.
X* Editing KILL Files::          How to edit KILL files.
X* Example of a KILL File::      An example of a KILL file.
X* Advanced Kills::              Advanced features of KILL files.
X@end menu
X
X@node What KILL Files Do, Making a KILL File, KILL File, KILL File
X@section What KILL Files Do
X
X  A @dfn{KILL} file contains lisp expressions to be applied to a
Xselected newsgroup.  The purpose is to mark articles as read on the
Xbasis of some set of regexps.@refill
X
X@cindex global KILL file
X@cindex local KILL file
X  There are two kinds of KILL files, global and local.  A global KILL
Xfile is applied to every newsgroup, and a local KILL file to a specified
Xnewsgroup.  Since a global KILL file is applied to every newsgroup, for
Xbetter performance use a local one.@refill
X
X@node Making a KILL File, Editing KILL Files, What KILL Files Do, KILL File
X@section Making a KILL File
X
X  A KILL file can contain any kind of Emacs lisp expressions expected to
Xbe evaluated in the Subject buffer.  Writing lisp programs for this
Xpurpose is not easy because the internal working of GNUS must be
Xwell-known.  For this reason, GNUS provides a general function which does
Xthis easily for non-lisp programmers.@refill
X
X@example
X(gnus-kill @var{field} @var{regexp} &optional @var{command} @var{all})
X@end example
X
X@findex gnus-kill
X@findex gnus-Subject-mark-as-read
X@noindent
XThe @code{gnus-kill} function executes commands available in Subject
XMode by their key sequences.  @code{gnus-kill} must be called with
X@var{field}, @var{regexp}, and optional @var{command} and @var{all}.
X@var{Field} is a string representing the header field or an empty
Xstring.  If @var{field} is an empty string, the entire article body is
Xsearched for.  @var{Regexp} is a string which is compared with
X@var{field} value.  @var{Command} is a string representing a valid key
Xsequence in Subject Mode or a lisp expression.  @var{Command} is default
Xto @code{(gnus-Subject-mark-as-read nil "X")}.  Make sure that
X@var{command} is executed in the Subject buffer.  If the second optional
Xargument @var{all} is non-@code{nil}, the @var{command} is applied to
Xarticles which are already marked as read or unread.  Articles which are
Xmarked are skipped over by default.@refill
X
X  For example, if you want to mark articles of which subjects contain
Xthe string @samp{AI} as read, a possible KILL file may look like:@refill
X
X@example
X(gnus-kill "Subject" "AI")
X@end example
X
X  If you want to mark articles with @samp{D} instead of @samp{X}, you
Xcan use the following expression:@refill
X
X@example
X(gnus-kill "Subject" "AI" "d")
X@end example
X
X@findex gnus-Subject-mark-as-read-forward
X@noindent
XIn this example it is assumed that the command
X@code{gnus-Subject-mark-as-read-forward} is assigned to @kbd{d} in
XSubject Mode.@refill
X
X  It is possible to delete unnecessary headers which are marked with
X@samp{X} in a KILL file by using the function @code{gnus-expunge} as
Xfollows:@refill
X
X@findex gnus-expunge
X@example
X(gnus-expunge "X")
X@end example
X
X  If the Subject buffer is empty after applying KILL files, GNUS will
Xexit the selected newsgroup normally.  If headers which are marked with
X@samp{D} are deleted in a KILL file, it is impossible to read articles
Xwhich are marked as read in the previous GNUS sessions.  Marks other
Xthan @samp{D} should be used for articles which should really be
Xdeleted.@refill
X
X@vindex case-fold-search
X@cindex case of text
X  All sorts of searches in Subject Mode normally ignore the case of the
Xtext they are searching through.  If you do not want to ignore the case,
Xset the variable @code{case-fold-search} to @code{nil}.@refill
X
X@node Editing KILL Files, Example of a KILL File, Making a KILL File, KILL File
X@section Editing KILL Files
X@cindex edit local KILL file
X@cindex edit global KILL file
X
X@kindex M-K (Group Mode)
X@findex gnus-Group-edit-global-kill
X@kindex M-K (Subject Mode)
X@findex gnus-Subject-edit-global-kill
X@vindex gnus-article-save-directory
X@vindex gnus-kill-file-name
X  The command @kbd{M-K} in Subject Mode and Group Mode
X(@code{gnus-Subject-edit-global-kill} and
X@code{gnus-Group-edit-global-kill}) pops up an Emacs buffer for editing
Xa global KILL file.  A global KILL file is created in the directory
Xspecified by the variable @code{gnus-article-save-directory} (default to
X@file{~/News}), and its file name is specified by the variable
X@code{gnus-kill-file-name} (default to @file{KILL}).@refill
X
X@kindex M-k (Subject Mode)
X@findex gnus-Subject-edit-local-kill
X@kindex M-k (Group Mode)
X@findex gnus-Group-edit-local-kill
X@vindex gnus-article-save-directory
X@vindex gnus-use-long-file-name
X  The command @kbd{M-k} in Subject Mode and Group Mode
X(@code{gnus-Subject-edit-local-kill} and
X@code{gnus-Group-edit-local-kill}) pops up an Emacs buffer for editing a
Xlocal KILL file.  A local KILL file for a newsgroup @var{news.group} is
Xcreated as @file{@var{news.group}.KILL} in the directory specified by
Xthe variable @code{gnus-article-save-directory} if the variable
X@code{gnus-use-long-file-name} is non-@code{nil}.  Otherwise, if the
Xvariable @code{gnus-use-long-file-name} is @code{nil}, the file is
Xcreated as @file{@var{news}/@var{group}/KILL} under the same
Xdirectory.@refill
X
X@cindex KILL-File Mode
X@cindex Emacs-Lisp Mode
X  The major mode of these buffers is @dfn{KILL-File Mode}.  This mode is
Xspecialized for editing Emacs lisp programs the same as Emacs-Lisp Mode.
XIn addition to Emacs-Lisp Mode, the following commands are
Xavailable:@refill
X
X@table @kbd
X@item C-c C-k C-s
X@kindex C-c C-k C-s (KILL-File Mode)
X@findex gnus-Kill-file-kill-by-subject
XInsert a template of a kill command on subject
X(@code{gnus-Kill-file-kill-by-subject}).@refill
X
X@item C-c C-k C-a
X@kindex C-c C-k C-a (KILL-File Mode)
X@findex gnus-Kill-file-kill-by-author
XInsert a template of a kill command on author
X(@code{gnus-Kill-file-kill-by-author}).@refill
X
X@item C-c C-c
X@kindex C-c C-c (KILL-File Mode)
X@findex gnus-Kill-file-exit
XSave the KILL file and then return to the previous buffer
X(@code{gnus-Kill-file-exit}).@refill
X
X@item C-c C-i
X@kindex C-c C-i (KILL-File Mode)
X@findex gnus-Info-find-node
X@cindex read Info file
X@cindex Info
XRead Info on KILL file (@code{gnus-Info-find-node}).
X@xref{Texinfo Manual}, to prepare an Info file of GNUS.@refill
X@end table
X
X@kindex C-c C-k C-s (KILL-File Mode)
X@kindex C-c C-k C-a (KILL-File Mode)
X@findex gnus-Kill-file-kill-by-subject
X@findex gnus-Kill-file-kill-by-author
X  If KILL-File Mode is invoked from Subject Mode by the command
X@code{gnus-Subject-edit-local-kill} or
X@code{gnus-Subject-edit-global-kill}, the commands @kbd{C-c C-k C-s} and
X@kbd{C-c C-k C-a} (@code{gnus-Kill-file-kill-by-subject} and
X@code{gnus-Kill-file-kill-by-author}) insert a kill command on the
Xsubject and author of an article where the point is on, respectively.
XOtherwise, a template of a kill command is inserted.@refill
X
X@node Example of a KILL File, Advanced Kills, Editing KILL Files, KILL File
X@section Example of a KILL File
X@cindex KILL file examples
X@cindex example of a KILL file
X
X  The following is an example of a local KILL file for newsgroup
X@samp{control}.  This is currently being used by the author.@refill
X
X@vindex gnus-nntp-server
X@findex gnus-kill
X@findex gnus-expunge
X@example
X;; Apply to the newsgroup `control' if the NNTP server is flab.
X(if (string-equal gnus-nntp-server "flab")
X    (progn
X      (gnus-kill "Subject" "ihave flab\\|sendme")
X      (gnus-kill "Subject" "cancel\\|newgroup\\|rmgroup" "d")
X      (gnus-expunge "X")))
X@end example
X
X@node Advanced Kills,, Example of a KILL File, KILL File
X@section Advanced Kill Processing
X
X@findex gnus-apply-kill-file
X@vindex gnus-Apply-kill-hook
X  Internally, applying kills means to run the hook
X@code{gnus-Apply-kill-hook}.  It is called after the Subject buffer is
Xprepared for a selected newsgroup.  The default hook is the function
X@code{gnus-apply-kill-file} which loads a global KILL file and a local
XKILL file in this order.  A different style of the kill processing can
Xbe implemented by customizing this hook.@refill
X
X  For example, if you think a global KILL file is unnecessary, you can
Xuse the following hook which applies only a local KILL file.  This
Xchange can save the time for checking the existence of a global KILL
Xfile.@refill
X
X@vindex gnus-Apply-kill-hook
X@vindex gnus-newsgroup-name (Internal)
X@findex gnus-newsgroup-kill-file
X@example
X(setq gnus-Apply-kill-hook
X      '(lambda ()
X         ;; Apply a local KILL file.
X         (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t)))
X@end example
X
X  On the contrary, the following example enables only a global KILL
Xfile.@refill
X
X@vindex gnus-Apply-kill-hook
X@findex gnus-newsgroup-kill-file
X@example
X(setq gnus-Apply-kill-hook
X      '(lambda ()
X         ;; Apply a global KILL file.
X         (load (gnus-newsgroup-kill-file nil) t nil t)))
X@end example
X
X  Here is an advanced example that drastically reduces the time for
Xapplying KILL files.  This hook does the kill processing directly
Xwithout loading the KILL files.@refill
X
X@vindex gnus-nntp-server
X@vindex gnus-newsgroup-name (Internal)
X@findex gnus-kill
X@findex gnus-expunge
X@example
X(setq gnus-Apply-kill-hook
X      '(lambda ()
X         ;; Apply to the newsgroup `control'
X         ;; if the NNTP server is flab.
X         (and (string-equal gnus-nntp-server "flab")
X              (string-equal gnus-newsgroup-name "control")
X              (progn
X                (gnus-kill "Subject" "ihave flab\\|sendme")
X                (gnus-kill "Subject" "cancel\\|newgroup\\|rmgroup" "d")
X                (gnus-expunge "X")))))
X@end example
X
X@node Customization, Problems, KILL File, Top
X@appendix Customizing GNUS
X
X  Appendix A describes the variables and hooks for simple customizations
Xand the variables for localizations.
X
X@menu
X* Variables::           Variables for customizing GNUS.
X
X* NNTP Variables::      Variables for localizing NNTP environment.
X* Spool Variables::     Variables for localizing news spool environment.
X* Directory Variables:: Variables for localizing private directory environment.
X
X* Hooks::               Function hooks for customizing GNUS.
X@end menu
X
X@node Variables, NNTP Variables, Customization, Customization
X@appendixsec Common Variables
X
X@table @code
X@vindex gnus-nntp-server
X@vindex NNTPSERVER
X@cindex NNTP server
X@item gnus-nntp-server
X
X@cindex private directory
XSpecifies the name of the host running the NNTP server.  The variable is
Xinitialized from the @code{NNTPSERVER} environment variable.  If the
Xserver name is preceded by a colon such as @samp{:Mail}, the user's
Xprivate directory @file{~/Mail} is used as a news spool.  @xref{NNTP
XServer}, and @pxref{Private Directory}, for more information.@refill
X
X@vindex gnus-nntp-service
X@cindex NNTP service
X@item gnus-nntp-service
X
XSpecifies a service name of NNTP, usually a string @code{"nntp"}.  In a
Xfew instances, it must be the number @code{119}.  To use a local news
Xspool of your machine rather than NNTP, set the variable to @code{nil}.
X@xref{NNTP Service}, and @pxref{Local News Spool}, for more
Xinformation.@refill
X
X@vindex gnus-your-domain
X@vindex DOMAINNAME
X@findex system-name
X@cindex domain
X@item gnus-your-domain
X
XSpecifies the domain which is the domain part of your mail address
Xexcluding the local host name of your machine.  The environment variable
X@code{DOMAINNAME} is used instead if defined.  If the function
X@code{system-name} returns the full Internet name, there is no need to
Xdefine the domain.  @xref{Domain,, Domain and Organization}, for more
Xinformation.@refill
X
X@vindex gnus-your-organization
X@vindex ORGANIZATION
X@cindex organization
X@item gnus-your-organization
X
XSpecifies the organization you belong to.  The environment variable
X@code{ORGANIZATION} is used instead if defined.  If the value begins
Xwith a slash, it is taken as the name of a file whose contents are read
Xfor the value.  @xref{Domain,, Domain and Organization}, for more
Xinformation.@refill
X
X@vindex gnus-use-generic-from
X@vindex gnus-your-domain
X@vindex DOMAINNAME
X@cindex GENERICFROM
X@cindex From field
X@item gnus-use-generic-from
X
XNon-@code{nil} means the local host name of your machine will not appear
Xin the @samp{From:} field of article headers.  If the variable is a
Xstring, it is used as your domain instead of the definition by the
Xvariable @code{gnus-your-domain} or the environment variable
X@code{DOMAINNAME}.  @xref{GENERICFROM}, for more information.@refill
X
X@vindex gnus-use-generic-path
X@cindex GENERICPATH
X@cindex Path field
X@item gnus-use-generic-path
X
XNon-@code{nil} means the NNTP server name will not appear in the
X@samp{Path:} field of article headers.  If the variable is a string, it
Xis used in the @samp{Path:} field as the NNTP server name instead of the
Xdefinition by the variable @code{gnus-nntp-server}.  @xref{GENERICPATH},
Xfor more information.@refill
X
X@vindex gnus-startup-file
X@cindex startup file
X@cindex .newsrc
X@item gnus-startup-file
X
XSpecifies a startup file of the Bnews system, usually @file{.newsrc}.
XIf there is a file named @file{.newsrc-@var{server}}, it is used instead
Xwhen talking to @var{server}.  @xref{Startup File}, for more
Xinformation.@refill
X
X@vindex gnus-signature-file
X@cindex .signature
X@cindex signature
X@item gnus-signature-file
X
XSpecifies a signature file of the Bnews system, usually
X@file{.signature}.  If there is a file named
X@file{.signature-@var{distribution}}, it is used instead when posting an
Xarticle in @var{distribution}.  Set the variable to @code{nil} to
Xprevent appending the signature file automatically.@refill
X
X@vindex gnus-use-full-window
X@cindex full window
X@cindex entire screen
X@cindex window configuration
X@item gnus-use-full-window
X
XNon-@code{nil} means to take up the entire screen of Emacs.  If the
Xvariable is @code{nil}, the windows used by GNUS will be restricted to
Xthe bounds of the original window.  This is very useful if you want to
Xread articles while you do other work in other windows.@refill
X
X@vindex gnus-window-configuration
X@cindex window configuration
X@cindex configure windows
X@item gnus-window-configuration
X
XSpecifies the configuration of the Group Mode window, the Subject Mode
Xwindow, and the Article Mode window.  The window configuration can be
Xspecified for each action of GNUS (e.g. selecting a newsgroup or
Xselecting an article).  This is quite useful if you are using a slow
Xterminal since the update of Emacs windows can be minimized by
Xdisplaying these three windows same time.@refill
X
XThe variable must be a list of @samp{(@var{action} (@var{g} @var{s}
X@var{a}))}, where @var{action} is an action being performed, and
X@var{g}, @var{s}, and @var{a} are the relative heights of the Group Mode
Xwindow, the Subject Mode window, and the Article Mode window,
Xrespectively.  @var{Action} is @samp{SelectNewsgroup},
X@samp{ExitNewsgroup}, @samp{SelectArticle}, or
X@samp{ExpandSubject}.@refill
X
XThe following example is the default window configuration:
X
X@example
X(setq gnus-window-configuration
X      '((SelectNewsgroup (0 1 0))
X        (ExitNewsgroup   (1 0 0))
X        (SelectArticle   (0 3 10))
X        (ExpandSubject   (0 1 0))))
X@end example
X
XThe following is an exmaple of yet another two windows mode.  Article
Xbuffer is always displayed on a screen.  This is useful on a slow
Xterminal.
X
X@example
X(setq gnus-window-configuration
X      '((SelectNewsgroup (0 1 3))
X        (ExitNewsgroup   (1 0 3))
X        (SelectArticle   (0 1 3))
X        (ExpandSubject   (0 1 0))))
X@end example
X
XThe following is an example of three windows mode.  Three buffers are
Xalways displayed on a screen.  This is also useful on a slow terminal.
X
X@example
X(setq gnus-window-configuration
X      '((SelectNewsgroup (1 1 3))
X        (ExitNewsgroup   (1 1 3))
X        (SelectArticle   (1 1 3))
X        (ExpandSubject   (1 4 0))))
X@end example
X
X@vindex gnus-large-newsgroup
X@cindex large newsgroup
X@item gnus-large-newsgroup
X
XSpecifies the number of the articles which indicates a large newsgroup.
XIf the number of articles in a newsgroup is greater than this value, the
Xnumber of articles to be selected is asked for.  If the given value
X@var{n} is positive, the last @var{n} articles are selected.  If @var{n}
Xis negative, the first @var{n} articles are selected.  An empty string
Xmeans to select all articles.@refill
X
X@vindex gnus-author-copy
X@vindex AUTHORCOPY
X@cindex post articles
X@item gnus-author-copy
X
X@cindex FCC field
XSpecifies a file name saving a copy of an article posted using
X@samp{FCC:} field.  The variable is initialized from the
X@code{AUTHORCOPY} environment variable.  The specified file name is
Xinserted in @samp{FCC:} field, so you have a chance to change the file
Xname or disable saving a copy by editing this field.@refill
X
X@cindex Unix mailbox
X@cindex MH folder
X@pindex MH
XThe article is appended to the specified file in Unix mailbox format.
XInstead, if the first character of the value is @code{`|'}, the contents
Xof the article is piped out to a program specified by the rest of the
Xvalue.  For example, articles can be saved in an MH folder by the
Xfollowing:@refill
X
X@pindex rcvstore
X@example
X(setq gnus-author-copy 
X      "|/usr/local/lib/mh/rcvstore +Article")
X@end example
X
X@vindex gnus-use-long-file-name
X@item gnus-use-long-file-name
X
XNon-@code{nil} means that a newsgroup name is used as a default file
Xname to save articles to.  If it is @code{nil}, the directory form of a
Xnewsgroup name is used instead.@refill
X
X@vindex gnus-mail-save-name
X@vindex gnus-rmail-save-name
X@vindex gnus-folder-save-name
X@vindex gnus-file-save-name
X@cindex save articles
X@item gnus-mail-save-name
X@itemx gnus-rmail-save-name
X@itemx gnus-folder-save-name
X@itemx gnus-file-save-name
X
X@findex nntp-header-@var{field}
X@findex gnus-header-@var{field}
XSpecifies a function generating a file name to save articles to.  The
Xfunction is called with @var{newsgroup}, @var{headers}, and optional
X@var{last-name}.  @var{Newsgroup} is a string representing the current
Xnewsgroup name.  @var{Headers} is a vector containing headers of the
Xcurrent article.  Macros and functions accessing contents of the
X@var{headers} are defined as @code{nntp-header-@var{field}} and
X@code{gnus-header-@var{field}}, respectively.  The following functions
Xare provided as file name generators by default:@refill
X
X@vindex gnus-use-long-file-name
X@table @code
X@item gnus-numeric-save-name
X@findex gnus-numeric-save-name
XReturn a file name like @samp{@var{news.group/number}} or
X@samp{@var{news/group/number}} according to the variable
X@code{gnus-use-long-file-name}.@refill
X
X@item gnus-Numeric-save-name
X@findex gnus-Numeric-save-name
XReturn a file name like @samp{@var{News.group/number}} or
X@samp{@var{news/group/number}} according to the variable
X@code{gnus-use-long-file-name}.@refill
X
X@item gnus-plain-save-name
X@findex gnus-plain-save-name
XReturn a file name like @samp{@var{news.group}} or
X@samp{@var{news/group}/news} according to the variable
X@code{gnus-use-long-file-name}.@refill
X
X@item gnus-Plain-save-name
X@findex gnus-Plain-save-name
XReturn a file name like @samp{@var{News.group}} or
X@samp{@var{news/group}/news} according to the variable
X@code{gnus-use-long-file-name}.@refill
X
X@item gnus-folder-save-name
X@findex gnus-folder-save-name
XReturn a folder name like @samp{+@var{news.group}} or
X@samp{+@var{news/group}} according to the variable
X@code{gnus-use-long-file-name}.@refill
X
X@item gnus-Folder-save-name
X@findex gnus-Folder-save-name
XReturn a folder name like @samp{+@var{News.group}} or
X@samp{+@var{news/group}} according to the variable
X@code{gnus-use-long-file-name}.@refill
X@end table
X
X@vindex gnus-default-article-saver
X@cindex save articles
X@item gnus-default-article-saver
X
X@findex gnus-Subject-save-article
XSpecifies a function to save articles in your favorite format using the
Xcommand @code{gnus-Subject-save-article}.  The function must be
Xinteractively funcallable.  In other words, it must be an Emacs command.
XThe functions currently provided are as follows:@refill
X
X@table @code
X@item gnus-Subject-save-in-mail
X@findex gnus-Subject-save-in-mail
X@cindex Unix mailbox
XSave articles in Unix mailbox format.
X
X@item gnus-Subject-save-in-rmail
X@findex gnus-Subject-save-in-rmail
X@cindex Rmail file
XSave articles in Rmail format.
X
X@item gnus-Subject-save-in-folder
X@findex gnus-Subject-save-in-folder
X@cindex MH folder
X@pindex MH
XSave articles in an MH folder.
X
X@item gnus-Subject-save-in-file
X@findex gnus-Subject-save-in-file
XSave articles in article format.
X@end table
X
X@vindex gnus-article-save-directory
X@vindex SAVEDIR
X@findex gnus-Subject-save-in-mail
X@findex gnus-Subject-save-in-rmail
X@findex gnus-Subject-save-in-file
X@cindex save articles
X@item gnus-article-save-directory
X
XSpecifies a directory name to save articles in using the commands
X@code{gnus-Subject-save-in-mail}, @code{gnus-Subject-save-in-rmail}, and
X@code{gnus-Subject-save-in-file}.  The variable is initialized from the
X@code{SAVEDIR} environment variable.  Its default value is
X@file{~/News}.@refill
X
X@vindex gnus-kill-file-name
X@cindex KILL file
X@item gnus-kill-file-name
X
XSpecifies a file name of KILL file (@pxref{KILL File}).  Its default
Xvalue is @file{KILL}.@refill
X
X@vindex gnus-default-distribution
X@cindex distribution
X@item gnus-default-distribution
X
XSpecifies a distribution inserted automatically when no distribution is
Xspecified.
X
X@vindex gnus-novice-user
X@item gnus-novice-user
X
XNon-@code{nil} means you are a novice to USENET.  If it is
Xnon-@code{nil}, verbose messages may be displayed or your confirmations
Xmay be required.@refill
X
X@vindex gnus-interactive-post
X@item gnus-interactive-post
X
XNon-@code{nil} means that newsgroup, subject, and distribution are asked
Xfor interactively when composing a new article.@refill
X
X@vindex gnus-user-login-name
X@vindex USER
X@vindex LOGNAME
X@cindex login name
X@item gnus-user-login-name
X
XSpecifies your login name.  The login name is got from the @code{USER}
Xand @code{LOGNAME} environment variables and the function
X@code{user-login-name}, if undefined.@refill
X
X@vindex gnus-user-full-name
X@vindex NAME
X@cindex user full name
X@cindex full name of user
X@item gnus-user-full-name
X
XSpecifies your full name.  The full name is got from the @code{NAME}
Xenvironment variable and the function @code{user-full-name}, if
Xundefined.@refill
X
X@vindex gnus-show-all-headers
X@item gnus-show-all-headers
X
XNon-@code{nil} means all headers of an article are shown.
X
X@vindex gnus-save-all-headers
X@cindex save articles
X@item gnus-save-all-headers
X
XNon-@code{nil} means all headers of an article are saved in a file.
X
X@vindex gnus-auto-select-first
X@item gnus-auto-select-first
X
XNon-@code{nil} means the first unread article is selected automatically
Xwhen a newsgroup is selected.  If you'd like to prevent automatic
Xselection of the first unread article in some newsgroups, set the
Xvariable to @code{nil} in the hook @code{gnus-Select-group-hook} or
X@code{gnus-Apply-kill-hook} (@pxref{Hooks}).@refill
X
X@vindex gnus-auto-select-next
X@item gnus-auto-select-next
X
XNon-@code{nil} means the next newsgroup is selected automatically at the
Xend of the newsgroup.  If the value is @code{t} and the next newsgroup is
Xempty (no unread articles), GNUS will exit Subject Mode and go back to
XGroup Mode.  If the value is neither @code{nil} nor @code{t}, GNUS won't
Xexit Subject Mode but will select the following unread newsgroup.  If
Xthe value is @samp{quietly}, the next unread newsgroup will be selected
Xwithout any confirmations.@refill
X
X@vindex gnus-auto-select-same
X@item gnus-auto-select-same
X
X@pindex rn
XNon-@code{nil} means an article with the same subject as the current
Xarticle is selected automatically like @samp{rn -S}.@refill
X
X@vindex gnus-auto-center-subject
X@item gnus-auto-center-subject
X
XNon-@code{nil} means that the cursor is always kept centered in the
XSubject Mode window.@refill
X
X@vindex gnus-break-pages
X@vindex gnus-more-message
X@vindex gnus-page-delimiter
X@cindex page break
X@cindex break into pages
X@item gnus-break-pages
X
XNon-@code{nil} means an article is broken into pages at page delimiters.
XThe page delimiter is specified by the variable
X@code{gnus-page-delimiter}.  A message shown at the end of pages is
Xspecified by the variable @code{gnus-more-message}.  This may not work
Xwith some versions of GNU Emacs earlier than version 18.50.@refill
X
X@vindex gnus-page-delimiter
X@cindex page break
X@cindex break into pages
X@item gnus-page-delimiter
X
XSpecifies regexp describing line-beginnings that separate pages of
Xarticles.  Its default value is @code{"^\^L"}.@refill
X
X@vindex gnus-more-message
X@cindex page break
X@cindex break into pages
X@item gnus-more-message
X
XSpecifies a message shown at the end of each page in page break mode.
XThe length of the message string must be shorter than or equal to that
Xof the page delimiter if GNU Emacs is earlier than version 18.52.
X
X@vindex gnus-digest-show-summary
X@cindex Rmail
X@cindex digest summary
X@cindex summary of digest
X@item gnus-digest-show-summary
X
X@findex gnus-Subject-rmail-digest
XNon-@code{nil} means that a summary of digest messages is shown when
Xreading a digest article using the command
X@code{gnus-Subject-rmail-digest}.@refill
X
X@vindex gnus-digest-separator
X@cindex digest separator
X@item gnus-digest-separator
X
X@findex gnus-Subject-next-digest
X@findex gnus-Subject-prev-digest
X@findex gnus-Subject-rmail-digest
XSpecifies a regexp which separates messages in a digest article.
XChanges to this variable only affect the commands
X@code{gnus-Subject-next-digest} and @code{gnus-Subject-prev-digest}, but
Xnot the command @code{gnus-Subject-rmail-digest}.@refill
X
X@vindex gnus-optional-headers
X@item gnus-optional-headers
X
X@findex nntp-header-@var{field}
X@findex gnus-header-@var{field}
XSpecifies a function which generates an optional string displayed in the
XSubject buffer.  The function is called with an article @var{headers},
Xand must return a string excluding @samp{[} and @samp{]}.  @var{Headers}
Xis a vector containing headers of the current article.  Macros and
Xfunctions accessing contents of the @var{headers} are defined as
X@code{nntp-header-@var{field}} and @code{gnus-header-@var{field}},
Xrespectively.@refill
X
XGNUS provides two functions as follows:
X
X@table @code
X@findex gnus-optional-lines-and-from
X@item gnus-optional-lines-and-from
XReturn a string like "@var{nnn}:@var{author}", where @var{nnn} is the
Xnumber of lines in an article and @var{author} is the name of the
Xauthor.@refill
X
X@findex gnus-optional-lines
X@item gnus-optional-lines
XReturn a string like "@var{nnn}", where @var{nnn} is the number of lines
Xin an article.@refill
X@end table
X
X@xref{Hooks}, to change optional headers according to selected
Xnewsgroups.@refill
X
X@vindex gnus-Info-directory
X@cindex Info
X@item gnus-Info-directory
X
X@vindex Info-directory
XSpecifies a directory where the GNUS Info file is placed.  It is not
Xnecessary to change this variable unless you install an Info file in a
SHAR_EOF
echo "End of part 9, continue with part 10"
echo "10" > s2_seq_.tmp
exit 0

bob@tut.cis.ohio-state.edu (Bob Sutterfield) (06/26/89)

#!/bin/sh
# this is part 10 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file gnus.texinfo continued
#
CurArch=10
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
     exit 1; fi
( read Scheck
  if test "$Scheck" != $CurArch
  then echo "Please unpack part $Scheck next!"
       exit 1;
  else exit 0; fi
) < s2_seq_.tmp || exit 1
sed 's/^X//' << 'SHAR_EOF' >> gnus.texinfo
Xdirectory different from the variable @code{Info-directory}.
X@xref{Texinfo Manual}, for more information.@refill
X
X@end table
X
X@node NNTP Variables, Spool Variables, Variables, Customization
X@appendixsec NNTP Specific Variables
X@cindex NNTP
X
X@table @code
X@vindex nntp-buggy-select
X@cindex select error
X@item nntp-buggy-select
X
XNon-@code{nil} means the select routine of your operating system is
Xbuggy.  GNUS may hang up while waiting for NNTP server responses.  The
Xproblem may be solved by setting the variable to @code{t}.  @xref{NNTP
XProblems}, for more information.@refill
X
X@vindex nntp-maximum-request
X@cindex large newsgroup
X@item nntp-maximum-request
X
XSpecifies the maximum number of requests to be sent to the NNTP server
Xat one time.  GNUS may hang up while retrieving headers of a large
Xnewsgroup because sending many requests to the NNTP server without
Xreading replies to them causes deadlock.  In this case, set the variable
Xto a lower number.  @xref{NNTP Problems}, for more information.@refill
X
X@vindex nntp-large-newsgroup
X@cindex large newsgroup
X@item nntp-large-newsgroup
X
XSpecifies the number of articles which indicates a large newsgroup.  If
Xthe number of articles is greater than the value, verbose messages will
Xbe shown to indicate the current status.@refill
X
X@vindex tcp-program-name
X@item tcp-program-name
X
X@pindex tcp.c
XSpecifies a program which establishes communications between Emacs and
Xthe NNTP server.  Its default value is @file{tcp} which is distributed as
X@file{tcp.c} with other files of GNUS (@pxref{Files of GNUS}).  If your
XEmacs has the function @code{open-network-stream}, there is no need to
Xdefine this variable.
X
X@end table
X
X@node Spool Variables, Directory Variables, NNTP Variables, Customization
X@appendixsec Local News Spool Specific Variables
X@cindex local news spool
X
X@table @code
X@vindex nnspool-inews-program
X@item nnspool-inews-program
X
X@vindex news-inews-program
X@pindex inews
XSpecifies a program to post news.  This is default to the variable
X@code{news-inews-program} which is default to @file{inews}.
X
X@vindex nnspool-inews-switches
X@item nnspool-inews-switches
X
X@findex nnspool-request-post
X@pindex inews
XSpecifies switches for the function @code{nnspool-request-post} to pass
Xto the command @file{inews} for posting news.  Its default value is
X@code{"-h"}.@refill
X
X@vindex nnspool-spool-directory
X@item nnspool-spool-directory
X
X@vindex news-path
XSpecifies a directory of a local news spool.  This is default to the
Xvariable @code{news-path} which is default to @file{/usr/spool/news}.
X
X@vindex nnspool-active-file
X@item nnspool-active-file
X
X@cindex active file
XSpecifies an active file of the Bnews system for a local news spool.
XIts default value is @file{/usr/lib/news/active}.@refill
X
X@vindex nnspool-history-file
X@item nnspool-history-file
X
X@cindex history file
XSpecifies a history file of the Bnews system for a local news spool.
XIts default value is @file{/usr/lib/news/history}.  Some machines may
Xnot have this file.  In this case, commands to refer to articles by
XMessage-IDs will not work at all (@pxref{Referencing Articles}).@refill
X
X@end table
X
X@node Directory Variables, Hooks, Spool Variables, Customization
X@appendixsec Private Directory Specific Variables
X@cindex private directory
X
X@table @code
X@vindex mhspool-list-directory-switches
X@item mhspool-list-directory-switches
X
X@findex mhspool-request-list
X@pindex ls
XSpecifies switches for the function @code{mhspool-request-list} to pass
Xto the command @file{ls} for getting file listings in a private
Xdirectory.  There should be one entry for each line.  Its default value
Xis @code{"-R"}.  Some machines may require the @code{"-R1"}
Xswitch.@refill
X
X@end table
X
X@node Hooks,, Directory Variables, Customization
X@appendixsec Function Hooks
X
X@table @code
X@vindex gnus-Group-mode-hook
X@item gnus-Group-mode-hook
X
XCalled with no arguments after initializing Group Mode if its value is
Xnon-@code{nil}.  This hook is intended to customize Group Mode only
Xonce.  It is possible to define or change the NNTP server as you like in
Xthis hook since the hook is called before GNUS is connected to an NNTP
Xserver.@refill
X
X@vindex gnus-Subject-mode-hook
X@item gnus-Subject-mode-hook
X
X@vindex case-fold-search
X@cindex case of text
XCalled with no arguments after initializing Subject Mode if its value is
Xnon-@code{nil}.  This hook is intended to customize Subject Mode only
Xonce.  All sorts of searches in Subject Mode normally ignore the case of
Xthe text they are searching through.  If you do not want to ignore the
Xcase, set the variable @code{case-fold-search} to @code{nil} in this
Xhook.@refill
X
X@findex gnus-Subject-next-group
X@findex gnus-Subject-prev-group
XThe following example shows how to assign the functions
X@code{gnus-Subject-next-group} and @code{gnus-Subject-prev-group} to
Xkeys in Subject Mode.@refill
X
X@example
X(setq gnus-Subject-mode-hook
X      '(lambda ()
X         (local-set-key "\C-cn" 'gnus-Subject-next-group)
X         (local-set-key "\C-cp" 'gnus-Subject-prev-group)))
X@end example
X
X@vindex gnus-Article-mode-hook
X@item gnus-Article-mode-hook
X
XCalled with no arguments after initializing Article Mode if its value is
Xnon-@code{nil}.  This hook is intended to customize Article Mode only
Xonce.@refill
X
X@cindex current time
X@cindex display current time
X@vindex global-mode-string
XDisplaying the current time in the mode line of buffers is disabled in
Xthe Article buffer and the Subject buffer to show information on the
Xcurrent newsgroup and the current article.  If you want to display the
Xcurrent time in the mode line of the Article buffer, make the variable
X@code{global-mode-string} no longer have a separate value in the buffer
Xas follows:@refill
X
X@example
X(setq gnus-Article-mode-hook
X      '(lambda ()
X         (kill-local-variable 'global-mode-string)))
X@end example
X
X@vindex gnus-Kill-file-mode-hook
X@item gnus-Kill-file-mode-hook
X
XCalled with no arguments after initializing KILL-File Mode if its
Xvalue is non-@code{nil}.
X
X@vindex gnus-Browse-killed-mode-hook
X@item gnus-Browse-killed-mode-hook
X
XCalled with no arguments after initializing Browse-Killed Mode if its
Xvalue is non-@code{nil}.
X
X@vindex gnus-Startup-hook
X@item gnus-Startup-hook
X
XCalled with no arguments after an NNTP server is successfully connected
Xto if its value is non-@code{nil}.  It is possible to change the behavior
Xof GNUS according to the server.@refill
X
X@vindex gnus-Group-prepare-hook
X@item gnus-Group-prepare-hook
X
XCalled with no arguments after a list of newsgroups is prepared in the
XNewsgroup buffer.  This hook is used for moving the point to the first
Xunread (non empty) newsgroup by default.  This hook can also be used for
Xmodifying the buffer.
X
XThe following example is the default hook definition:
X
X@example
X(setq gnus-Group-prepare-hook
X      '(lambda ()
X         ;; Move the point to the first unread newsgroup.
X         (goto-char (point-min))
X         (re-search-forward "^[ \t]+[1-9][0-9]*:" nil t)))
X@end example
X
X@vindex gnus-Subject-prepare-hook
X@item gnus-Subject-prepare-hook
X
XCalled with no arguments after list of subjects is prepared in the
XSubject buffer.  This hook is intended to modify the buffer.
X
X@vindex gnus-Article-prepare-hook
X@item gnus-Article-prepare-hook
X
XCalled with no arguments after an article is prepared in the Article
Xbuffer.  This hook is intended to modify the buffer.  For example, kanji
Xcode conversion or un-ROT13-ing can be done in this hook.
X
X@vindex gnus-Select-group-hook
X@item gnus-Select-group-hook
X
XCalled with no arguments when a newsgroup is selected.  This hook is
Xintended to change the behavior of GNUS according to the selected
Xnewsgroup.
X
X@cindex sort headers
XThe following is an example of sorting the headers listed in the Subject
Xbuffer by date and then by subject.  Preceding @samp{Re:} of subjects is
Xignored while comparing subjects.@refill
X
X@findex gnus-sort-headers
X@findex gnus-date-lessp
X@findex gnus-string-lessp
X@findex gnus-header-date
X@findex gnus-header-subject
X@findex gnus-simplify-subject
X@example
X(setq gnus-Select-group-hook
X      '(lambda ()
X         ;; First of all, sort by date.
X         (gnus-sort-headers
X          '(lambda (a b)
X             (gnus-date-lessp (gnus-header-date a)
X                              (gnus-header-date b))))
X         ;; Then sort by subject ignoring `Re:'.
X         (gnus-sort-headers
X          '(lambda (a b)
X             (gnus-string-lessp 
X              (gnus-simplify-subject
X               (gnus-header-subject a) 're-only)
X              (gnus-simplify-subject
X               (gnus-header-subject b) 're-only)
X              )))))
X@end example
X
X@cindex simplify subjects
XThe following is an example of simplifying subjects like the
X@code{gnus-Subject-next-same-subject} command does:@refill
X
X@findex nntp-set-header-subject
X@findex gnus-simplify-subject
X@findex gnus-header-subject
X@vindex gnus-newsgroup-headers (Internal)
X@example
X(setq gnus-Select-group-hook
X      '(lambda ()
X         (mapcar (function
X                  (lambda (header)
X                    (nntp-set-header-subject
X                     header
X                     (gnus-simplify-subject
X                      (gnus-header-subject header) 're-only))))
X                 gnus-newsgroup-headers)))
X@end example
X
XIn some newsgroups, author names are meaningless.  It is possible to
Xprevent listing author names in the Subject buffer as follows:
X
X@vindex gnus-optional-headers
X@vindex gnus-newsgroup-name (Internal)
X@findex gnus-optional-lines
X@findex gnus-optional-lines-and-from
X@example
X(setq gnus-Select-group-hook
X      '(lambda ()
X         (cond ((string-equal "comp.sources.unix"
X                              gnus-newsgroup-name)
X                (setq gnus-optional-headers
X                      (function gnus-optional-lines)))
X               (t
X                (setq gnus-optional-headers
X                      (function
X                         gnus-optional-lines-and-from))))))
X@end example
X
X@vindex gnus-Select-article-hook
X@item gnus-Select-article-hook
X
XCalled with no arguments when an article is selected if its value is
Xnon-@code{nil}.@refill
X
X@cindex Rmail
X@cindex digest articles
XIt is possible to run Rmail on a digest article automatically as
Xfollows:
X
X@vindex gnus-newsgroup-name (Internal)
X@vindex gnus-current-headers (Internal)
X@findex gnus-header-subject
X@findex gnus-Subject-rmail-digest
X@example
X(setq gnus-Select-article-hook
X      '(lambda ()
X         (cond ((string-equal "comp.sys.sun"
X                              gnus-newsgroup-name)
X                (gnus-Subject-rmail-digest))
X               ((and (string-equal "comp.text"
X                                   gnus-newsgroup-name)
X                     (string-match "^TeXhax Digest"
X                                   (gnus-header-subject
X                                      gnus-current-headers)))
X                (gnus-Subject-rmail-digest)
X                ))))
X@end example
X
X@vindex gnus-Select-digest-hook
X@cindex Rmail
X@cindex digest articles
X@item gnus-Select-digest-hook
X
XCalled with no arguments when reading digest messages using Rmail if its
Xvalue is non-@code{nil}.  This hook is intended to modify an article so
Xthat Rmail can work with it.  @xref{Digest Articles}, for more
Xinformation on digest articles.@refill
X
X@cindex incomplete digest articles
XThe following example is the default hook definition to modify
Xincomplete digest articles:
X
X@findex mail-position-on-field
X@findex gnus-fetch-field
X@example
X(setq gnus-Select-digest-hook
X      '(lambda ()
X         ;; Reply-To: is required by
X         ;; `undigestify-rmail-message'.
X         (or (mail-position-on-field "Reply-to" t)
X             (progn
X               (mail-position-on-field "Reply-to")
X               (insert (gnus-fetch-field "From"))))))
X@end example
X
X@vindex gnus-Rmail-digest-hook
X@cindex Rmail
X@cindex digest articles
X@item gnus-Rmail-digest-hook
X
XCalled with no arguments when reading digest messages using Rmail if its
Xvalue is non-@code{nil}.  This hook is intended to customize Rmail Mode
Xfor reading digest articles.@refill
X
X@vindex gnus-Apply-kill-hook
X@cindex KILL file
X@item gnus-Apply-kill-hook
X
XCalled with no arguments when a newsgroup is selected and the Subject
Xbuffer is prepared if its value is non-@code{nil}.  This hook is intended
Xto apply KILL files to the selected newsgroup.  It is set to the
Xfunction @code{gnus-apply-kill-file} by default.@refill
X
XSince a general KILL file is too heavy to use only for a few newsgroups,
Xa lighter hook function is recommended.  For example, if you'd like to
Xapply kills to articles which contain the string @samp{rmgroup} in
Xsubject in newsgroup @samp{control}, you can use the following
Xhook:@refill
X
X@findex gnus-kill
X@vindex gnus-newsgroup-name (Internal)
X@example
X(setq gnus-Apply-kill-hook
X      '(lambda ()
X         (cond ((string-match "control" gnus-newsgroup-name)
X                (gnus-kill "Subject" "rmgroup")
X                (gnus-expunge "X")))))
X@end example
X
X@xref{KILL File}, for more information on KILL files.@refill
X
X@vindex gnus-Mark-article-hook
X@cindex article marks
X@cindex mark articles
X@item gnus-Mark-article-hook
X
XCalled with no arguments when an article is selected for the first time
Xif its value is non-@code{nil}.  The hook is intended to mark an article
Xas read (or unread) automatically when it is selected.@refill
X
XThe following example is the default definition of the hook:
X
X@vindex gnus-current-article (Internal)
X@vindex gnus-newsgroup-marked (Internal)
X@vindex gnus-current-article (Internal)
X@findex gnus-Subject-mark-as-read
X@findex gnus-Subject-set-current-mark
X@example
X(setq gnus-Mark-article-hook
X      '(lambda ()
X         ;; Mark the selected article as read.
X         (or (memq gnus-current-article gnus-newsgroup-marked)
X             (gnus-Subject-mark-as-read gnus-current-article))
X         ;; Put "+" on the current subject.
X         (gnus-Subject-set-current-mark "+")
X         ))
X@end example
X
XIt is possible to mark as unread (@samp{-}) instead when an article is
Xselected as follows:@refill
X
X@vindex gnus-current-article (Internal)
X@findex gnus-Subject-mark-as-unread
X@findex gnus-Subject-set-current-mark
X@example
X(setq gnus-Mark-article-hook
X      '(lambda ()
X         ;; Mark the selected article as unread.
X         (gnus-Subject-mark-as-unread gnus-current-article)
X         ;; Put "+" on the current subject.
X         (gnus-Subject-set-current-mark "+")
X         ))
X@end example
X
X@vindex gnus-Inews-article-hook
X@cindex post articles
X@item gnus-Inews-article-hook
X
X@pindex inews
XCalled with no arguments before posting an article if its value is
Xnon-@code{nil}.  This hook is called just before sending an article to
Xthe NNTP server or calling the @file{inews} program, while the hook
X@code{news-inews-hook} is called before preparing article headers.  This
Xhook is intended to run special encoding programs such as kanji code
Xconversion on the article.@refill
X
X@vindex gnus-Exit-group-hook
X@item gnus-Exit-group-hook
X
X@vindex gnus-newsgroup-headers (Internal)
X@cindex cross-references
X@cindex disable cross-references
X@cindex Xref field
XCalled with no arguments when exiting the current newsgroup if its value
Xis non-@code{nil}.  If your machine is so slow that exiting from Subject
XMode takes a long time, you can inhibit marking articles as read by
Xusing cross-reference information in the @samp{Xref:} field by setting
Xthe variable @code{gnus-newsgroup-headers} to @code{nil} in this
Xhook.@refill
X
X@vindex gnus-Exit-gnus-hook
X@item gnus-Exit-gnus-hook
X
XCalled with no arguments when exiting GNUS if its value is
Xnon-@code{nil}.  If you want to clear out Emacs buffers which were
Xcreated by GNUS and remain afterwards, you can use this hook.@refill
X
XThe following example shows how to kill a buffer which was used for
Xposting news.@refill
X
X@example
X(setq gnus-Exit-gnus-hook
X      '(lambda ()
X         ;; Kill a buffer used for posting news.
X         (and (get-buffer "*post-news*")
X              (kill-buffer "*post-news*"))))
X@end example
X
X@vindex gnus-Suspend-gnus-hook
X@item gnus-Suspend-gnus-hook
X
XCalled with no arguments when suspending GNUS if its value is
Xnon-@code{nil}.  The purpose is the same as the hook
X@code{gnus-Exit-gnus-hook}.@refill
X
X@vindex gnus-Save-newsrc-hook
X@cindex startup file
X@cindex .newsrc
X@item gnus-Save-newsrc-hook
X
XCalled with no arguments before saving the startup file @file{.newsrc}
Xif its value is non-@code{nil}.  This hook is intended to change the way
Xof backing up the startup file.@refill
X
X@vindex nntp-server-hook
X@vindex nntp-server-name
X@cindex NNTP server
X@item nntp-server-hook
X
XCalled with no arguments when the connection between Emacs and the NNTP
Xserver is established if its value is non-@code{nil}.  This hook is
Xintended to change the kanji code of a buffer associated with the
Xstream.  Use the variable @code{nntp-server-name} to refer to the name
Xof the NNTP server in this hook.  @xref{Kanji Handling}, for more
Xinformation.@refill
X
X@end table
X
X@node Problems, Reporting Bugs, Customization, Top
X@appendix Troubleshooting
X
X  Some common problems and their solutions are described.  If you have
Xany other problems which are not described here and cannot solve them by
Xyourself, @pxref{Reporting Bugs}.@refill
X
X@menu
X* NNTP Problems::       Problems with NNTP.
X* Kanji Handling::      Problems with kanji handling.
X* Preloading::          Problems with preloading GNUS.
X@end menu
X
X@node NNTP Problems, Kanji Handling, Problems, Problems
X@appendixsec NNTP Problems
X@cindex NNTP
X@cindex hang up
X@cindex deadlock
X@appendixsubsec Infinite Loop Caused by Buggy Select Routine
X@cindex select error
X
X@vindex nntp-buggy-select
X@cindex select error
X  Emacs may hang up while waiting for NNTP server responses.  This may
Xbe caused by a buggy select routine of your operating system.  If so,
Xthe problem may be solved by using source codes of @file{nntp.el}
Xinstead of byte-compiled codes.  If you still have problems with it, set
Xthe variable @code{nntp-buggy-select} to @code{t}.@refill
X
X@appendixsubsec Deadlock Caused by Packet Overflow
X@cindex packet overflow
X
X@vindex nntp-maximum-request
X@cindex large newsgroup
X  Emacs may hang up while retrieving headers of a large newsgroup.  The
Xreason is that too many requests have been sent to the NNTP server
Xwithout reading replies to them.  This causes a deadlock of Emacs and
Xthe server.  In this case, the number of requests sent to the server at
Xone time must be reduced.  Set the variable @code{nntp-maximum-request}
Xto a lower value than the default.  The optimal value depends on your
Xcomputing environment.@refill
X
X@node Kanji Handling, Preloading, NNTP Problems, Problems
X@appendixsec Kanji Handling
X@cindex kanji handling
X@cindex Japanese
X
X@ifinfo
X  Kanji handling scheme is different in each implementation of Japanese
XGNU Emacs.  Moreover, in some case the scheme may be different in each
Xversion of the same implementations.  Make sure which implementation and
Xversion you are using.
X@end ifinfo
X
X@menu
X* NEmacs2::             Kanji handling in NEmacs 2.1.
X* NEmacs3::             Kanji handling in NEmacs 3.0.
X* SX/A Emacs::          Kanji handling in SX/A Emacs.
X@end menu
X
X@node NEmacs2, NEmacs3, Kanji Handling, Kanji Handling
X@appendixsubsec Kanji Handling In NEmacs 2.1
X@cindex NEmacs 2.1
X
X@vindex nntp-server-hook
X  If the kanji code of articles stored in the NNTP server is different
Xfrom your standard file kanji code, the correct kanji code of the buffer
Xassociated with the NNTP stream must be specified using the hook
X@code{nntp-server-hook} as follows:@refill
X
X@cindex EUC
X@example
X(setq nntp-server-hook
X      '(lambda ()
X         ;; Server's Kanji code is EUC (NEmacs hack).
X         (make-local-variable 'kanji-fileio-code)
X         (setq kanji-fileio-code 0)))
X@end example
X
X@cindex local news spool
X@noindent
XIf you use a local news spool in stead of NNTP, the following additional
Xhook is required to post an article in the correct kanji code in any
Xcase:
X
X@example
X(setq gnus-Inews-article-hook
X      '(lambda ()
X         (save-excursion
X           (set-buffer nntp-server-buffer)
X           (make-local-variable 'kanji-fileio-code)
X           (setq kanji-fileio-code 0)   ;EUC
X           )))
X@end example
X
X@vindex nntp-server-name
X  The variable @code{nntp-server-name} is a buffer local variable
Xholding a host name running an NNTP server.  Use this variable to change
Xthe kanji code according to the server.  The following example shows how
Xto change the kanji code using this variable.@refill
X
X@cindex EUC
X@cindex JIS
X@cindex SJIS
X@example
X(setq nntp-server-hook
X      '(lambda ()
X         (make-local-variable 'kanji-fileio-code)
X         (cond ((string-equal nntp-server-name "foo")
X                (setq kanji-fileio-code 0)) ;EUC
X               ((string-equal nntp-server-name "bar")
X                (setq kanji-fileio-code 1)) ;Shift-JIS
X               (t
X                (setq kanji-fileio-code 2)) ;JIS
X               )))
X@end example
X
X@node NEmacs3, SX/A Emacs, NEmacs2, Kanji Handling
X@appendixsubsec Kanji Handling In NEmacs 3.0
X@cindex NEmacs 3.0
X
X  I have no experiences with NEmacs 3.0.  So, the following description
Xmay be wrong.  If you find any mistakes, please let the author know
X(@pxref{Reporting Bugs}).@refill
X
X@findex define-service-kanji-code
X  In NEmacs 3.0, the kanji code of articles stored in the NNTP must be
Xspecified according to both the service name (or number) and the host
Xname running the server.  For this, the function
X@code{define-service-kanji-code} is provided.@refill
X
X  The following example specifies the kanji code of the host @samp{flab}
Xas JIS using the function:@refill
X
X@example
X(define-service-kanji-code "nntp" "flab" 2)      ;2 stands for JIS.
X@end example
X
X@node SX/A Emacs,, NEmacs3, Kanji Handling
X@appendixsubsec Kanji Handling In SX/A Emacs
X@cindex SX/A Emacs
X
X@vindex gnus-Article-prepare-hook
X@vindex gnus-Inews-article-hook
X  If the kanji code of articles stored in the NNTP server is not EUC, it
Xmust be converted to EUC in an Emacs buffer after being read into the
Xbuffer.  The kanji code of articles being posted must be also converted
Xto the server specific kanji code in an Emacs buffer before actually
Xbeing sent to the server.  The following examples show how to do these
Xusing hooks:@refill
X
X@cindex EUC
X@cindex JIS
X@example
X(setq gnus-Article-prepare-hook
X      '(lambda ()
X         (call-process-region (point-min) (point-max)
X                              "nkf" t t nil "-e" ;-e stands for EUC.
X                              )))
X(setq gnus-Inews-article-hook
X      '(lambda ()
X         (call-process-region (point-min) (point-max)
X                              "nkf" t t nil "-j" ;-j stands for JIS.
X                              )))
X@end example
X
X@pindex nkf
X@noindent
XIn this example, @file{nkf} (Network Kanji Filter) is used as a kanji
Xcode converter, and the kanji code of the NNTP server is JIS.@refill
X
X@node Preloading,, Kanji Handling, Problems
X@appendixsec Preloading GNUS
X@cindex preload GNUS
X
X@pindex gnus.el
X@vindex gnus-nntp-server
X@vindex gnus-author-copy
X@vindex gnus-article-save-directory
X  Basically, GNUS is not designed to be preloaded.  For instance, if you
Xpreload @file{gnus.el}, some user variables which are initialized from
Xenvironment variables may be improperly initialized according to your
Xenvironment definitions.  The variables @code{gnus-nntp-server},
X@code{gnus-author-copy}, and @code{gnus-article-save-directory} are such
Xvariables.@refill
X
X  To prevent GNUS from being initialized from your definitions, you
Xshould @code{unsetenv} related environment variables before preloading
XGNUS, or set the variables to @code{nil} after loading GNUS.@refill
X
X@node Reporting Bugs, Key Index, Problems, Top
X@appendix Reporting Bugs
X@appendixsec Mailing Lists and USENET Newsgroup
X@cindex mailing list
X@cindex info-gnus
X@cindex info-gnus-english
X@cindex gnu.emacs.gnus
X
X  There are two mailing lists and one USENET newsgroup for discussing
XGNUS related topics.  These are intended for exchanging useful
Xinformation about GNUS, such as bug reports, useful hooks, and
Xextensions of GNUS.  If you have any questions or problems, feel free to
Xask about them.  Suggestions are also welcome.@refill
X
X@table @code
X@item gnu.emacs.gnus
X
XThis is a USENET newsgroup under the gnu.all hierarchy which is
Xconcerned with the GNU Project of the Free Software Foundation.@refill
X
X@item info-gnus-english@@tut.cis.ohio-state.edu
X
XThis is an Internet mailing list which is gated bi-directionally with
Xthe gnu.emacs.gnus newsgroup.  English is the official language of the
Xlist.  Please send subscription requests to:@refill
X
X@display
Xinfo-gnus-english-request@@tut.cis.ohio-state.edu
X@end display
X
X@item info-gnus@@flab.Fujitsu.CO.JP
X
XThis is a JUNET mailing list.  Messages of info-gnus-english and
Xgnu.emacs.gnus are forwarded to this list.  English and Japanese are the
Xofficial languages of the list.  Please send subscription requests
Xto:@refill
X
X@display
Xinfo-gnus-request@@flab.Fujitsu.CO.JP
X@end display
X@end table
X
X  The major difference between info-gnus-english/gnu.emacs.gnus and
Xinfo-gnus is the official language.  There is no need to subscribe to
Xinfo-gnus if you cannot read messages written in Japanese since most
Xdiscussions and important announcements will be sent to
Xinfo-gnus-english.@refill
X
X@appendixsec How to Report a Bug
X@cindex report a bug
X@cindex bug report
X
X  If you find a bug, it is important to report it and to report it in a
Xway which is useful.  If it is a bug of a lisp program, what is the most
Xuseful is an exact backtrace information of the lisp program with the
Xversion number of GNUS that you are using.@refill
X
X  To make the backtrace information, you must set the Emacs variable
X@code{debug-on-error} to @code{t} before the error happens.  A backtrace
Xobtained from a byte-compiled lisp program is not usually
Xunderstandable.  To make a human readable backtrace, load the source
Xprogram which is not byte-compiled yet and then produce the
Xerror.@refill
X
X  @inforef{Bugs, Reporting Bugs, emacs}, for more information.
X
X@node Key Index, Command Index, Reporting Bugs, Top
X@unnumbered Key (Character) Index
X@printindex ky
X
X@node Command Index, Variable Index, Key Index, Top
X@unnumbered Command and Function Index
X@printindex fn
X
X@node Variable Index, Program Index, Command Index, Top
X@unnumbered Variable Index
X@printindex vr
X
X@node Program Index, Concept Index, Variable Index, Top
X@unnumbered Program Index
X@printindex pg
X
X@node Concept Index,, Program Index, Top
X@unnumbered Concept Index
X@printindex cp
X
X@summarycontents
X@contents
X@bye
X
X
X@c Local Variables:
X@c outline-regexp: "@chap\\|@\\(sub\\)*section\\|@appendix \\|@appendix\\(sub\\)*sec\\|\^L"
X@c End:
SHAR_EOF
chmod 0644 gnus.texinfo || echo "restore of gnus.texinfo fails"
set `wc -c gnus.texinfo`;Sum=$1
if test "$Sum" != "143196"
then echo original size 143196, current size $Sum;fi
rm -f s2_seq_.tmp
echo "You have unpacked the last part"
exit 0