changeset 2843:cd90d49526ae

Version 3.15 from Umeda.
author Richard M. Stallman <rms@gnu.org>
date Sun, 16 May 1993 22:58:52 +0000
parents b002f2c288d3
children 086fda6b2041
files lisp/=gnus.el lisp/=gnusmail.el lisp/=gnusmisc.el lisp/=gnuspost.el lisp/=mhspool.el lisp/=nnspool.el lisp/=nntp.el
diffstat 7 files changed, 3123 insertions(+), 1880 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/=gnus.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=gnus.el	Sun May 16 22:58:52 1993 +0000
@@ -1,9 +1,6 @@
-;;; gnus.el --- GNUS: an NNTP-based News Reader for GNU Emacs
-
-;; Copyright (C) 1987, 1988, 1989, 1990 Free Software Foundation, Inc.
-
-;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
-;; Keywords: news
+;;; GNUS: an NNTP-based News Reader for GNU Emacs
+;; Copyright (C) 1987, 1988, 1989, 1990, 1993 Free Software Foundation, Inc.
+;; $Header: gnus.el,v 3.15 93/05/10 19:49:20 umerin Locked $
 
 ;; This file is part of GNU Emacs.
 
@@ -23,6 +20,67 @@
 
 ;;; Commentary:
 
+;; How to Install GNUS:
+;; (0) First of all, remove GNUS related OLD *.elc files (at least
+;;     nntp.elc).
+;; (1) Unshar gnus.el, gnuspost.el, gnusmail.el, gnusmisc.el, and
+;;     nntp.el.
+;; (2) byte-compile-file nntp.el, gnus.el, gnuspost.el, gnusmail.el,
+;;     and gnusmisc.el.  If you have a local news spool,
+;;     byte-compile-file nnspool.el, too.
+;; (3) Define three environment variables in .login file as follows:
+;;
+;;     setenv	NNTPSERVER	flab
+;;     setenv	DOMAINNAME	"stars.flab.Fujitsu.CO.JP"
+;;     setenv	ORGANIZATION	"Fujitsu Laboratories Ltd., Kawasaki, Japan."
+;;
+;;     Or instead, define lisp variables in your .emacs, site-init.el,
+;;     or default.el as follows:
+;;
+;;     (setq gnus-nntp-server "flab")
+;;     (setq gnus-local-domain "stars.flab.Fujitsu.CO.JP")
+;;     (setq gnus-local-organization "Fujitsu Laboratories Ltd., ...")
+;;
+;;     If the function (system-name) returns the full internet name,
+;;     you don't have to define the domain.
+;;
+;; (4) You may have to define NNTP service name as number 119.
+;;
+;;     (setq gnus-nntp-service 119)
+;;
+;;     Or, if you'd like to use a local news spool directly in stead
+;;     of NNTP, install nnspool.el and set the variable to nil as
+;;     follows:
+;;
+;;     (setq gnus-nntp-service nil)
+;;
+;; (5) If you'd like to use the GENERICFROM feature like the Bnews,
+;;     define the variable as follows:
+;;
+;;     (setq gnus-use-generic-from t)
+;;
+;; (6) Define autoload entries in .emacs file as follows:
+;;
+;;     (autoload 'gnus "gnus" "Read network news." t)
+;;     (autoload 'gnus-post-news "gnuspost" "Post a news." t)
+;;
+;; (7) Read nntp.el if you have problems with NNTP or kanji handling.
+;;
+;; (8) Install mhspool.el, tcp.el, and tcp.c if it is necessary.
+;;
+;;     mhspool.el is a package for reading articles or mail in your
+;;     private directory using GNUS.
+;;
+;;     tcp.el and tcp.c are necessary if and only if your Emacs does
+;;     not have the function `open-network-stream' which is used for
+;;     communicating with NNTP server inside Emacs.
+;;
+;; (9) Install an Info file generated from the texinfo manual gnus.texinfo.
+;;
+;;     If you are not allowed to create the Info file to the standard
+;;     Info-directory, create it in your private directory and set the
+;;     variable gnus-info-directory to that directory.
+
 ;; GNUS Mailing List:
 ;; There are two mailing lists for GNUS lovers in the world:
 ;;
@@ -51,29 +109,31 @@
 ;; (3) Multi-GNUS (Talking to many hosts same time).
 ;; (4) Asynchronous transmission of large messages.
 
-;;; Code:
-
+(provide 'gnus)
 (require 'nntp)
 (require 'mail-utils)
 
-(defvar gnus-nntp-server (or (getenv "NNTPSERVER")
-			     (and (boundp 'gnus-default-nntp-server)
-				  gnus-default-nntp-server))
-  "The name of the host running NNTP server.
+(defvar gnus-nntp-server (getenv "NNTPSERVER")
+  "*The name of the host running NNTP server.
 If it is a string such as `:DIRECTORY', the user's private DIRECTORY
 is used as a news spool.
 Initialized from the NNTPSERVER environment variable.")
 
 (defvar gnus-nntp-service "nntp"
-  "The name of the network service for GNUS to use.  Usually \"nntp\".")
+  "*NNTP service name (\"nntp\" or 119).
+Go to a local news spool if its value is nil.")
+
+(defvar gnus-startup-file "~/.newsrc"
+  "*Your .newsrc file. Use `.newsrc-SERVER' instead if exists.")
 
 (defvar gnus-signature-file "~/.signature"
   "*Your .signature file. Use `.signature-DISTRIBUTION' instead if exists.")
 
 (defvar gnus-use-cross-reference t
-  "Specifies what to do with cross references (Xref: field).
-If nil, ignore cross references.  If t, mark articles as read in subscribed
-newsgroups.  Otherwise, mark articles as read in all newsgroups.")
+  "*Specifies what to do with cross references (Xref: field).
+If nil, ignore cross references.  If t, mark articles as read in
+subscribed newsgroups.  Otherwise, if not nil nor t, mark articles as
+read in all newsgroups.")
 
 (defvar gnus-use-followup-to t
   "*Specifies what to do with Followup-To: field.
@@ -86,16 +146,16 @@
 confirmation is required for selecting the newsgroup.")
 
 (defvar gnus-author-copy (getenv "AUTHORCOPY")
-  "*Filename for saving a copy of an article posted using FCC: field.
+  "*File name saving a copy of an article posted using FCC: field.
 Initialized from the AUTHORCOPY environment variable.
 
 Articles are saved using a function specified by the the variable
-`gnus-author-copy-saver' (`rmail-output' is the default) if a file name
-is given.  Instead, if the first character of the name is `|', the
-contents of the article is piped out to the named program.  It is
+gnus-author-copy-saver (rmail-output is default) if a file name is
+given.  Instead, if the first character of the name is `|', the
+contents of the article is piped out to the named program. It is
 possible to save an article in an MH folder as follows:
 
-    (setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")")
+(setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")")
 
 (defvar gnus-author-copy-saver (function rmail-output)
   "*A function called with a file name to save an author copy to.
@@ -103,73 +163,78 @@
 
 (defvar gnus-use-long-file-name
   (not (memq system-type '(usg-unix-v xenix)))
-  "Non-nil means that a newsgroup name is used as a default file name
-to save articles to.  If nil, the directory form of a newsgroup is
+  "*Non-nil means that a newsgroup name is used as a default file name
+to save articles to. If it's nil, the directory form of a newsgroup is
 used instead.")
 
 (defvar gnus-article-save-directory (getenv "SAVEDIR")
-  "*The directory in which to save articles; defaults to ~/News.
+  "*A directory name to save articles to (default to ~/News).
 Initialized from the SAVEDIR environment variable.")
 
-(defvar gnus-default-article-saver (function gnus-Subject-save-in-rmail)
-  "A function used to save articles in your favorite format.
+(defvar gnus-default-article-saver (function gnus-summary-save-in-rmail)
+  "*A function to save articles in your favorite format.
 The function must be interactively callable (in other words, it must
 be an Emacs command).
 
 GNUS provides the following functions:
-	gnus-Subject-save-in-rmail (in Rmail format)
-	gnus-Subject-save-in-mail (in Unix mail format)
-	gnus-Subject-save-in-folder (in an MH folder)
-	gnus-Subject-save-in-file (in article format).")
+	gnus-summary-save-in-rmail (in Rmail format)
+	gnus-summary-save-in-mail (in Unix mail format)
+	gnus-summary-save-in-folder (in an MH folder)
+	gnus-summary-save-in-file (in article format).")
 
 (defvar gnus-rmail-save-name (function gnus-plain-save-name)
-  "A function generating a file name to save articles in Rmail format.
+  "*A function generating a file name to save articles in Rmail format.
 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
 
 (defvar gnus-mail-save-name (function gnus-plain-save-name)
-  "A function generating a file name to save articles in Unix mail format.
+  "*A function generating a file name to save articles in Unix mail format.
 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
 
 (defvar gnus-folder-save-name (function gnus-folder-save-name)
-  "A function generating a file name to save articles in MH folder.
+  "*A function generating a file name to save articles in MH folder.
 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.")
 
 (defvar gnus-file-save-name (function gnus-numeric-save-name)
-  "A function generating a file name to save articles in article format.
+  "*A function generating a file name to save articles in article format.
 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
 
 (defvar gnus-kill-file-name "KILL"
-  "File name of a KILL file.")
-
-(defvar gnus-default-distribution "local"
-  "*Use this value as distribution if no distribution is specified.")
+  "*File name of a KILL file.")
 
 (defvar gnus-novice-user t
-  "*Non-nil means that you are a novice to USENET.
-If non-nil, verbose messages may be displayed or your confirmation
-may be required.")
+  "*Non-nil means that you are a novice to USENET.  If non-nil,
+verbose messages may be displayed or your confirmations may be required.")
+
+(defvar gnus-interactive-catchup t
+  "*Require your confirmation when catching up a newsgroup if non-nil.")
 
 (defvar gnus-interactive-post t
   "*Newsgroup, subject, and distribution will be asked for if non-nil.")
 
+(defvar gnus-interactive-exit t
+  "*Require your confirmation when exiting gnus if non-nil.")
+
 (defvar gnus-user-login-name nil
   "*The login name of the user.
-Uses USER and LOGNAME environment variables if undefined.")
+Got from the USER and LOGNAME environment variable if undefined.")
 
 (defvar gnus-user-full-name nil
   "*The full name of the user.
-Uses from the NAME environment variable if undefined.")
+Got from the NAME environment variable if undefined.")
+
+(defvar gnus-show-mime nil
+  "*Show MIME message if non-nil.")
 
 (defvar gnus-show-threads t
-  "*Show conversation threads in Subject Mode if non-nil.")
+  "*Show conversation threads in Summary Mode if non-nil.")
 
 (defvar gnus-thread-hide-subject t
   "*Non-nil means hide subjects for thread subtrees.")
 
 (defvar gnus-thread-hide-subtree nil
   "*Non-nil means hide thread subtrees initially.
-If non-nil, you have to run the command `gnus-Subject-show-thread' by
-hand or by using `gnus-Select-article-hook' to show hidden threads.")
+If non-nil, you have to run the command gnus-summary-show-thread by
+hand or by using gnus-select-article-hook to show hidden threads.")
 
 (defvar gnus-thread-hide-killed t
   "*Non-nil means hide killed thread subtrees automatically.")
@@ -179,36 +244,50 @@
 If it is non-nil, some commands work with subjects do not work properly.")
 
 (defvar gnus-thread-indent-level 4
-  "Indentation of thread subtrees.")
+  "*Indentation of thread subtrees.")
+
+(defvar gnus-ignored-newsgroups "^to\\..*$"
+  "*A regular expression used to ignore uninterested newsgroups in the active file.
+Any lines in the active file matching this regular expression are
+removed from the newsgroup list before anything else is done to it,
+thus making them effectively invisible.")
 
 (defvar gnus-ignored-headers
-  "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:\\|^In-Reply-To:"
-  "Regexp matching headers not to display in messages.")
+  "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:"
+  "*All random fields within the header of a message.")
+
+(defvar gnus-required-headers
+  '(From Date Newsgroups Subject Message-ID Path Organization Distribution)
+  "*All required fields for articles you post.
+RFC977 and RFC1036 require From, Date, Newsgroups, Subject, Message-ID
+and Path fields.  Organization, Distribution and Lines are optional.
+If you want GNUS not to insert some field, remove it from the
+variable.")
 
 (defvar gnus-show-all-headers nil
   "*Show all headers of an article if non-nil.")
 
-(defvar gnus-save-all-headers nil
+(defvar gnus-save-all-headers t
   "*Save all headers of an article if non-nil.")
 
 (defvar gnus-optional-headers (function gnus-optional-lines-and-from)
-  "A function generating a optional string displayed in GNUS Subject
+  "*A function generating a optional string displayed in GNUS Summary
 mode buffer.  The function is called with an article HEADER. The
 result must be a string excluding `[' and `]'.")
 
 (defvar gnus-auto-extend-newsgroup t
-  "*Extend visible articles to forward and backward if non-nil.")
+  "*Extend visible artciles to forward and backward if non-nil.")
 
 (defvar gnus-auto-select-first t
   "*Select the first unread article automagically if non-nil.
 If you want to prevent automatic selection of the first unread article
-in some newsgroups, set the variable to nil in `gnus-Select-group-hook'
-or `gnus-Apply-kill-hook'.")
+in some newsgroups, set the variable to nil in gnus-select-group-hook
+or gnus-apply-kill-hook.")
 
 (defvar gnus-auto-select-next t
   "*Select the next newsgroup automagically if non-nil.
 If the value is t and the next newsgroup is empty, GNUS will exit
-Subject mode and go back to Group mode.  If the value is neither nil
+Summary mode and go back to Group mode.  If the value is neither nil
 nor t, GNUS will select the following unread newsgroup. Especially, if
 the value is the symbol `quietly', the next unread newsgroup will be
 selected without any confirmations.")
@@ -216,8 +295,13 @@
 (defvar gnus-auto-select-same nil
   "*Select the next article with the same subject automagically if non-nil.")
 
-(defvar gnus-auto-center-subject t
-  "*Always center the current subject in GNUS Subject mode window if non-nil.")
+(defvar gnus-auto-center-summary t
+  "*Always center the current summary in GNUS Summary window if non-nil.")
+
+(defvar gnus-auto-mail-to-author nil
+  "*Insert `To: author' of the article when following up if non-nil.
+Mail is sent using the function specified by the variable
+gnus-mail-send-method.")
 
 (defvar gnus-break-pages t
   "*Break an article into pages if non-nil.
@@ -236,141 +320,166 @@
   "*Non-nil means to take up the entire screen of Emacs.")
 
 (defvar gnus-window-configuration
-  '((SelectNewsgroup (0 1 0))
-    (ExitNewsgroup   (1 0 0))
-    (SelectArticle   (0 3 10))
-    (ExpandSubject   (0 1 0)))
-  "Specify window configurations for each action.
-The format of the variable is a list of (ACTION (G S A)), where
-G, S, and A are the relative height of Group, Subject, and Article
-windows, respectively.  ACTION is `SelectNewsgroup', `ExitNewsgroup',
-`SelectArticle', or `ExpandSubject'.")
+  '((summary (0 1 0))
+    (newsgroups   (1 0 0))
+    (article   (0 3 10)))
+  "*Specify window configurations for each action.
+The format of the variable is a list of (ACTION (G S A)), where G, S,
+and A are the relative height of Group, Summary, and Article windows,
+respectively.  ACTION is `summary', `newsgroups', or `article'.")
+
+(defvar gnus-show-mime-method (function metamail-buffer)
+  "*Function to process a MIME message.
+The function is expected to process current buffer as a MIME message.")
 
 (defvar gnus-mail-reply-method
   (function gnus-mail-reply-using-mail)
-  "A function to compose reply mail.
-The function `gnus-mail-reply-using-mail' uses usual the sendmail mail
-program.  The function `gnus-mail-reply-using-mhe' uses the mh-e mail
+  "*Function to compose reply mail.
+The function gnus-mail-reply-using-mail uses usual sendmail mail
+program.  The function gnus-mail-reply-using-mhe uses mh-e mail
 program.  You can use yet another program by customizing this variable.")
 
+(defvar gnus-mail-forward-method
+  (function gnus-mail-forward-using-mail)
+  "*Function to forward current message to another user.
+The function gnus-mail-reply-using-mail uses usual sendmail mail
+program. You can use yet another program by customizing this variable.")
+
 (defvar gnus-mail-other-window-method
   (function gnus-mail-other-window-using-mail)
-  "A function to compose mail in other window.
-The function `gnus-mail-other-window-using-mail' uses usual sendmail
-mail program.  The function `gnus-mail-other-window-using-mhe' uses mh-e
+  "*Function to compose mail in other window.
+The function gnus-mail-other-window-using-mail uses usual sendmail
+mail program.  The function gnus-mail-other-window-using-mhe uses mh-e
 mail program.  You can use yet another program by customizing this variable.")
 
+(defvar gnus-mail-send-method send-mail-function
+  "*Function to mail a message too which is being posted as an article.
+The message must have To: or Cc: field.  The value of the variable
+send-mail-function is the default function which uses sendmail mail
+program.")
+
 (defvar gnus-subscribe-newsgroup-method
-  (function
-   (lambda (newsgroup)
-     (gnus-subscribe-newsgroup newsgroup
-			       (car (car gnus-newsrc-assoc)))))
-  "A function called with a newsgroup name when it is created.")
-
-(defvar gnus-Group-mode-hook nil
-  "A hook for GNUS Group Mode.")
-
-(defvar gnus-Subject-mode-hook nil
-  "A hook for GNUS Subject Mode.")
-
-(defvar gnus-Article-mode-hook nil
-  "A hook for GNUS Article Mode.")
-
-(defvar gnus-Kill-file-mode-hook nil
-  "A hook for GNUS KILL File Mode.")
-
-(defvar gnus-Open-server-hook nil
-  "A hook called just before opening connection to news server.")
-
-(defvar gnus-Startup-hook nil
-  "A hook called at start up time.
-This hook is called after GNUS is connected to the NNTP server.
-So, it is possible to change the behavior of GNUS according to the
-selected NNTP server.")
-
-(defvar gnus-Group-prepare-hook nil
-  "A hook called after newsgroup list is created in the Newsgroup buffer.
+  (function gnus-subscribe-alphabetically)
+  "*Function called with a newsgroup name when new newsgroup is found.
+The function gnus-subscribe-randomly inserts a new newsgroup a the
+beginning of newsgroups.  The function gnus-subscribe-alphabetically
+inserts it in strict alphabetic order.  The function
+gnus-subscribe-hierarchically inserts it in hierarchical newsgroup
+order.  The function gnus-subscribe-interactively asks for your decision.")
+
+(defvar gnus-group-mode-hook nil
+  "*A hook for GNUS Group Mode.")
+
+(defvar gnus-summary-mode-hook nil
+  "*A hook for GNUS Summary Mode.")
+
+(defvar gnus-article-mode-hook nil
+  "*A hook for GNUS Article Mode.")
+
+(defvar gnus-kill-file-mode-hook nil
+  "*A hook for GNUS KILL File Mode.")
+
+(defvar gnus-open-server-hook nil
+  "*A hook called just before opening connection to news server.")
+
+(defvar gnus-startup-hook nil
+  "*A hook called at start up time.
+This hook is called after GNUS is connected to the NNTP server. So, it
+is possible to change the behavior of GNUS according to the selected
+NNTP server.")
+
+(defvar gnus-group-prepare-hook nil
+  "*A hook called after newsgroup list is created in the Newsgroup buffer.
 If you want to modify the Newsgroup buffer, you can use this hook.")
 
-(defvar gnus-Subject-prepare-hook nil
-  "A hook called after subject list is created in the Subject buffer.
-If you want to modify the Subject buffer, you can use this hook.")
-
-(defvar gnus-Article-prepare-hook nil
-  "A hook called after an article is prepared in the Article buffer.
+(defvar gnus-summary-prepare-hook nil
+  "*A hook called after summary list is created in the Summary buffer.
+If you want to modify the Summary buffer, you can use this hook.")
+
+(defvar gnus-article-prepare-hook nil
+  "*A hook called after an article is prepared in the Article buffer.
 If you want to run a special decoding program like nkf, use this hook.")
 
-(defvar gnus-Select-group-hook nil
-  "A hook called when a newsgroup is selected.
-If you want to sort Subject buffer by date and then by subject, you
+(defvar gnus-select-group-hook nil
+  "*A hook called when a newsgroup is selected.
+If you want to sort Summary buffer by date and then by subject, you
 can use the following hook:
 
-(setq gnus-Select-group-hook
-      '(lambda ()
+(setq gnus-select-group-hook
+      (function
+       (lambda ()
 	 ;; First of all, sort by date.
-	 (gnus-sort-headers
-	  '(lambda (a b)
-	     (gnus-date-lessp (gnus-header-date a)
-			      (gnus-header-date b))))
+	 (gnus-keysort-headers
+	  (function string-lessp)
+	  (function
+	   (lambda (a)
+	     (gnus-sortable-date (gnus-header-date a)))))
 	 ;; Then sort by subject string ignoring `Re:'.
 	 ;; If case-fold-search is non-nil, case of letters is ignored.
-	 (gnus-sort-headers
-	  '(lambda (a b)
-	     (gnus-string-lessp
-	      (gnus-simplify-subject (gnus-header-subject a) 're)
-	      (gnus-simplify-subject (gnus-header-subject b) 're)
-	      )))))
-
-If you'd like to simplify subjects like the `gnus-Subject-next-same-subject'
-command does, you can use the following hook:
-
-(setq gnus-Select-group-hook
-      '(lambda ()
+	 (gnus-keysort-headers
+	  (function string-lessp)
+	  (function
+	   (lambda (a)
+	     (if case-fold-search
+		 (downcase (gnus-simplify-subject (gnus-header-subject a) t))
+	       (gnus-simplify-subject (gnus-header-subject a) t)))))
+	 )))
+
+If you'd like to simplify subjects like the
+`gnus-summary-next-same-subject' command does, you can use the
+following hook:
+
+(setq gnus-select-group-hook
+      (function
+       (lambda ()
 	 (mapcar (function
 		  (lambda (header)
 		    (nntp-set-header-subject
 		     header
 		     (gnus-simplify-subject
 		      (gnus-header-subject header) 're-only))))
-		 gnus-newsgroup-headers)))
-
-In some newsgroups author name is meaningless.  It is possible to
-prevent listing author names in the GNUS Subject buffer as follows:
-
-(setq gnus-Select-group-hook
-      '(lambda ()
+		 gnus-newsgroup-headers))))
+
+In some newsgroups author name is meaningless. It is possible to
+prevent listing author names in GNUS Summary buffer as follows:
+
+(setq gnus-select-group-hook
+      (function
+       (lambda ()
 	 (cond ((string-equal \"comp.sources.unix\" gnus-newsgroup-name)
 		(setq gnus-optional-headers
 		      (function gnus-optional-lines)))
 	       (t
 		(setq gnus-optional-headers
-		      (function gnus-optional-lines-and-from))))))")
-
-(defvar gnus-Select-article-hook
-  (function (lambda () (gnus-Subject-show-thread)))
-  "Hook called when an article is selected.
-The default hook automatically shows conversation thread subtrees
-of the selected article as follows:
-
-(setq gnus-Select-article-hook
-      '(lambda ()
-	 (gnus-Subject-show-thread)))
+		      (function gnus-optional-lines-and-from)))))))")
+
+(defvar gnus-select-article-hook
+  (function (lambda () (gnus-summary-show-thread)))
+  "*A hook called when an article is selected.
+The default hook shows conversation thread subtrees of the selected
+article automatically as follows:
+
+(setq gnus-select-article-hook
+      (function 
+       (lambda ()
+	 (gnus-summary-show-thread))))
 
 If you'd like to run RMAIL on a digest article automagically, you can
 use the following hook:
 
-(setq gnus-Select-article-hook
-      '(lambda ()
-	 (gnus-Subject-show-thread)
+(setq gnus-select-article-hook
+      (function
+       (lambda ()
+	 (gnus-summary-show-thread)
 	 (cond ((string-equal \"comp.sys.sun\" gnus-newsgroup-name)
-		(gnus-Subject-rmail-digest))
+		(gnus-summary-rmail-digest))
 	       ((and (string-equal \"comp.text\" gnus-newsgroup-name)
 		     (string-match \"^TeXhax Digest\"
 				   (gnus-header-subject gnus-current-headers)))
-		(gnus-Subject-rmail-digest)
-		))))")
-
-(defvar gnus-Select-digest-hook
+		(gnus-summary-rmail-digest)
+		)))))")
+
+(defvar gnus-select-digest-hook
   (function
    (lambda ()
      ;; Reply-To: is required by `undigestify-rmail-message'.
@@ -378,84 +487,109 @@
 	 (progn
 	   (mail-position-on-field "Reply-to")
 	   (insert (gnus-fetch-field "From"))))))
-  "A hook called when reading digest messages using Rmail.
+  "*A hook called when reading digest messages using Rmail.
 This hook can be used to modify incomplete digest articles as follows
 (this is the default):
 
-(setq gnus-Select-digest-hook
-      '(lambda ()
+(setq gnus-select-digest-hook
+      (function
+       (lambda ()
 	 ;; Reply-To: is required by `undigestify-rmail-message'.
 	 (or (mail-position-on-field \"Reply-to\" t)
 	     (progn
 	       (mail-position-on-field \"Reply-to\")
-	       (insert (gnus-fetch-field \"From\"))))))")
-
-(defvar gnus-Rmail-digest-hook nil
-  "A hook called when reading digest messages using Rmail.
+	       (insert (gnus-fetch-field \"From\")))))))")
+
+(defvar gnus-rmail-digest-hook nil
+  "*A hook called when reading digest messages using Rmail.
 This hook is intended to customize Rmail mode for reading digest articles.")
 
-(defvar gnus-Apply-kill-hook (function gnus-apply-kill-file)
-  "A hook called when a newsgroup is selected and subject list is prepared.
+(defvar gnus-apply-kill-hook (function gnus-apply-kill-file)
+  "*A hook called when a newsgroup is selected and summary list is prepared.
 This hook is intended to apply a KILL file to the selected newsgroup.
 The function `gnus-apply-kill-file' is called defaultly.
 
-Since a general KILL file is too heavy to use for only a few
-newsgroups, we recommend you use a lighter hook function.  For
+Since a general KILL file is too heavy to use only for a few
+newsgroups, I recommend you to use a lighter hook function. For
 example, if you'd like to apply a KILL file to articles which contains
 a string `rmgroup' in subject in newsgroup `control', you can use the
 following hook:
 
-(setq gnus-Apply-kill-hook
-      '(lambda ()
+(setq gnus-apply-kill-hook
+      (function
+       (lambda ()
 	 (cond ((string-match \"control\" gnus-newsgroup-name)
 		(gnus-kill \"Subject\" \"rmgroup\")
-		(gnus-expunge \"X\")))))")
-
-(defvar gnus-Mark-article-hook
+		(gnus-expunge \"X\"))))))")
+
+(defvar gnus-mark-article-hook
   (function
    (lambda ()
      (or (memq gnus-current-article gnus-newsgroup-marked)
-	 (gnus-Subject-mark-as-read gnus-current-article))
-     (gnus-Subject-set-current-mark "+")))
-  "A hook called when an article is selected for the first time.
-The hook is intended to mark an article as read when it is selected.
+	 (gnus-summary-mark-as-read gnus-current-article))
+     (gnus-summary-set-current-mark "+")))
+  "*A hook called when an article is selected at the first time.
+The hook is intended to mark an article as read (or unread)
+automatically when it is selected.
+
 If you'd like to mark as unread (-) instead, use the following hook:
 
-(setq gnus-Mark-article-hook
-      '(lambda ()
-	 (gnus-Subject-mark-as-unread gnus-current-article)
-	 (gnus-Subject-set-current-mark \"+\")))")
-
-(defvar gnus-Inews-article-hook nil
-  "A hook called before posting an article.
-If you'd like to run a special encoding program, use this hook.")
-
-(defvar gnus-Exit-group-hook nil
-  "A hook called when exiting (not quitting) Subject mode.
-If your machine is so slow that exiting from Subject mode takes a
-long time, set the variable `gnus-newsgroup-headers' to nil.  This
+(setq gnus-mark-article-hook
+      (function
+       (lambda ()
+	 (gnus-summary-mark-as-unread gnus-current-article)
+	 (gnus-summary-set-current-mark \"+\"))))")
+
+(defvar gnus-prepare-article-hook (function gnus-inews-insert-signature)
+  "*A hook called after preparing body, but before preparing header fields.
+The default hook (gnus-inews-insert-signature) inserts a signature
+file specified by the variable gnus-signature-file.")
+
+(defvar gnus-inews-article-hook (function gnus-inews-do-fcc)
+  "*A hook called before finally posting an article.
+The default hook (gnus-inews-do-fcc) does FCC processing (save article
+to a file).")
+
+(defvar gnus-exit-group-hook nil
+  "*A hook called when exiting (not quitting) Summary mode.
+If your machine is so slow that exiting from Summary mode takes very
+long time, set the variable gnus-use-cross-reference to nil. This
 inhibits marking articles as read using cross-reference information.")
 
-(defvar gnus-Suspend-gnus-hook nil
-  "A hook called when suspending (not exiting) GNUS.")
-
-(defvar gnus-Exit-gnus-hook nil
-  "A hook called when exiting (not suspending) GNUS.")
-
-(defvar gnus-Save-newsrc-hook nil
-  "A hook called when saving the newsrc file.
+(defvar gnus-suspend-gnus-hook nil
+  "*A hook called when suspending (not exiting) GNUS.")
+
+(defvar gnus-exit-gnus-hook nil
+  "*A hook called when exiting (not suspending) GNUS.")
+
+(defvar gnus-save-newsrc-hook nil
+  "*A hook called when saving the newsrc file.
 This hook is called before saving .newsrc file.")
 
-(defvar gnus-your-domain nil
-  "*Your domain name without your host name like: \"stars.flab.Fujitsu.CO.JP\"
-The environment variable DOMAINNAME is used instead if defined.  If
-the function `system-name' returns the full internet name, there is no
-need to define this variable.")
-
-(defvar gnus-your-organization nil
-  "*Your organization like: \"Fujitsu Laboratories Ltd., Kawasaki, Japan.\"
+
+;; Site dependent variables. You have to define these variables in
+;;  site-init.el, default.el or your .emacs.
+
+(defvar gnus-local-timezone nil
+  "*Local time zone. Both styles, \"JST\" and +0900 are acceptable.
+If its value is non-nil, valid Date: field will be generated in terms
+of RFC822.  In this case, timezone package must be installed.")
+
+(defvar gnus-local-domain nil
+  "*Local domain name without a host name like: \"stars.flab.Fujitsu.CO.JP\"
+The `DOMAINNAME' environment variable is used instead if defined.  If
+the function (system-name) returns the full internet name, there is no
+need to define the name.")
+
+(defvar gnus-local-organization nil
+  "*Local organization like: \"Fujitsu Laboratories Ltd., Kawasaki, Japan.\"
 The `ORGANIZATION' environment variable is used instead if defined.")
 
+(defvar gnus-local-distributions '("local" "world")
+  "*List of distributions.
+The first element in the list is used as default.  If distributions
+file is available, its content is also used.")
+
 (defvar gnus-use-generic-from nil
   "*If nil, prepend local host name to the defined domain in the From:
 field; if stringp, use this; if non-nil, strip of the local host name.")
@@ -463,62 +597,73 @@
 (defvar gnus-use-generic-path nil
   "*If nil, use the NNTP server name in the Path: field; if stringp,
 use this; if non-nil, use no host name (user name only)")
+
+(defvar gnus-info-directory Info-directory
+  "*A directory placing an Info file of GNUS.")
+
 
 ;; Internal variables.
 
-(defconst gnus-version "GNUS 3.13"
+(defconst gnus-version "GNUS 3.15"
   "Version numbers of this version of GNUS.")
 
-(defvar gnus-Info-nodes
-  '((gnus-Group-mode . "(gnus)Newsgroup Commands")
-    (gnus-Subject-mode . "(gnus)Subject Commands")
-    (gnus-Article-mode . "(gnus)Article Commands")
-    (gnus-Kill-file-mode . "(gnus)KILL File")
-    (gnus-Browse-killed-mode . "(gnus)Maintenance"))
+(defvar gnus-info-nodes
+  '((gnus-group-mode		"(gnus)Newsgroup Commands")
+    (gnus-summary-mode		"(gnus)Summary Commands")
+    (gnus-article-mode		"(gnus)Article Commands")
+    (gnus-kill-file-mode	"(gnus)KILL File")
+    (gnus-browse-killed-mode	"(gnus)Maintenance"))
   "Assoc list of major modes and related Info nodes.")
 
+;; Alist syntax is different from that of 3.14.3.
 (defvar gnus-access-methods
   '((nntp
-     (gnus-retrieve-headers .	nntp-retrieve-headers)
-     (gnus-open-server .	nntp-open-server)
-     (gnus-close-server .	nntp-close-server)
-     (gnus-server-opened .	nntp-server-opened)
-     (gnus-status-message .	nntp-status-message)
-     (gnus-request-article .	nntp-request-article)
-     (gnus-request-group .	nntp-request-group)
-     (gnus-request-list .	nntp-request-list)
-     (gnus-request-post .	nntp-request-post))
+     (gnus-retrieve-headers		nntp-retrieve-headers)
+     (gnus-open-server			nntp-open-server)
+     (gnus-close-server			nntp-close-server)
+     (gnus-server-opened		nntp-server-opened)
+     (gnus-status-message		nntp-status-message)
+     (gnus-request-article		nntp-request-article)
+     (gnus-request-group		nntp-request-group)
+     (gnus-request-list			nntp-request-list)
+     (gnus-request-list-newsgroups	nntp-request-list-newsgroups)
+     (gnus-request-list-distributions	nntp-request-list-distributions)
+     (gnus-request-post			nntp-request-post))
     (nnspool
-     (gnus-retrieve-headers .	nnspool-retrieve-headers)
-     (gnus-open-server .	nnspool-open-server)
-     (gnus-close-server .	nnspool-close-server)
-     (gnus-server-opened .	nnspool-server-opened)
-     (gnus-status-message .	nnspool-status-message)
-     (gnus-request-article .	nnspool-request-article)
-     (gnus-request-group .	nnspool-request-group)
-     (gnus-request-list .	nnspool-request-list)
-     (gnus-request-post .	nnspool-request-post))
+     (gnus-retrieve-headers		nnspool-retrieve-headers)
+     (gnus-open-server			nnspool-open-server)
+     (gnus-close-server			nnspool-close-server)
+     (gnus-server-opened		nnspool-server-opened)
+     (gnus-status-message		nnspool-status-message)
+     (gnus-request-article		nnspool-request-article)
+     (gnus-request-group		nnspool-request-group)
+     (gnus-request-list			nnspool-request-list)
+     (gnus-request-list-newsgroups	nnspool-request-list-newsgroups)
+     (gnus-request-list-distributions	nnspool-request-list-distributions)
+     (gnus-request-post			nnspool-request-post))
     (mhspool
-     (gnus-retrieve-headers .	mhspool-retrieve-headers)
-     (gnus-open-server .	mhspool-open-server)
-     (gnus-close-server .	mhspool-close-server)
-     (gnus-server-opened .	mhspool-server-opened)
-     (gnus-status-message .	mhspool-status-message)
-     (gnus-request-article .	mhspool-request-article)
-     (gnus-request-group .	mhspool-request-group)
-     (gnus-request-list .	mhspool-request-list)
-     (gnus-request-post .	mhspool-request-post)))
+     (gnus-retrieve-headers		mhspool-retrieve-headers)
+     (gnus-open-server			mhspool-open-server)
+     (gnus-close-server			mhspool-close-server)
+     (gnus-server-opened		mhspool-server-opened)
+     (gnus-status-message		mhspool-status-message)
+     (gnus-request-article		mhspool-request-article)
+     (gnus-request-group		mhspool-request-group)
+     (gnus-request-list			mhspool-request-list)
+     (gnus-request-list-newsgroups	mhspool-request-list-newsgroups)
+     (gnus-request-list-distributions	mhspool-request-list-distributions)
+     (gnus-request-post			mhspool-request-post)))
   "Access method for NNTP, nnspool, and mhspool.")
 
-(defvar gnus-Group-buffer "*Newsgroup*")
-(defvar gnus-Subject-buffer "*Subject*")
-(defvar gnus-Article-buffer "*Article*")
-(defvar gnus-Digest-buffer "GNUS Digest")
-(defvar gnus-Digest-summary-buffer "GNUS Digest-summary")
+(defvar gnus-group-buffer "*Newsgroup*")
+(defvar gnus-summary-buffer "*Summary*")
+(defvar gnus-article-buffer "*Article*")
+(defvar gnus-digest-buffer "GNUS Digest")
+(defvar gnus-digest-summary-buffer "GNUS Digest-summary")
 
 (defvar gnus-buffer-list
-  (list gnus-Group-buffer gnus-Subject-buffer gnus-Article-buffer
-	gnus-Digest-buffer gnus-Digest-summary-buffer)
+  (list gnus-group-buffer gnus-summary-buffer gnus-article-buffer
+	gnus-digest-buffer gnus-digest-summary-buffer)
   "GNUS buffer names which should be killed when exiting.")
 
 (defvar gnus-variable-list
@@ -533,6 +678,8 @@
   "Functions overloaded by gnus.
 It is a list of `(original overload &optional file)'.")
 
+(defvar gnus-distribution-list nil)
+
 (defvar gnus-newsrc-options nil
   "Options line in the .newsrc file.")
 
@@ -543,13 +690,25 @@
   "Regexp representing unsubscribed newsgroups.")
 
 (defvar gnus-newsrc-assoc nil
-  "Assoc list of read articles.")
+  "Assoc list of read articles.
+gnus-newsrc-hashtb should be kept so that both hold the same information.")
+
+(defvar gnus-newsrc-hashtb nil
+  "Hashtable of gnus-newsrc-assoc.")
 
 (defvar gnus-killed-assoc nil
-  "Assoc list of newsgroups removed from `gnus-newsrc-assoc'.")
+  "Assoc list of newsgroups removed from gnus-newsrc-assoc.
+gnus-killed-hashtb should be kept so that both hold the same information.")
+
+(defvar gnus-killed-hashtb nil
+  "Hashtable of gnus-killed-assoc.")
 
 (defvar gnus-marked-assoc nil
-  "Assoc list of articles marked as unread.")
+  "Assoc list of articles marked as unread.
+gnus-marked-hashtb should be kept so that both hold the same information.")
+
+(defvar gnus-marked-hashtb nil
+  "Hashtable of gnus-marked-assoc.")
 
 (defvar gnus-unread-hashtb nil
   "Hashtable of unread articles.")
@@ -589,51 +748,70 @@
   "List of marked articles in the current newsgroup (a subset of unread art).")
 
 (defvar gnus-newsgroup-headers nil
-  "List of article headers in the current newsgroup.")
+  "List of article headers in the current newsgroup.
+If the variable is modified (added or deleted), the function
+gnus-clear-hashtables-for-newsgroup-headers must be called to clear
+the hash tables.")
+(defvar gnus-newsgroup-headers-hashtb-by-id nil)
+(defvar gnus-newsgroup-headers-hashtb-by-number nil)
 
 (defvar gnus-current-article nil)
 (defvar gnus-current-headers nil)
 (defvar gnus-current-history nil)
-(defvar gnus-have-all-headers nil)
+(defvar gnus-have-all-headers nil "Must be either T or NIL.")
 (defvar gnus-last-article nil)
 (defvar gnus-current-kill-article nil)
 
 ;; Save window configuration.
 (defvar gnus-winconf-kill-file nil)
 
-(defvar gnus-Group-mode-map nil)
-(defvar gnus-Subject-mode-map nil)
-(defvar gnus-Article-mode-map nil)
-(defvar gnus-Kill-file-mode-map nil)
+(defvar gnus-group-mode-map nil)
+(defvar gnus-summary-mode-map nil)
+(defvar gnus-article-mode-map nil)
+(defvar gnus-kill-file-mode-map nil)
 
 (defvar rmail-last-file (expand-file-name "~/XMBOX"))
 (defvar rmail-last-rmail-file (expand-file-name "~/XNEWS"))
 
 ;; Define GNUS Subsystems.
-(autoload 'gnus-Group-post-news "gnuspost"
+(autoload 'gnus-group-post-news "gnuspost"
 	  "Post an article." t)
-(autoload 'gnus-Subject-post-news "gnuspost"
+(autoload 'gnus-summary-post-news "gnuspost"
 	  "Post an article." t)
-(autoload 'gnus-Subject-post-reply "gnuspost"
+(autoload 'gnus-summary-followup "gnuspost"
 	  "Post a reply article." t)
-(autoload 'gnus-Subject-post-reply-with-original "gnuspost"
+(autoload 'gnus-summary-followup-with-original "gnuspost"
 	  "Post a reply article with original article." t)
-(autoload 'gnus-Subject-cancel-article "gnuspost"
+(autoload 'gnus-summary-cancel-article "gnuspost"
 	  "Cancel an article you posted." t)
 
-(autoload 'gnus-Subject-mail-reply "gnusmail"
+(autoload 'gnus-summary-reply "gnusmail"
 	  "Reply mail to news author." t)
-(autoload 'gnus-Subject-mail-reply-with-original "gnusmail"
+(autoload 'gnus-summary-reply-with-original "gnusmail"
 	  "Reply mail to news author with original article." t)
-(autoload 'gnus-Subject-mail-other-window "gnusmail"
+(autoload 'gnus-summary-mail-forward "gnusmail"
+	  "Forward the current message to another user." t)
+(autoload 'gnus-summary-mail-other-window "gnusmail"
 	  "Compose mail in other window." t)
 
-(autoload 'gnus-Group-kill-group "gnusmisc"
+(autoload 'gnus-group-kill-group "gnusmisc"
 	  "Kill newsgroup on current line." t)
-(autoload 'gnus-Group-yank-group "gnusmisc"
+(autoload 'gnus-group-yank-group "gnusmisc"
 	  "Yank the last killed newsgroup on current line." t)
-(autoload 'gnus-Browse-killed-groups "gnusmisc"
-	  "Browse the killed newsgroups." t)
+(autoload 'gnus-group-kill-region "gnusmisc"
+	  "Kill newsgroups in current region." t)
+(autoload 'gnus-group-transpose-groups "gnusmisc"
+	  "Exchange current newsgroup and previous newsgroup." t)
+(autoload 'gnus-list-killed-groups "gnusmisc"
+	  "List the killed newsgroups." t)
+(autoload 'gnus-gmt-to-local "gnusmisc"
+	  "Rewrite Date field in GMT to local in current buffer.")
+
+(autoload 'metamail-buffer "metamail"
+	  "Process current buffer through 'metamail'." t)
+
+(autoload 'timezone-make-sortable-date "timezone")
+(autoload 'timezone-parse-date "timezone")
 
 (autoload 'rmail-output "rmailout"
 	  "Append this message to Unix mail file named FILE-NAME." t)
@@ -641,12 +819,12 @@
 (autoload 'mh-find-path "mh-e")
 (autoload 'mh-prompt-for-folder "mh-e")
 
-(put 'gnus-Group-mode 'mode-class 'special)
-(put 'gnus-Subject-mode 'mode-class 'special)
-(put 'gnus-Article-mode 'mode-class 'special)
+(put 'gnus-group-mode 'mode-class 'special)
+(put 'gnus-summary-mode 'mode-class 'special)
+(put 'gnus-article-mode 'mode-class 'special)
 
 
-;;(put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
+;;(put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
 
 (defmacro gnus-eval-in-buffer-window (buffer &rest forms)
   "Pop to BUFFER, evaluate FORMS, and then returns to original window."
@@ -657,13 +835,16 @@
 	     (,@ forms))
 	 (select-window GNUSStartBufferWindow)))))
 
-(defmacro gnus-make-hashtable ()
-  '(make-abbrev-table))
+(defmacro gnus-make-hashtable (&optional hashsize)
+  "Make a hash table (default and minimum size is 200).
+Optional argument HASHSIZE specifies the table size."
+  (` (make-vector (, (if hashsize (` (max (, hashsize) 200)) 200)) 0)))
 
 (defmacro gnus-gethash (string hashtable)
   "Get hash value of STRING in HASHTABLE."
   ;;(` (symbol-value (abbrev-symbol (, string) (, hashtable))))
-  (` (abbrev-expansion (, string) (, hashtable))))
+  ;;(` (abbrev-expansion (, string) (, hashtable)))
+  (` (symbol-value (intern-soft (, string) (, hashtable)))))
 
 (defmacro gnus-sethash (string value hashtable)
   "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
@@ -743,54 +924,91 @@
 ;;; GNUS Group Mode
 ;;;
 
-(if gnus-Group-mode-map
+(if gnus-group-mode-map
     nil
-  (setq gnus-Group-mode-map (make-keymap))
-  (suppress-keymap gnus-Group-mode-map)
-  (define-key gnus-Group-mode-map " " 'gnus-Group-read-group)
-  (define-key gnus-Group-mode-map "=" 'gnus-Group-select-group)
-  (define-key gnus-Group-mode-map "j" 'gnus-Group-jump-to-group)
-  (define-key gnus-Group-mode-map "n" 'gnus-Group-next-unread-group)
-  (define-key gnus-Group-mode-map "p" 'gnus-Group-prev-unread-group)
-  (define-key gnus-Group-mode-map "\177" 'gnus-Group-prev-unread-group)
-  (define-key gnus-Group-mode-map "N" 'gnus-Group-next-group)
-  (define-key gnus-Group-mode-map "P" 'gnus-Group-prev-group)
-  (define-key gnus-Group-mode-map "\C-n" 'gnus-Group-next-group)
-  (define-key gnus-Group-mode-map "\C-p" 'gnus-Group-prev-group)
-  (define-key gnus-Group-mode-map "\r" 'next-line)
-  (define-key gnus-Group-mode-map "/" 'isearch-forward)
-  (define-key gnus-Group-mode-map "<" 'beginning-of-buffer)
-  (define-key gnus-Group-mode-map ">" 'end-of-buffer)
-  (define-key gnus-Group-mode-map "u" 'gnus-Group-unsubscribe-current-group)
-  (define-key gnus-Group-mode-map "U" 'gnus-Group-unsubscribe-group)
-  (define-key gnus-Group-mode-map "c" 'gnus-Group-catch-up)
-  (define-key gnus-Group-mode-map "C" 'gnus-Group-catch-up-all)
-  (define-key gnus-Group-mode-map "l" 'gnus-Group-list-groups)
-  (define-key gnus-Group-mode-map "L" 'gnus-Group-list-all-groups)
-  (define-key gnus-Group-mode-map "g" 'gnus-Group-get-new-news)
-  (define-key gnus-Group-mode-map "R" 'gnus-Group-restart)
-  (define-key gnus-Group-mode-map "b" 'gnus-Group-check-bogus-groups)
-  (define-key gnus-Group-mode-map "r" 'gnus-Group-restrict-groups)
-  (define-key gnus-Group-mode-map "a" 'gnus-Group-post-news)
-  (define-key gnus-Group-mode-map "\ek" 'gnus-Group-edit-local-kill)
-  (define-key gnus-Group-mode-map "\eK" 'gnus-Group-edit-global-kill)
-  (define-key gnus-Group-mode-map "\C-k" 'gnus-Group-kill-group)
-  (define-key gnus-Group-mode-map "\C-y" 'gnus-Group-yank-group)
-  (define-key gnus-Group-mode-map "\C-c\C-y" 'gnus-Browse-killed-groups)
-  (define-key gnus-Group-mode-map "V" 'gnus-version)
-  (define-key gnus-Group-mode-map "x" 'gnus-Group-force-update)
-  (define-key gnus-Group-mode-map "s" 'gnus-Group-force-update)
-  (define-key gnus-Group-mode-map "z" 'gnus-Group-suspend)
-  (define-key gnus-Group-mode-map "q" 'gnus-Group-exit)
-  (define-key gnus-Group-mode-map "Q" 'gnus-Group-quit)
-  (define-key gnus-Group-mode-map "?" 'gnus-Group-describe-briefly)
-  (define-key gnus-Group-mode-map "\C-c\C-i" 'gnus-Info-find-node))
-
-(defun gnus-Group-mode ()
+  (setq gnus-group-mode-map (make-keymap))
+  (suppress-keymap gnus-group-mode-map)
+  (define-key gnus-group-mode-map " " 'gnus-group-read-group)
+  (define-key gnus-group-mode-map "=" 'gnus-group-select-group)
+  (define-key gnus-group-mode-map "j" 'gnus-group-jump-to-group)
+  (define-key gnus-group-mode-map "n" 'gnus-group-next-unread-group)
+  (define-key gnus-group-mode-map "p" 'gnus-group-prev-unread-group)
+  (define-key gnus-group-mode-map "\177" 'gnus-group-prev-unread-group)
+  (define-key gnus-group-mode-map "N" 'gnus-group-next-group)
+  (define-key gnus-group-mode-map "P" 'gnus-group-prev-group)
+  (define-key gnus-group-mode-map "\C-n" 'gnus-group-next-group)
+  (define-key gnus-group-mode-map "\C-p" 'gnus-group-prev-group)
+  (define-key gnus-group-mode-map "\r" 'next-line)
+  ;;(define-key gnus-group-mode-map "/" 'isearch-forward)
+  (define-key gnus-group-mode-map "<" 'beginning-of-buffer)
+  (define-key gnus-group-mode-map ">" 'end-of-buffer)
+  (define-key gnus-group-mode-map "u" 'gnus-group-unsubscribe-current-group)
+  (define-key gnus-group-mode-map "U" 'gnus-group-unsubscribe-group)
+  (define-key gnus-group-mode-map "c" 'gnus-group-catchup)
+  (define-key gnus-group-mode-map "C" 'gnus-group-catchup-all)
+  (define-key gnus-group-mode-map "l" 'gnus-group-list-groups)
+  (define-key gnus-group-mode-map "L" 'gnus-group-list-all-groups)
+  (define-key gnus-group-mode-map "g" 'gnus-group-get-new-news)
+  (define-key gnus-group-mode-map "R" 'gnus-group-restart)
+  (define-key gnus-group-mode-map "b" 'gnus-group-check-bogus-groups)
+  (define-key gnus-group-mode-map "r" 'gnus-group-restrict-groups)
+  (define-key gnus-group-mode-map "a" 'gnus-group-post-news)
+  (define-key gnus-group-mode-map "\ek" 'gnus-group-edit-local-kill)
+  (define-key gnus-group-mode-map "\eK" 'gnus-group-edit-global-kill)
+  (define-key gnus-group-mode-map "\C-k" 'gnus-group-kill-group)
+  (define-key gnus-group-mode-map "\C-y" 'gnus-group-yank-group)
+  (define-key gnus-group-mode-map "\C-w" 'gnus-group-kill-region)
+  (define-key gnus-group-mode-map "\C-x\C-t" 'gnus-group-transpose-groups)
+  (define-key gnus-group-mode-map "\C-c\C-l" 'gnus-list-killed-groups)
+  (define-key gnus-group-mode-map "V" 'gnus-version)
+  ;;(define-key gnus-group-mode-map "x" 'gnus-group-force-update)
+  (define-key gnus-group-mode-map "s" 'gnus-group-force-update)
+  (define-key gnus-group-mode-map "z" 'gnus-group-suspend)
+  (define-key gnus-group-mode-map "q" 'gnus-group-exit)
+  (define-key gnus-group-mode-map "Q" 'gnus-group-quit)
+  (define-key gnus-group-mode-map "?" 'gnus-group-describe-briefly)
+  (define-key gnus-group-mode-map "\C-c\C-i" 'gnus-info-find-node))
+
+(defun gnus-group-mode ()
   "Major mode for reading network news.
 All normal editing commands are turned off.
 Instead, these commands are available:
-\\{gnus-Group-mode-map}
+
+SPC	Read articles in this newsgroup.
+=	Select this newsgroup.
+j	Move to the specified newsgroup.
+n	Move to the next unread newsgroup.
+p	Move to the previous unread newsgroup.
+C-n	Move to the next newsgroup.
+C-p	Move to the previous newsgroup.
+<	Move point to the beginning of this buffer.
+>	Move point to the end of this buffer.
+u	Unsubscribe from (subscribe to) this newsgroup.
+U	Unsubscribe from (subscribe to) the specified newsgroup.
+c	Mark all articles as read, preserving marked articles.
+C	Mark all articles in this newsgroup as read.
+l	Revert this buffer.
+L	List all newsgroups.
+g	Get new news.
+R	Force to read the raw .newsrc file and get new news.
+b	Check bogus newsgroups.
+r	Restrict visible newsgroups to the current region.
+a	Post a new article.
+ESC k	Edit a local KILL file applied to this newsgroup.
+ESC K	Edit a global KILL file applied to all newsgroups.
+C-k	Kill this newsgroup.
+C-y	Yank killed newsgroup here.
+C-w	Kill newsgroups in current region (excluding current point).
+C-x C-t	Exchange this newsgroup and previous newsgroup.
+C-c C-l	list killed newsgroups.
+s	Save .newsrc file.
+z	Suspend reading news.
+q	Quit reading news.
+Q	Quit reading news without saving .newsrc file.
+V	Show the version number of this GNUS.
+?	Describe Group Mode commands briefly.
+C-h m	Describe Group Mode.
+C-c C-i	Read Info about Group Mode.
 
   The name of the host running NNTP server is asked for if no default
 host is specified. It is also possible to choose another NNTP server
@@ -820,7 +1038,7 @@
 
   If an Info file generated from `gnus.texinfo' is installed, you can
 read an appropriate Info node of the Info file according to the
-current major mode of GNUS by \\[gnus-Info-find-node].
+current major mode of GNUS by \\[gnus-info-find-node].
 
   The variable `gnus-version', `nntp-version', `nnspool-version', and
 `mhspool-version' have the version numbers of this version of gnus.el,
@@ -830,27 +1048,27 @@
  gnus-nntp-server
     Specifies the name of the host running the NNTP server. If its
     value is a string such as `:DIRECTORY', the user's private
-    DIRECTORY is used as a news spool.  If its value is `::', then
-    the local news spool on the current machine is used directly.
-    The `NNTPSERVER' environment variable specifies the initial value
-    for this variable.
+    DIRECTORY is used as a news spool.  The variable is initialized
+    from the NNTPSERVER environment variable.
 
  gnus-nntp-service
-    Specifies a NNTP service name.  It is usually \"nntp\".
+    Specifies a NNTP service name.  It is usually \"nntp\" or 119.
+    Nil forces GNUS to use a local news spool if the variable
+    `gnus-nntp-server' is set to the local host name.
 
  gnus-startup-file
-    Specifies a startup file (.newsrc). If there is a file named
-    `.newsrc-SERVER', it's used instead when talking to SERVER. I
+    Specifies a startup file (.newsrc).  If there is a file named
+    `.newsrc-SERVER', it's used instead when talking to SERVER.  I
     recommend you to use the server specific file, if you'd like to
     talk to many servers.  Especially if you'd like to read your
     private directory, the name of the file must be
     `.newsrc-:DIRECTORY'.
 
  gnus-signature-file
-    Specifies a signature file (.signature). If there is a file named
+    Specifies a signature file (.signature).  If there is a file named
     `.signature-DISTRIBUTION', it's used instead when posting an
-    article in DISTRIBUTION. Set the variable to nil to prevent
-    appending the file automatically. If you use an NNTP inews which
+    article in DISTRIBUTION.  Set the variable to nil to prevent
+    appending the file automatically.  If you use an NNTP inews which
     comes with the NNTP package, you may have to set the variable to
     nil.
 
@@ -894,48 +1112,54 @@
     Non-nil means to take up the entire screen of Emacs.
 
  gnus-window-configuration
-    Specifies the configuration of Group, Subject, and Article
+    Specifies the configuration of Group, Summary, and Article
     windows.  It is a list of (ACTION (G S A)), where G, S, and A are
-    the relative height of Group, Subject, and Article windows,
-    respectively.  ACTION is `SelectNewsgroup', `ExitNewsgroup',
-    `SelectArticle', or `ExpandSubject'.
+    the relative height of Group, Summary, and Article windows,
+    respectively.  ACTION is `summary', `newsgroups', or `article'.
 
  gnus-subscribe-newsgroup-method
     Specifies a function called with a newsgroup name when new
     newsgroup is found.  The default definition adds new newsgroup at
     the beginning of other newsgroups.
 
+  And more and more.  Please refer to texinfo documentation.
+
 Various hooks for customization:
- gnus-Group-mode-hook
+ gnus-group-mode-hook
     Entry to this mode calls the value with no arguments, if that
     value is non-nil. This hook is called before GNUS is connected to
     the NNTP server. So, you can change or define the NNTP server in
     this hook.
 
- gnus-Startup-hook
+ gnus-startup-hook
     Called with no arguments after the NNTP server is selected. It is
     possible to change the behavior of GNUS or initialize the
     variables according to the selected NNTP server.
 
- gnus-Group-prepare-hook
+ gnus-group-prepare-hook
     Called with no arguments after a newsgroup list is created in the
     Newsgroup buffer, if that value is non-nil.
 
- gnus-Save-newsrc-hook
+ gnus-save-newsrc-hook
     Called with no arguments when saving newsrc file if that value is
     non-nil.
 
- gnus-Inews-article-hook
+ gnus-prepare-article-hook
+    Called with no arguments after preparing message body, but before
+    preparing header fields which is automatically generated if that
+    value is non-nil.  The default hook (gnus-inews-insert-signature)
+    inserts a signature file.
+
+ gnus-inews-article-hook
     Called with no arguments when posting an article if that value is
-    non-nil. This hook is called just before posting an article, while
-    `news-inews-hook' is called before preparing article headers. If
-    you'd like to convert kanji code of the article, this hook is recommended.
-
- gnus-Suspend-gnus-hook
+    non-nil.  This hook is called just before posting an article.  The
+    default hook does FCC (save an article to the specified file).
+
+ gnus-suspend-gnus-hook
     Called with no arguments when suspending (not exiting) GNUS, if
     that value is non-nil.
 
- gnus-Exit-gnus-hook
+ gnus-exit-gnus-hook
     Called with no arguments when exiting (not suspending) GNUS, if
     that value is non-nil."
   (interactive)
@@ -949,14 +1173,14 @@
 	(t
 	 (setq mode-line-format
 	       "--- GNUS: List of Newsgroups  %[(%m)%]----%3p-%-")))
-  (setq major-mode 'gnus-Group-mode)
+  (setq major-mode 'gnus-group-mode)
   (setq mode-name "Newsgroup")
   (setq mode-line-buffer-identification	"GNUS: List of Newsgroups")
   (setq mode-line-process nil)
-  (use-local-map gnus-Group-mode-map)
-  (buffer-disable-undo (current-buffer))
+  (use-local-map gnus-group-mode-map)
+  (buffer-flush-undo (current-buffer))
   (setq buffer-read-only t)		;Disable modification
-  (run-hooks 'gnus-Group-mode-hook))
+  (run-hooks 'gnus-group-mode-hook))
 
 ;;;###autoload
 (defun gnus (&optional confirm)
@@ -965,29 +1189,29 @@
   (interactive "P")
   (unwind-protect
       (progn
-	(switch-to-buffer (get-buffer-create gnus-Group-buffer))
-	(gnus-Group-mode)
+	(switch-to-buffer (get-buffer-create gnus-group-buffer))
+	(gnus-group-mode)
 	(gnus-start-news-server confirm))
     (if (not (gnus-server-opened))
-	(gnus-Group-quit)
+	(gnus-group-quit)
       ;; NNTP server is successfully open. 
       (setq mode-line-process (format " {%s}" gnus-nntp-server))
       (let ((buffer-read-only nil))
 	(erase-buffer)
-	(gnus-Group-startup-message)
+	(gnus-group-startup-message)
 	(sit-for 0))
-      (run-hooks 'gnus-Startup-hook)
-      (gnus-setup-news-info)
+      (run-hooks 'gnus-startup-hook)
+      (gnus-setup-news)
       (if gnus-novice-user
-	  (gnus-Group-describe-briefly)) ;Show brief help message.
-      (gnus-Group-list-groups nil)
+	  (gnus-group-describe-briefly)) ;Show brief help message.
+      (gnus-group-list-groups nil)
       )))
 
-(defun gnus-Group-startup-message ()
+(defun gnus-group-startup-message ()
   "Insert startup message in current buffer."
   ;; Insert the message.
   (insert "
-                   GNUS Version 3.13
+                   GNUS Version 3.15
 
          NNTP-based News Reader for GNU Emacs
 
@@ -998,7 +1222,7 @@
 Comments, suggestions, and bug fixes are welcome.
 
 Masanobu UMEDA
-umerin@tc.Nagasaki.GO.JP")
+umerin@mse.kyutech.ac.jp")
   ;; And then hack it.
   ;; 57 is the longest line.
   (indent-rigidly (point-min) (point-max) (/ (max (- (window-width) 57) 0) 2))
@@ -1006,42 +1230,41 @@
   ;; +4 is fuzzy factor.
   (insert-char ?\n (/ (max (- (window-height) 18) 0) 2)))
 
-(defun gnus-Group-list-groups (show-all)
+(defun gnus-group-list-groups (show-all)
   "List newsgroups in the Newsgroup buffer.
 If argument SHOW-ALL is non-nil, unsubscribed groups are also listed."
   (interactive "P")
-  (let ((last-group			;Current newsgroup.
-	 (gnus-Group-group-name))
+  (let ((case-fold-search nil)
+	(last-group			;Current newsgroup.
+	 (gnus-group-group-name))
 	(next-group			;Next possible newsgroup.
 	 (progn
-	   (gnus-Group-search-forward nil nil)
-	   (gnus-Group-group-name)))
+	   (gnus-group-search-forward nil nil)
+	   (gnus-group-group-name)))
 	(prev-group			;Previous possible newsgroup.
 	 (progn
-	   (gnus-Group-search-forward t nil)
-	   (gnus-Group-group-name))))
-    (gnus-Group-prepare show-all)
+	   (gnus-group-search-forward t nil)
+	   (gnus-group-group-name))))
+    (set-buffer gnus-group-buffer)	;May call from out of Group buffer
+    (gnus-group-prepare show-all)
     (if (zerop (buffer-size))
 	(message "No news is good news")
       ;; Go to last newsgroup if possible.  If cannot, try next and
       ;; previous.  If all fail, go to first unread newsgroup.
       (goto-char (point-min))
       (or (and last-group
-	       (re-search-forward
-		(concat "^.+: " (regexp-quote last-group) "$") nil t))
+	       (re-search-forward (gnus-group-make-regexp last-group) nil t))
 	  (and next-group
-	       (re-search-forward
-		(concat "^.+: " (regexp-quote next-group) "$") nil t))
+	       (re-search-forward (gnus-group-make-regexp next-group) nil t))
 	  (and prev-group
-	       (re-search-forward
-		(concat "^.+: " (regexp-quote prev-group) "$") nil t))
-	  (re-search-forward "^[ \t]+[1-9][0-9]*:" nil t))
+	       (re-search-forward (gnus-group-make-regexp prev-group) nil t))
+	  (gnus-group-search-forward nil nil t))
       ;; Adjust cursor point.
       (beginning-of-line)
       (search-forward ":" nil t)
       )))
 
-(defun gnus-Group-prepare (&optional all)
+(defun gnus-group-prepare (&optional all)
   "Prepare list of newsgroups in current buffer.
 If optional argument ALL is non-nil, unsubscribed groups are also listed."
   (let ((buffer-read-only nil)
@@ -1060,7 +1283,7 @@
       (if (or all
 	      (and (nth 1 group-info)	;Subscribed.
 		   (> unread-count 0)))	;There are unread articles.
-	  ;; Yes, I can use gnus-Group-prepare-line, but this is faster.
+	  ;; Yes, I can use gnus-group-prepare-line, but this is faster.
 	  (insert
 	   (format cntl
 		   ;; Subscribed or not.
@@ -1070,8 +1293,8 @@
 			    (>= 0
 				(- unread-count
 				   (length
-				    (cdr (assoc group-name
-						gnus-marked-assoc))))))
+				    (cdr (gnus-gethash group-name
+						       gnus-marked-hashtb))))))
 		       "*" " ")
 		   ;; Number of unread articles.
 		   unread-count
@@ -1082,10 +1305,10 @@
       )
     (setq gnus-have-all-newsgroups all)
     (goto-char (point-min))
-    (run-hooks 'gnus-Group-prepare-hook)
+    (run-hooks 'gnus-group-prepare-hook)
     ))
 
-(defun gnus-Group-prepare-line (info)
+(defun gnus-group-prepare-line (info)
   "Return a string for the Newsgroup buffer from INFO.
 INFO is an element of gnus-newsrc-assoc or gnus-killed-assoc."
   (let* ((group-name (car info))
@@ -1106,7 +1329,8 @@
 		     (>= 0
 			 (- unread-count
 			    (length
-			     (cdr (assoc group-name gnus-marked-assoc))))))
+			     (cdr (gnus-gethash group-name
+						gnus-marked-hashtb))))))
 		"*" " ")
 	    ;; Number of unread articles.
 	    unread-count
@@ -1114,91 +1338,80 @@
 	    group-name
 	    )))
 
-(defun gnus-Group-update-group (group &optional visible-only)
+(defun gnus-group-update-group (group &optional visible-only)
   "Update newsgroup info of GROUP.
 If optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored."
   (let ((buffer-read-only nil)
+	(case-fold-search nil)		;appleIIgs vs. appleiigs
+	(regexp (gnus-group-make-regexp group))
 	(visible nil))
     ;; Buffer may be narrowed.
     (save-restriction
       (widen)
-      ;; Search point to modify.
-      (goto-char (point-min))
-      (if (re-search-forward (concat "^.+: " (regexp-quote group) "$") nil t)
+      ;; Search a line to modify.  If the buffer is large, the search
+      ;; takes long time.  In most cases, current point is on the line
+      ;; we are looking for.  So, first of all, check current line. 
+      ;; And then if current point is in the first half, search from
+      ;; the beginning.  Otherwise, search from the end.
+      (if (cond ((progn
+		   (beginning-of-line)
+		   (looking-at regexp)))
+		((and (> (/ (buffer-size) 2) (point)) ;In the first half.
+		      (progn
+			(goto-char (point-min))
+			(re-search-forward regexp nil t))))
+		((progn
+		   (goto-char (point-max))
+		   (re-search-backward regexp nil t))))
 	  ;; GROUP is listed in current buffer. So, delete old line.
 	  (progn
 	    (setq visible t)
 	    (beginning-of-line)
 	    (delete-region (point) (progn (forward-line 1) (point)))
-	    ))
+	    )
+	;; No such line in the buffer, so insert it at the top.
+	(goto-char (point-min)))
       (if (or visible (not visible-only))
 	  (progn
-	    (insert (gnus-Group-prepare-line (assoc group gnus-newsrc-assoc)))
+	    (insert (gnus-group-prepare-line
+		     (gnus-gethash group gnus-newsrc-hashtb)))
 	    (forward-line -1)		;Move point on that line.
 	    ))
       )))
 
-;; GNUS Group mode command
-
-(defun gnus-Group-group-name ()
+(defun gnus-group-group-name ()
   "Get newsgroup name around point."
   (save-excursion
     (beginning-of-line)
-    (if (looking-at ".[* \t]*[0-9]+:[ \t]+\\([^ \t\n]+\\)$")
+    (if (looking-at "^.+:[ \t]+\\([^ \t\n]+\\)\\([ \t].*\\|$\\)")
 	(buffer-substring (match-beginning 1) (match-end 1))
       )))
 
-(defun gnus-Group-read-group (all &optional no-article)
-  "Read news in this newsgroup.
-If argument ALL is non-nil, already read articles become readable.
-If optional argument NO-ARTICLE is non-nil, no article body is displayed."
-  (interactive "P")
-  (let ((group (gnus-Group-group-name))) ;Newsgroup name to read.
-    (if group
-	(gnus-Subject-read-group
-	 group
-	 (or all
-	     ;;(not (nth 1 (assoc group gnus-newsrc-assoc)))	;Unsubscribed
-	     (zerop
-	      (nth 1 (gnus-gethash group gnus-unread-hashtb))))	;No unread
-	 no-article
-	 ))
-    ))
-
-(defun gnus-Group-select-group (all)
-  "Select this newsgroup.
-No article is selected automatically.
-If argument ALL is non-nil, already read articles become readable."
-  (interactive "P")
-  (gnus-Group-read-group all t))
-
-(defun gnus-Group-jump-to-group (group)
-  "Jump to newsgroup GROUP."
-  (interactive
-   (list (completing-read "Newsgroup: " gnus-newsrc-assoc nil 'require-match)))
-  (goto-char (point-min))
-  (or (re-search-forward (concat "^.+: " (regexp-quote group) "$") nil t)
-      (if (assoc group gnus-newsrc-assoc)
-	  ;; Add GROUP entry, then seach again.
-	  (gnus-Group-update-group group)))
-  ;; Adjust cursor point.
-  (beginning-of-line)
-  (search-forward ":" nil t))
-
-(defun gnus-Group-search-forward (backward any-group)
-  "Search for newsgroup forward.
-If first argument BACKWARD is non-nil, search backward instead.
-If second argument ANY-GROUP is non-nil, unsubscribed or empty
-group may be selected."
-  (let ((func (if backward 're-search-backward 're-search-forward))
-	(regexp 
+(defun gnus-group-make-regexp (newsgroup)
+  "Return regexp that matches for a line of NEWSGROUP."
+  (concat "^.+: " (regexp-quote newsgroup) "\\([ \t].*\\|$\\)"))
+
+(defun gnus-group-search-forward (backward norest &optional heretoo)
+  "Search for the next (or previous) newsgroup.
+If 1st argument BACKWARD is non-nil, search backward instead.
+If 2nd argument NOREST is non-nil, don't care about newsgroup property.
+If optional argument HERETOO is non-nil, current line is searched for, too."
+  (let ((case-fold-search nil)
+	(func
+	 (if backward
+	     (function re-search-backward) (function re-search-forward)))
+	(regexp
 	 (format "^%s[ \t]*\\(%s\\):"
-		 (if any-group ".." " [ \t]")
-		 (if any-group "[0-9]+" "[1-9][0-9]*")))
+		 (if norest ".." " [ \t]")
+		 (if norest "[0-9]+" "[1-9][0-9]*")))
 	(found nil))
     (if backward
-	(beginning-of-line)
-      (end-of-line))
+	(if heretoo
+	    (end-of-line)
+	  (beginning-of-line))
+      (if heretoo
+	  (beginning-of-line)
+	(end-of-line)))
     (setq found (funcall func regexp nil t))
     ;; Adjust cursor point.
     (beginning-of-line)
@@ -1207,88 +1420,129 @@
     found
     ))
 
-(defun gnus-Group-next-group (n)
+;; GNUS Group mode command
+
+(defun gnus-group-read-group (all &optional no-article)
+  "Read news in this newsgroup.
+If argument ALL is non-nil, already read articles become readable.
+If optional argument NO-ARTICLE is non-nil, no article body is displayed."
+  (interactive "P")
+  (let ((group (gnus-group-group-name))) ;Newsgroup name to read.
+    (if group
+	(gnus-summary-read-group
+	 group
+	 (or all
+	     ;;(not (nth 1 (gnus-gethash group gnus-newsrc-hashtb))) ;Unsubscribed
+	     (zerop
+	      (nth 1 (gnus-gethash group gnus-unread-hashtb))))	;No unread
+	 no-article
+	 ))
+    ))
+
+(defun gnus-group-select-group (all)
+  "Select this newsgroup.
+No article is selected automatically.
+If argument ALL is non-nil, already read articles become readable."
+  (interactive "P")
+  (gnus-group-read-group all t))
+
+(defun gnus-group-jump-to-group (group)
+  "Jump to newsgroup GROUP."
+  (interactive
+   (list (completing-read "Newsgroup: " gnus-newsrc-assoc nil 'require-match)))
+  (let ((case-fold-search nil))
+    (goto-char (point-min))
+    (or (re-search-forward (gnus-group-make-regexp group) nil t)
+	(if (gnus-gethash group gnus-newsrc-hashtb)
+	    ;; Add GROUP entry, then seach again.
+	    (gnus-group-update-group group)))
+    ;; Adjust cursor point.
+    (beginning-of-line)
+    (search-forward ":" nil t)
+    ))
+
+(defun gnus-group-next-group (n)
   "Go to next N'th newsgroup."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Group-search-forward nil t))
+	      (gnus-group-search-forward nil t))
     (setq n (1- n)))
-  (or (gnus-Group-search-forward nil t)
+  (or (gnus-group-search-forward nil t)
       (message "No more newsgroups")))
 
-(defun gnus-Group-next-unread-group (n)
+(defun gnus-group-next-unread-group (n)
   "Go to next N'th unread newsgroup."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Group-search-forward nil nil))
+	      (gnus-group-search-forward nil nil))
     (setq n (1- n)))
-  (or (gnus-Group-search-forward nil nil)
+  (or (gnus-group-search-forward nil nil)
       (message "No more unread newsgroups")))
 
-(defun gnus-Group-prev-group (n)
+(defun gnus-group-prev-group (n)
   "Go to previous N'th newsgroup."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Group-search-forward t t))
+	      (gnus-group-search-forward t t))
     (setq n (1- n)))
-  (or (gnus-Group-search-forward t t)
+  (or (gnus-group-search-forward t t)
       (message "No more newsgroups")))
 
-(defun gnus-Group-prev-unread-group (n)
+(defun gnus-group-prev-unread-group (n)
   "Go to previous N'th unread newsgroup."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Group-search-forward t nil))	      
+	      (gnus-group-search-forward t nil))	      
     (setq n (1- n)))
-  (or (gnus-Group-search-forward t nil)
+  (or (gnus-group-search-forward t nil)
       (message "No more unread newsgroups")))
 
-(defun gnus-Group-catch-up (all &optional quietly)
+(defun gnus-group-catchup (all)
   "Mark all articles not marked as unread in current newsgroup as read.
 If prefix argument ALL is non-nil, all articles are marked as read.
 Cross references (Xref: field) of articles are ignored."
   (interactive "P")
-  (let* ((group (gnus-Group-group-name))
+  (let* ((group (gnus-group-group-name))
          (marked (if (not all)
-		     (cdr (assoc group gnus-marked-assoc)))))
+		     (cdr (gnus-gethash group gnus-marked-hashtb)))))
     (and group
-	 (or quietly
+	 (or (not gnus-interactive-catchup) ;Without confirmation?
 	     (y-or-n-p
 	      (if all
 		  "Do you really want to mark everything as read? "
 		"Delete all articles not marked as read? ")))
 	 (progn
-	   (message "")			;Erase "Yes or No" question.
+	   (message "")			;Clear "Yes or No" question.
 	   ;; Any marked articles will be preserved.
 	   (gnus-update-unread-articles group marked marked)
-	   (gnus-Group-update-group group)
-	   (gnus-Group-next-group 1)))
+	   (gnus-group-update-group group)
+	   (gnus-group-next-group 1)))
     ))
 
-(defun gnus-Group-catch-up-all (&optional quietly)
+(defun gnus-group-catchup-all ()
   "Mark all articles in current newsgroup as read.
 Cross references (Xref: field) of articles are ignored."
   (interactive)
-  (gnus-Group-catch-up t quietly))
-
-(defun gnus-Group-unsubscribe-current-group ()
+  (gnus-group-catchup t))
+
+(defun gnus-group-unsubscribe-current-group ()
   "Toggle subscribe from/to unsubscribe current group."
   (interactive)
-  (gnus-Group-unsubscribe-group (gnus-Group-group-name))
-  (gnus-Group-next-group 1))
-
-(defun gnus-Group-unsubscribe-group (group)
+  (gnus-group-unsubscribe-group (gnus-group-group-name))
+  (gnus-group-next-group 1))
+
+(defun gnus-group-unsubscribe-group (group)
   "Toggle subscribe from/to unsubscribe GROUP.
 New newsgroup is added to .newsrc automatically."
   (interactive
    (list (completing-read "Newsgroup: "
 			  gnus-active-hashtb nil 'require-match)))
-  (let ((newsrc (assoc group gnus-newsrc-assoc)))
+  (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
     (cond ((not (null newsrc))
 	   ;; Toggle subscription flag.
 	   (setcar (nthcdr 1 newsrc) (not (nth 1 newsrc)))
 	   (gnus-update-newsrc-buffer group)
-	   (gnus-Group-update-group group)
+	   (gnus-group-update-group group)
 	   ;; Adjust cursor point.
 	   (beginning-of-line)
 	   (search-forward ":" nil t))
@@ -1296,38 +1550,38 @@
 		(gnus-gethash group gnus-active-hashtb))
 	   ;; Add new newsgroup.
 	   (gnus-add-newsgroup group)
-	   (gnus-Group-update-group group)
+	   (gnus-group-update-group group)
 	   ;; Adjust cursor point.
 	   (beginning-of-line)
 	   (search-forward ":" nil t))
 	  (t (error "No such newsgroup: %s" group)))
     ))
 
-(defun gnus-Group-list-all-groups ()
+(defun gnus-group-list-all-groups ()
   "List all of newsgroups in the Newsgroup buffer."
   (interactive)
-  (gnus-Group-list-groups t))
-
-(defun gnus-Group-get-new-news ()
-  "Get newly arrived articles.  In fact, read the active file again."
+  (gnus-group-list-groups t))
+
+(defun gnus-group-get-new-news ()
+  "Get newly arrived articles. In fact, read the active file again."
   (interactive)
-  (gnus-setup-news-info)
-  (gnus-Group-list-groups gnus-have-all-newsgroups))
-
-(defun gnus-Group-restart ()
+  (gnus-setup-news)
+  (gnus-group-list-groups gnus-have-all-newsgroups))
+
+(defun gnus-group-restart ()
   "Force GNUS to read the raw startup file."
   (interactive)
   (gnus-save-newsrc-file)
-  (gnus-setup-news-info t)		;Force to read the raw startup file.
-  (gnus-Group-list-groups gnus-have-all-newsgroups))
-
-(defun gnus-Group-check-bogus-groups ()
+  (gnus-setup-news t)			;Force to read the raw startup file.
+  (gnus-group-list-groups gnus-have-all-newsgroups))
+
+(defun gnus-group-check-bogus-groups ()
   "Check bogus newsgroups."
   (interactive)
   (gnus-check-bogus-newsgroups t)	;Require confirmation.
-  (gnus-Group-list-groups gnus-have-all-newsgroups))
-
-(defun gnus-Group-restrict-groups (start end)
+  (gnus-group-list-groups gnus-have-all-newsgroups))
+
+(defun gnus-group-restrict-groups (start end)
   "Restrict visible newsgroups to the current region (START and END).
 Type \\[widen] to remove restriction."
   (interactive "r")
@@ -1342,216 +1596,327 @@
 			(point))))
   (message (substitute-command-keys "Type \\[widen] to remove restriction")))
 
-(defun gnus-Group-edit-global-kill ()
+(defun gnus-group-edit-global-kill ()
   "Edit a global KILL file."
   (interactive)
   (setq gnus-current-kill-article nil)	;No articles selected.
-  (gnus-Kill-file-edit-file nil) 	;Nil stands for global KILL file.
+  (gnus-kill-file-edit-file nil) 	;Nil stands for global KILL file.
   (message
    (substitute-command-keys
-    "Editing a global KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
-
-(defun gnus-Group-edit-local-kill ()
+    "Editing a global KILL file (Type \\[gnus-kill-file-exit] to exit)")))
+
+(defun gnus-group-edit-local-kill ()
   "Edit a local KILL file."
   (interactive)
   (setq gnus-current-kill-article nil)	;No articles selected.
-  (gnus-Kill-file-edit-file (gnus-Group-group-name))
+  (gnus-kill-file-edit-file (gnus-group-group-name))
   (message
    (substitute-command-keys
-    "Editing a local KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
-
-(defun gnus-Group-force-update ()
+    "Editing a local KILL file (Type \\[gnus-kill-file-exit] to exit)")))
+
+(defun gnus-group-force-update ()
   "Update .newsrc file."
   (interactive)
   (gnus-save-newsrc-file))
 
-(defun gnus-Group-suspend ()
+(defun gnus-group-suspend ()
   "Suspend the current GNUS session.
 In fact, cleanup buffers except for Group Mode buffer.
-The hook `gnus-Suspend-gnus-hook' is called before actually suspending."
+The hook gnus-suspend-gnus-hook is called before actually suspending."
   (interactive)
-  (run-hooks 'gnus-Suspend-gnus-hook)
+  (run-hooks 'gnus-suspend-gnus-hook)
   ;; Kill GNUS buffers except for Group Mode buffer.
   (let ((buffers gnus-buffer-list))
     (while buffers
-      (and (not (eq (car buffers) gnus-Group-buffer))
+      (and (not (eq (car buffers) gnus-group-buffer))
 	   (get-buffer (car buffers))
 	   (kill-buffer (car buffers)))
       (setq buffers (cdr buffers))
       ))
   (bury-buffer))
 
-(defun gnus-Group-exit ()
+(defun gnus-group-exit ()
   "Quit reading news after updating .newsrc.
-The hook `gnus-Exit-gnus-hook' is called before actually quitting."
+The hook gnus-exit-gnus-hook is called before actually quitting."
   (interactive)
   (if (or noninteractive		;For gnus-batch-kill
 	  (zerop (buffer-size))		;No news is good news.
 	  (not (gnus-server-opened))	;NNTP connection closed.
+	  (not gnus-interactive-exit)	;Without confirmation
 	  (y-or-n-p "Are you sure you want to quit reading news? "))
       (progn
 	(message "")			;Erase "Yes or No" question.
-	(run-hooks 'gnus-Exit-gnus-hook)
+	(run-hooks 'gnus-exit-gnus-hook)
 	(gnus-save-newsrc-file)
 	(gnus-clear-system)
 	(gnus-close-server))
     ))
 
-(defun gnus-Group-quit ()
+(defun gnus-group-quit ()
   "Quit reading news without updating .newsrc.
-The hook `gnus-Exit-gnus-hook' is called before actually quitting."
+The hook gnus-exit-gnus-hook is called before actually quitting."
   (interactive)
-  (if (or (zerop (buffer-size))
+  (if (or noninteractive		;For gnus-batch-kill
+	  (zerop (buffer-size))
 	  (not (gnus-server-opened))
 	  (yes-or-no-p
 	   (format "Quit reading news without saving %s? "
 		   (file-name-nondirectory gnus-current-startup-file))))
       (progn
 	(message "")			;Erase "Yes or No" question.
-	(run-hooks 'gnus-Exit-gnus-hook)
+	(run-hooks 'gnus-exit-gnus-hook)
 	(gnus-clear-system)
 	(gnus-close-server))
     ))
 
-(defun gnus-Group-describe-briefly ()
+(defun gnus-group-describe-briefly ()
   "Describe Group mode commands briefly."
   (interactive)
   (message
    (concat
-    (substitute-command-keys "\\[gnus-Group-read-group]:Select  ")
-    (substitute-command-keys "\\[gnus-Group-next-unread-group]:Forward  ")
-    (substitute-command-keys "\\[gnus-Group-prev-unread-group]:Backward  ")
-    (substitute-command-keys "\\[gnus-Group-exit]:Exit  ")
-    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
-    (substitute-command-keys "\\[gnus-Group-describe-briefly]:This help")
+    (substitute-command-keys "\\[gnus-group-read-group]:Select  ")
+    (substitute-command-keys "\\[gnus-group-next-unread-group]:Forward  ")
+    (substitute-command-keys "\\[gnus-group-prev-unread-group]:Backward  ")
+    (substitute-command-keys "\\[gnus-group-exit]:Exit  ")
+    (substitute-command-keys "\\[gnus-info-find-node]:Run Info  ")
+    (substitute-command-keys "\\[gnus-group-describe-briefly]:This help")
     )))
 
 
 ;;;
-;;; GNUS Subject Mode
+;;; GNUS Summary Mode
 ;;;
 
-(if gnus-Subject-mode-map
+(if gnus-summary-mode-map
     nil
-  (setq gnus-Subject-mode-map (make-keymap))
-  (suppress-keymap gnus-Subject-mode-map)
-  (define-key gnus-Subject-mode-map " " 'gnus-Subject-next-page)
-  (define-key gnus-Subject-mode-map "\177" 'gnus-Subject-prev-page)
-  (define-key gnus-Subject-mode-map "\r" 'gnus-Subject-scroll-up)
-  (define-key gnus-Subject-mode-map "n" 'gnus-Subject-next-unread-article)
-  (define-key gnus-Subject-mode-map "p" 'gnus-Subject-prev-unread-article)
-  (define-key gnus-Subject-mode-map "N" 'gnus-Subject-next-article)
-  (define-key gnus-Subject-mode-map "P" 'gnus-Subject-prev-article)
-  (define-key gnus-Subject-mode-map "\e\C-n" 'gnus-Subject-next-same-subject)
-  (define-key gnus-Subject-mode-map "\e\C-p" 'gnus-Subject-prev-same-subject)
-  ;;(define-key gnus-Subject-mode-map "\e\C-n" 'gnus-Subject-next-unread-same-subject)
-  ;;(define-key gnus-Subject-mode-map "\e\C-p" 'gnus-Subject-prev-unread-same-subject)
-  (define-key gnus-Subject-mode-map "\C-c\C-n" 'gnus-Subject-next-digest)
-  (define-key gnus-Subject-mode-map "\C-c\C-p" 'gnus-Subject-prev-digest)
-  (define-key gnus-Subject-mode-map "\C-n" 'gnus-Subject-next-subject)
-  (define-key gnus-Subject-mode-map "\C-p" 'gnus-Subject-prev-subject)
-  (define-key gnus-Subject-mode-map "\en" 'gnus-Subject-next-unread-subject)
-  (define-key gnus-Subject-mode-map "\ep" 'gnus-Subject-prev-unread-subject)
-  ;;(define-key gnus-Subject-mode-map "\C-cn" 'gnus-Subject-next-group)
-  ;;(define-key gnus-Subject-mode-map "\C-cp" 'gnus-Subject-prev-group)
-  (define-key gnus-Subject-mode-map "." 'gnus-Subject-first-unread-article)
-  (define-key gnus-Subject-mode-map "/" 'isearch-forward)
-  (define-key gnus-Subject-mode-map "s" 'gnus-Subject-isearch-article)
-  (define-key gnus-Subject-mode-map "\es" 'gnus-Subject-search-article-forward)
-  (define-key gnus-Subject-mode-map "\eS" 'gnus-Subject-search-article-backward)
-  (define-key gnus-Subject-mode-map "<" 'gnus-Subject-beginning-of-article)
-  (define-key gnus-Subject-mode-map ">" 'gnus-Subject-end-of-article)
-  (define-key gnus-Subject-mode-map "j" 'gnus-Subject-goto-subject)
-  (define-key gnus-Subject-mode-map "J" 'gnus-Subject-goto-article)
-  (define-key gnus-Subject-mode-map "l" 'gnus-Subject-goto-last-article)
-  (define-key gnus-Subject-mode-map "^" 'gnus-Subject-refer-parent-article)
-  (define-key gnus-Subject-mode-map "\er" 'gnus-Subject-refer-article)
-  (define-key gnus-Subject-mode-map "u" 'gnus-Subject-mark-as-unread-forward)
-  (define-key gnus-Subject-mode-map "U" 'gnus-Subject-mark-as-unread-backward)
-  (define-key gnus-Subject-mode-map "d" 'gnus-Subject-mark-as-read-forward)
-  (define-key gnus-Subject-mode-map "D" 'gnus-Subject-mark-as-read-backward)
-  (define-key gnus-Subject-mode-map "\eu" 'gnus-Subject-clear-mark-forward)
-  (define-key gnus-Subject-mode-map "\eU" 'gnus-Subject-clear-mark-backward)
-  (define-key gnus-Subject-mode-map "k" 'gnus-Subject-kill-same-subject-and-select)
-  (define-key gnus-Subject-mode-map "\C-k" 'gnus-Subject-kill-same-subject)
-  (define-key gnus-Subject-mode-map "\e\C-t" 'gnus-Subject-toggle-threads)
-  (define-key gnus-Subject-mode-map "\e\C-s" 'gnus-Subject-show-thread)
-  (define-key gnus-Subject-mode-map "\e\C-h" 'gnus-Subject-hide-thread)
-  (define-key gnus-Subject-mode-map "\e\C-f" 'gnus-Subject-next-thread)
-  (define-key gnus-Subject-mode-map "\e\C-b" 'gnus-Subject-prev-thread)
-  (define-key gnus-Subject-mode-map "\e\C-u" 'gnus-Subject-up-thread)
-  (define-key gnus-Subject-mode-map "\e\C-d" 'gnus-Subject-down-thread)
-  (define-key gnus-Subject-mode-map "\e\C-k" 'gnus-Subject-kill-thread)
-  (define-key gnus-Subject-mode-map "&" 'gnus-Subject-execute-command)
-  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up)
-  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-all)
-  (define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-and-exit)
-  ;;(define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up-all-and-exit)
-  (define-key gnus-Subject-mode-map "\C-t" 'gnus-Subject-toggle-truncation)
-  (define-key gnus-Subject-mode-map "x" 'gnus-Subject-delete-marked-as-read)
-  (define-key gnus-Subject-mode-map "X" 'gnus-Subject-delete-marked-with)
-  (define-key gnus-Subject-mode-map "\C-c\C-sn" 'gnus-Subject-sort-by-number)
-  (define-key gnus-Subject-mode-map "\C-c\C-sa" 'gnus-Subject-sort-by-author)
-  (define-key gnus-Subject-mode-map "\C-c\C-ss" 'gnus-Subject-sort-by-subject)
-  (define-key gnus-Subject-mode-map "\C-c\C-sd" 'gnus-Subject-sort-by-date)
-  (define-key gnus-Subject-mode-map "\C-c\C-s\C-n" 'gnus-Subject-sort-by-number)
-  (define-key gnus-Subject-mode-map "\C-c\C-s\C-a" 'gnus-Subject-sort-by-author)
-  (define-key gnus-Subject-mode-map "\C-c\C-s\C-s" 'gnus-Subject-sort-by-subject)
-  (define-key gnus-Subject-mode-map "\C-c\C-s\C-d" 'gnus-Subject-sort-by-date)
-  (define-key gnus-Subject-mode-map "=" 'gnus-Subject-expand-window)
-  (define-key gnus-Subject-mode-map "G" 'gnus-Subject-reselect-current-group)
-  (define-key gnus-Subject-mode-map "w" 'gnus-Subject-stop-page-breaking)
-  (define-key gnus-Subject-mode-map "\C-c\C-r" 'gnus-Subject-caesar-message)
-  (define-key gnus-Subject-mode-map "g" 'gnus-Subject-show-article)
-  (define-key gnus-Subject-mode-map "t" 'gnus-Subject-toggle-header)
-  (define-key gnus-Subject-mode-map "v" 'gnus-Subject-show-all-headers)
-  (define-key gnus-Subject-mode-map "\C-d" 'gnus-Subject-rmail-digest)
-  (define-key gnus-Subject-mode-map "a" 'gnus-Subject-post-news)
-  (define-key gnus-Subject-mode-map "f" 'gnus-Subject-post-reply)
-  (define-key gnus-Subject-mode-map "F" 'gnus-Subject-post-reply-with-original)
-  (define-key gnus-Subject-mode-map "C" 'gnus-Subject-cancel-article)
-  (define-key gnus-Subject-mode-map "r" 'gnus-Subject-mail-reply)
-  (define-key gnus-Subject-mode-map "R" 'gnus-Subject-mail-reply-with-original)
-  (define-key gnus-Subject-mode-map "m" 'gnus-Subject-mail-other-window)
-  (define-key gnus-Subject-mode-map "o" 'gnus-Subject-save-article)
-  (define-key gnus-Subject-mode-map "\C-o" 'gnus-Subject-save-in-mail)
-  (define-key gnus-Subject-mode-map "|" 'gnus-Subject-pipe-output)
-  (define-key gnus-Subject-mode-map "\ek" 'gnus-Subject-edit-local-kill)
-  (define-key gnus-Subject-mode-map "\eK" 'gnus-Subject-edit-global-kill)
-  (define-key gnus-Subject-mode-map "V" 'gnus-version)
-  (define-key gnus-Subject-mode-map "q" 'gnus-Subject-exit)
-  (define-key gnus-Subject-mode-map "Q" 'gnus-Subject-quit)
-  (define-key gnus-Subject-mode-map "?" 'gnus-Subject-describe-briefly)
-  (define-key gnus-Subject-mode-map "\C-c\C-i" 'gnus-Info-find-node))
-
-(defun gnus-Subject-mode ()
+  (setq gnus-summary-mode-map (make-keymap))
+  (suppress-keymap gnus-summary-mode-map)
+  (define-key gnus-summary-mode-map " " 'gnus-summary-next-page)
+  (define-key gnus-summary-mode-map "\177" 'gnus-summary-prev-page)
+  (define-key gnus-summary-mode-map "\r" 'gnus-summary-scroll-up)
+  (define-key gnus-summary-mode-map "n" 'gnus-summary-next-unread-article)
+  (define-key gnus-summary-mode-map "p" 'gnus-summary-prev-unread-article)
+  (define-key gnus-summary-mode-map "N" 'gnus-summary-next-article)
+  (define-key gnus-summary-mode-map "P" 'gnus-summary-prev-article)
+  (define-key gnus-summary-mode-map "\e\C-n" 'gnus-summary-next-same-subject)
+  (define-key gnus-summary-mode-map "\e\C-p" 'gnus-summary-prev-same-subject)
+  ;;(define-key gnus-summary-mode-map "\e\C-n" 'gnus-summary-next-unread-same-subject)
+  ;;(define-key gnus-summary-mode-map "\e\C-p" 'gnus-summary-prev-unread-same-subject)
+  (define-key gnus-summary-mode-map "\C-c\C-n" 'gnus-summary-next-digest)
+  (define-key gnus-summary-mode-map "\C-c\C-p" 'gnus-summary-prev-digest)
+  (define-key gnus-summary-mode-map "\C-n" 'gnus-summary-next-subject)
+  (define-key gnus-summary-mode-map "\C-p" 'gnus-summary-prev-subject)
+  (define-key gnus-summary-mode-map "\en" 'gnus-summary-next-unread-subject)
+  (define-key gnus-summary-mode-map "\ep" 'gnus-summary-prev-unread-subject)
+  ;;(define-key gnus-summary-mode-map "\C-cn" 'gnus-summary-next-group)
+  ;;(define-key gnus-summary-mode-map "\C-cp" 'gnus-summary-prev-group)
+  (define-key gnus-summary-mode-map "." 'gnus-summary-first-unread-article)
+  ;;(define-key gnus-summary-mode-map "/" 'isearch-forward)
+  (define-key gnus-summary-mode-map "s" 'gnus-summary-isearch-article)
+  (define-key gnus-summary-mode-map "\es" 'gnus-summary-search-article-forward)
+  ;;(define-key gnus-summary-mode-map "\eS" 'gnus-summary-search-article-backward)
+  (define-key gnus-summary-mode-map "\er" 'gnus-summary-search-article-backward)
+  (define-key gnus-summary-mode-map "<" 'gnus-summary-beginning-of-article)
+  (define-key gnus-summary-mode-map ">" 'gnus-summary-end-of-article)
+  (define-key gnus-summary-mode-map "j" 'gnus-summary-goto-subject)
+  ;;(define-key gnus-summary-mode-map "J" 'gnus-summary-goto-article)
+  (define-key gnus-summary-mode-map "l" 'gnus-summary-goto-last-article)
+  (define-key gnus-summary-mode-map "^" 'gnus-summary-refer-parent-article)
+  ;;(define-key gnus-summary-mode-map "\er" 'gnus-summary-refer-article)
+  (define-key gnus-summary-mode-map "\e^" 'gnus-summary-refer-article)
+  (define-key gnus-summary-mode-map "u" 'gnus-summary-mark-as-unread-forward)
+  (define-key gnus-summary-mode-map "U" 'gnus-summary-mark-as-unread-backward)
+  (define-key gnus-summary-mode-map "d" 'gnus-summary-mark-as-read-forward)
+  (define-key gnus-summary-mode-map "D" 'gnus-summary-mark-as-read-backward)
+  (define-key gnus-summary-mode-map "\eu" 'gnus-summary-clear-mark-forward)
+  (define-key gnus-summary-mode-map "\eU" 'gnus-summary-clear-mark-backward)
+  (define-key gnus-summary-mode-map "k" 'gnus-summary-kill-same-subject-and-select)
+  (define-key gnus-summary-mode-map "\C-k" 'gnus-summary-kill-same-subject)
+  (define-key gnus-summary-mode-map "\e\C-t" 'gnus-summary-toggle-threads)
+  (define-key gnus-summary-mode-map "\e\C-s" 'gnus-summary-show-thread)
+  (define-key gnus-summary-mode-map "\e\C-h" 'gnus-summary-hide-thread)
+  (define-key gnus-summary-mode-map "\e\C-f" 'gnus-summary-next-thread)
+  (define-key gnus-summary-mode-map "\e\C-b" 'gnus-summary-prev-thread)
+  (define-key gnus-summary-mode-map "\e\C-u" 'gnus-summary-up-thread)
+  (define-key gnus-summary-mode-map "\e\C-d" 'gnus-summary-down-thread)
+  (define-key gnus-summary-mode-map "\e\C-k" 'gnus-summary-kill-thread)
+  (define-key gnus-summary-mode-map "&" 'gnus-summary-execute-command)
+  ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup)
+  ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-all)
+  (define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-and-exit)
+  ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-all-and-exit)
+  (define-key gnus-summary-mode-map "\C-t" 'gnus-summary-toggle-truncation)
+  (define-key gnus-summary-mode-map "x" 'gnus-summary-delete-marked-as-read)
+  (define-key gnus-summary-mode-map "X" 'gnus-summary-delete-marked-with)
+  (define-key gnus-summary-mode-map "\C-c\C-sn" 'gnus-summary-sort-by-number)
+  (define-key gnus-summary-mode-map "\C-c\C-sa" 'gnus-summary-sort-by-author)
+  (define-key gnus-summary-mode-map "\C-c\C-ss" 'gnus-summary-sort-by-subject)
+  (define-key gnus-summary-mode-map "\C-c\C-sd" 'gnus-summary-sort-by-date)
+  (define-key gnus-summary-mode-map "\C-c\C-s\C-n" 'gnus-summary-sort-by-number)
+  (define-key gnus-summary-mode-map "\C-c\C-s\C-a" 'gnus-summary-sort-by-author)
+  (define-key gnus-summary-mode-map "\C-c\C-s\C-s" 'gnus-summary-sort-by-subject)
+  (define-key gnus-summary-mode-map "\C-c\C-s\C-d" 'gnus-summary-sort-by-date)
+  (define-key gnus-summary-mode-map "=" 'gnus-summary-expand-window)
+  ;;(define-key gnus-summary-mode-map "G" 'gnus-summary-reselect-current-group)
+  (define-key gnus-summary-mode-map "\C-x\C-s" 'gnus-summary-reselect-current-group)
+  (define-key gnus-summary-mode-map "w" 'gnus-summary-stop-page-breaking)
+  (define-key gnus-summary-mode-map "\C-c\C-r" 'gnus-summary-caesar-message)
+  (define-key gnus-summary-mode-map "g" 'gnus-summary-show-article)
+  (define-key gnus-summary-mode-map "t" 'gnus-summary-toggle-header)
+  ;;(define-key gnus-summary-mode-map "v" 'gnus-summary-show-all-headers)
+  (define-key gnus-summary-mode-map "\et" 'gnus-summary-toggle-mime)
+  (define-key gnus-summary-mode-map "\C-d" 'gnus-summary-rmail-digest)
+  (define-key gnus-summary-mode-map "a" 'gnus-summary-post-news)
+  (define-key gnus-summary-mode-map "f" 'gnus-summary-followup)
+  (define-key gnus-summary-mode-map "F" 'gnus-summary-followup-with-original)
+  (define-key gnus-summary-mode-map "C" 'gnus-summary-cancel-article)
+  (define-key gnus-summary-mode-map "r" 'gnus-summary-reply)
+  (define-key gnus-summary-mode-map "R" 'gnus-summary-reply-with-original)
+  (define-key gnus-summary-mode-map "\C-c\C-f" 'gnus-summary-mail-forward)
+  (define-key gnus-summary-mode-map "m" 'gnus-summary-mail-other-window)
+  (define-key gnus-summary-mode-map "o" 'gnus-summary-save-article)
+  (define-key gnus-summary-mode-map "\C-o" 'gnus-summary-save-in-mail)
+  (define-key gnus-summary-mode-map "|" 'gnus-summary-pipe-output)
+  (define-key gnus-summary-mode-map "\ek" 'gnus-summary-edit-local-kill)
+  (define-key gnus-summary-mode-map "\eK" 'gnus-summary-edit-global-kill)
+  (define-key gnus-summary-mode-map "V" 'gnus-version)
+  (define-key gnus-summary-mode-map "q" 'gnus-summary-exit)
+  (define-key gnus-summary-mode-map "Q" 'gnus-summary-quit)
+  (define-key gnus-summary-mode-map "?" 'gnus-summary-describe-briefly)
+  (define-key gnus-summary-mode-map "\C-c\C-i" 'gnus-info-find-node))
+
+(defun gnus-summary-mode ()
   "Major mode for reading articles in this newsgroup.
 All normal editing commands are turned off.
 Instead, these commands are available:
-\\{gnus-Subject-mode-map}
+
+SPC	Scroll to the next page of the current article.  The next unread
+	article is selected automatically at the end of the message.
+DEL	Scroll to the previous page of the current article.
+RET	Scroll up (or down) one line the current article.
+n	Move to the next unread article.
+p	Move to the previous unread article.
+N	Move to the next article.
+P	Move to the previous article.
+ESC C-n	Move to the next article which has the same subject as the
+	current article.
+ESC C-p	Move to the previous article which has the same subject as the
+	current article.
+\\[gnus-summary-next-unread-same-subject]
+	Move to the next unread article which has the same subject as the
+	current article.
+\\[gnus-summary-prev-unread-same-subject]
+	Move to the previous unread article which has the same subject as
+	the current article.
+C-c C-n	Scroll to the next digested message of the current article.
+C-c C-p	Scroll to the previous digested message of the current article.
+C-n	Move to the next subject.
+C-p	Move to the previous subject.
+ESC n	Move to the next unread subject.
+ESC p	Move to the previous unread subject.
+\\[gnus-summary-next-group]
+	Exit the current newsgroup and select the next unread newsgroup.
+\\[gnus-summary-prev-group]
+	Exit the current newsgroup and select the previous unread newsgroup.
+.	Jump to the first unread article in the current newsgroup.
+s	Do an incremental search forward on the current article.
+ESC s	Search for an article containing a regexp forward.
+ESC r	Search for an article containing a regexp backward.
+<	Move point to the beginning of the current article.
+>	Move point to the end of the current article.
+j	Jump to the article specified by the numeric article ID.
+l	Jump to the article you read last.
+^	Refer to parent of the current article.
+ESC ^	Refer to the article specified by the Message-ID.
+u	Mark the current article as unread, and go forward.
+U	Mark the current article as unread, and go backward.
+d	Mark the current article as read, and go forward.
+D	Mark the current article as read, and go backward.
+ESC u	Clear the current article's mark, and go forward.
+ESC U	Clear the current article's mark, and go backward.
+k	Mark articles which has the same subject as the current article as
+	read, and then select the next unread article.
+C-k	Mark articles which has the same subject as the current article as
+	read.
+ESC k	Edit a local KILL file applied to the current newsgroup.
+ESC K	Edit a global KILL file applied to all newsgroups.
+ESC C-t	Toggle showing conversation threads.
+ESC C-s	Show thread subtrees.
+ESC C-h	Hide thread subtrees.
+\\[gnus-summary-show-all-threads]	Show all thread subtrees.
+\\[gnus-summary-hide-all-threads]	Hide all thread subtrees.
+ESC C-f	Go to the same level next thread.
+ESC C-b	Go to the same level previous thread.
+ESC C-d	Go downward current thread.
+ESC C-u	Go upward current thread.
+ESC C-k	Mark articles under current thread as read.
+&	Execute a command for each article conditionally.
+\\[gnus-summary-catchup]
+	Mark all articles as read in the current newsgroup, preserving
+	articles marked as unread.
+\\[gnus-summary-catchup-all]
+	Mark all articles as read in the current newsgroup.
+\\[gnus-summary-catchup-and-exit]
+	Catch up all articles not marked as unread, and then exit the
+	current newsgroup.
+\\[gnus-summary-catchup-all-and-exit]
+	Catch up all articles, and then exit the current newsgroup.
+C-t	Toggle truncations of subject lines.
+x	Delete subject lines marked as read.
+X	Delete subject lines with the specific marks.
+C-c C-s C-n	Sort subjects by article number.
+C-c C-s C-a	Sort subjects by article author.
+C-c C-s C-s	Sort subjects alphabetically.
+C-c C-s C-d	Sort subjects by date.
+=	Expand Summary window to show headers full window.
+C-x C-s	Reselect the current newsgroup. Prefix argument means to select all.
+w	Stop page breaking by linefeed.
+C-c C-r	Caesar rotates letters by 13/47 places.
+g	Force to show the current article.
+t	Show original article header if pruned header currently shown, or
+	vice versa.
+ESC-t	Toggle MIME processing.
+C-d	Run RMAIL on the current digest article.
+a	Post a new article.
+f	Post a reply article.
+F	Post a reply article with original article.
+C	Cancel the current article.
+r	Mail a message to the author.
+R	Mail a message to the author with original author.
+C-c C-f	Forward the current message to another user.
+m	Mail a message in other window.
+o	Save the current article in your favorite format.
+C-o	Append the current article to a file in Unix mail format.
+|	Pipe the contents of the current article to a subprocess.
+q	Quit reading news in the current newsgroup.
+Q	Quit reading news without recording unread articles information.
+V	Show the version number of this GNUS.
+?	Describe Summary mode commands briefly.
+C-h m	Describe Summary mode.
+C-c C-i	Read Info about Summary mode.
 
 User customizable variables:
  gnus-large-newsgroup
     The number of articles which indicates a large newsgroup. If the
     number of articles in a newsgroup is greater than the value, the
-    number of articles to be selected is asked for.  If the given value
-    N is positive, the last N articles is selected.  If N is negative,
-    the first N articles are selected.  An empty string means to select
+    number of articles to be selected is asked for. If the given value
+    N is positive, the last N articles is selected. If N is negative,
+    the first N articles are selected. An empty string means to select
     all articles.
 
  gnus-use-long-file-name
     Non-nil means that a newsgroup name is used as a default file name
-    to save articles to.  If it's nil, the directory form of a
+    to save articles to. If it's nil, the directory form of a
     newsgroup is used instead.
 
  gnus-default-article-saver
     Specifies your favorite article saver which is interactively
-    funcallable.  Following functions are available:
-
-	gnus-Subject-save-in-rmail (in Rmail format)
-	gnus-Subject-save-in-mail (in Unix mail format)
-	gnus-Subject-save-in-folder (in MH folder)
-	gnus-Subject-save-in-file (in article format).
+    funcallable. Following functions are available:
+
+	gnus-summary-save-in-rmail (in Rmail format)
+	gnus-summary-save-in-mail (in Unix mail format)
+	gnus-summary-save-in-folder (in MH folder)
+	gnus-summary-save-in-file (in article format).
 
  gnus-rmail-save-name
  gnus-mail-save-name
@@ -1560,12 +1925,13 @@
     Specifies a function generating a file name to save articles in
     specified format.  The function is called with NEWSGROUP, HEADERS,
     and optional LAST-FILE.  Access macros to the headers are defined
-    as nntp-header-FIELD, and functions are defined as `gnus-header-FIELD'.
+    as nntp-header-FIELD, and functions are defined as
+    gnus-header-FIELD.
 
  gnus-article-save-directory
     Specifies a directory name to save articles to using the commands
-    `gnus-Subject-save-in-rmail', `gnus-Subject-save-in-mail' and
-    `gnus-Subject-save-in-file'.  The variable is initialized from the
+    gnus-summary-save-in-rmail, gnus-summary-save-in-mail and
+    gnus-summary-save-in-file. The variable is initialized from the
     SAVEDIR environment variable.
 
  gnus-show-all-headers
@@ -1574,6 +1940,9 @@
  gnus-save-all-headers
     Non-nil means that all headers of an article are saved in a file.
 
+ gnus-show-mime
+    Non-nil means that show a MIME message.
+
  gnus-show-threads
     Non-nil means that conversation threads are shown in tree structure.
 
@@ -1595,7 +1964,7 @@
 
  gnus-optional-headers
     Specifies a function which generates an optional string displayed
-    in the Subject buffer.  The function is called with an article
+    in the Summary buffer. The function is called with an article
     HEADERS.  The result must be a string excluding `[' and `]'.  The
     default function returns a string like NNN:AUTHOR, where NNN is
     the number of lines in an article and AUTHOR is the name of the
@@ -1607,17 +1976,17 @@
 
  gnus-auto-select-first
     Non-nil means the first unread article is selected automagically
-    when a newsgroup is selected normally (by gnus-Group-read-group).
+    when a newsgroup is selected normally (by gnus-group-read-group).
     If you'd like to prevent automatic selection of the first unread
     article in some newsgroups, set the variable to nil in
-    gnus-Select-group-hook or gnus-Apply-kill-hook.
+    gnus-select-group-hook or gnus-apply-kill-hook.
 
  gnus-auto-select-next
     Non-nil means the next newsgroup is selected automagically at the
     end of the newsgroup. If the value is t and the next newsgroup is
-    empty (no unread articles), GNUS will exit Subject mode and go
+    empty (no unread articles), GNUS will exit Summary mode and go
     back to Group mode. If the value is neither nil nor t, GNUS won't
-    exit Subject mode but select the following unread newsgroup.
+    exit Summary mode but select the following unread newsgroup.
     Especially, if the value is the symbol `quietly', the next unread
     newsgroup will be selected without any confirmations.
 
@@ -1625,8 +1994,8 @@
     Non-nil means an article with the same subject as the current
     article is selected automagically like `rn -S'.
 
- gnus-auto-center-subject
-    Non-nil means the point of Subject Mode window is always kept
+ gnus-auto-center-summary
+    Non-nil means the point of Summary Mode window is always kept
     centered.
 
  gnus-break-pages
@@ -1643,7 +2012,8 @@
 
  gnus-digest-show-summary
     Non-nil means that a summary of digest messages is shown when
-    reading a digest article using `gnus-Subject-rmail-digest' command.
+    reading a digest article using `gnus-summary-rmail-digest'
+    command.
 
  gnus-digest-separator
     Specifies a regexp separating messages in a digest article.
@@ -1651,65 +2021,70 @@
  gnus-mail-reply-method
  gnus-mail-other-window-method
     Specifies a function to begin composing mail message using
-    commands gnus-Subject-mail-reply and
-    gnus-Subject-mail-other-window.  Functions
-    gnus-mail-reply-using-mail and gnus-mail-reply-using-mhe are
-    available for the value of gnus-mail-reply-method.  And functions
-    gnus-mail-other-window-using-mail and
+    commands gnus-summary-reply and gnus-summary-mail-other-window.
+    Functions gnus-mail-reply-using-mail and gnus-mail-reply-using-mhe
+    are available for the value of gnus-mail-reply-method.  And
+    functions gnus-mail-other-window-using-mail and
     gnus-mail-other-window-using-mhe are available for the value of
     gnus-mail-other-window-method.
 
+ gnus-mail-send-method
+    Specifies a function to mail a message too which is being posted
+    as an article.  The message must have To: or Cc: field.  The value
+    of the variable send-mail-function is the default function which
+    uses sendmail mail program.
+
 Various hooks for customization:
- gnus-Subject-mode-hook
+ gnus-summary-mode-hook
     Entry to this mode calls the value with no arguments, if that
     value is non-nil.
 
- gnus-Select-group-hook
+ gnus-select-group-hook
     Called with no arguments when newsgroup is selected, if that value
-    is non-nil.  It is possible to sort subjects in this hook.  See the
+    is non-nil. It is possible to sort subjects in this hook. See the
     documentation of this variable for more information.
 
- gnus-Subject-prepare-hook
-    Called with no arguments after a subject list is created in the
-    Subject buffer, if that value is non-nil.  If you'd like to modify
+ gnus-summary-prepare-hook
+    Called with no arguments after a summary list is created in the
+    Summary buffer, if that value is non-nil. If you'd like to modify
     the buffer, you can use this hook.
 
- gnus-Select-article-hook
+ gnus-select-article-hook
     Called with no arguments when an article is selected, if that
-    value is non-nil.  See the documentation of this variable for
-    more information.
-
- gnus-Select-digest-hook
+    value is non-nil. See the documentation of this variable for more
+    information.
+
+ gnus-select-digest-hook
     Called with no arguments when reading digest messages using Rmail,
-    if that value is non-nil.  This hook can be used to modify an
-    article so that Rmail can work with it.  See the documentation of
+    if that value is non-nil. This hook can be used to modify an
+    article so that Rmail can work with it. See the documentation of
     the variable for more information.
 
- gnus-Rmail-digest-hook
+ gnus-rmail-digest-hook
     Called with no arguments when reading digest messages using Rmail,
-    if that value is non-nil.  This hook is intended to customize Rmail
+    if that value is non-nil. This hook is intended to customize Rmail
     mode.
 
- gnus-Apply-kill-hook
+ gnus-apply-kill-hook
     Called with no arguments when a newsgroup is selected and the
-    Subject buffer is prepared.  This hook is intended to apply a KILL
-    file to the selected newsgroup.  The format of KILL file is
+    Summary buffer is prepared. This hook is intended to apply a KILL
+    file to the selected newsgroup. The format of KILL file is
     completely different from that of version 3.8. You have to rewrite
-    them in the new format.  See the documentation of Kill file mode
+    them in the new format. See the documentation of Kill file mode
     for more information.
 
- gnus-Mark-article-hook
+ gnus-mark-article-hook
     Called with no arguments when an article is selected at the first
-    time.  The hook is intended to mark an article as read (or unread)
+    time. The hook is intended to mark an article as read (or unread)
     automatically when it is selected.  See the documentation of the
     variable for more information.
 
- gnus-Exit-group-hook
+ gnus-exit-group-hook
     Called with no arguments when exiting the current newsgroup, if
-    that value is non-nil.  If your machine is so slow that exiting
-    from Subject mode takes very long time, inhibit marking articles
+    that value is non-nil. If your machine is so slow that exiting
+    from Summary mode takes very long time, inhibit marking articles
     as read using cross-references by setting the variable
-    `gnus-newsgroup-headers' to nil in this hook."
+    gnus-use-cross-reference to nil in this hook."
   (interactive)
   (kill-all-local-variables)
   ;; Gee.  Why don't you upgrade?
@@ -1718,38 +2093,39 @@
 	((listp (default-value 'mode-line-format))
 	 (setq mode-line-format
 	       (cons "--- " (cdr (default-value 'mode-line-format))))))
-  (make-local-variable 'global-mode-string)
-  (setq global-mode-string nil)
-  (setq major-mode 'gnus-Subject-mode)
-  (setq mode-name "Subject")
+  ;; To disable display-time facility.
+  ;;(make-local-variable 'global-mode-string)
+  ;;(setq global-mode-string nil)
+  (setq major-mode 'gnus-summary-mode)
+  (setq mode-name "Summary")
   ;;(setq mode-line-process '(" " gnus-newsgroup-name))
   (make-local-variable 'minor-mode-alist)
   (or (assq 'gnus-show-threads minor-mode-alist)
       (setq minor-mode-alist
 	    (cons (list 'gnus-show-threads " Thread") minor-mode-alist)))
-  (gnus-Subject-set-mode-line)
-  (use-local-map gnus-Subject-mode-map)
-  (buffer-disable-undo (current-buffer))
+  (gnus-summary-set-mode-line)
+  (use-local-map gnus-summary-mode-map)
+  (buffer-flush-undo (current-buffer))
   (setq buffer-read-only t)		;Disable modification
   (setq truncate-lines t)		;Stop line folding
   (setq selective-display t)
   (setq selective-display-ellipses t)	;Display `...'
   ;;(setq case-fold-search t)
-  (run-hooks 'gnus-Subject-mode-hook))
-
-(defun gnus-Subject-setup-buffer ()
-  "Initialize subject display buffer."
-  (if (get-buffer gnus-Subject-buffer)
-      (set-buffer gnus-Subject-buffer)
-    (set-buffer (get-buffer-create gnus-Subject-buffer))
-    (gnus-Subject-mode)
+  (run-hooks 'gnus-summary-mode-hook))
+
+(defun gnus-summary-setup-buffer ()
+  "Initialize Summary buffer."
+  (if (get-buffer gnus-summary-buffer)
+      (set-buffer gnus-summary-buffer)
+    (set-buffer (get-buffer-create gnus-summary-buffer))
+    (gnus-summary-mode)
     ))
 
-(defun gnus-Subject-read-group (group &optional show-all no-article)
+(defun gnus-summary-read-group (group &optional show-all no-article)
   "Start reading news in newsgroup GROUP.
-If optional first argument SHOW-ALL is non-nil, already read articles are
+If optional 1st argument SHOW-ALL is non-nil, already read articles are
 also listed.
-If optional second argument NO-ARTICLE is non-nil, no article is selected
+If optional 2nd argument NO-ARTICLE is non-nil, no article is selected
 initially."
   (message "Retrieving newsgroup: %s..." group)
   (if (gnus-select-newsgroup group show-all)
@@ -1757,48 +2133,48 @@
 	;; Don't switch-to-buffer to prevent displaying old contents
 	;;  of the buffer until new subjects list is created.
 	;; Suggested by Juha Heinanen <jh@tut.fi>
-	(gnus-Subject-setup-buffer)
+	(gnus-summary-setup-buffer)
 	;; You can change the order of subjects in this hook.
-	(run-hooks 'gnus-Select-group-hook)
-	(gnus-Subject-prepare)
+	(run-hooks 'gnus-select-group-hook)
+	(gnus-summary-prepare)
 	;; Function `gnus-apply-kill-file' must be called in this hook.
-	(run-hooks 'gnus-Apply-kill-hook)
+	(run-hooks 'gnus-apply-kill-hook)
 	(if (zerop (buffer-size))
 	    ;; This newsgroup is empty.
 	    (progn
-	      (gnus-Subject-catch-up-and-exit nil t) ;Without confirmations.
+	      (gnus-summary-catchup-and-exit nil t) ;Without confirmations.
 	      (message "No unread news"))
 	  ;; Hide conversation thread subtrees.  We cannot do this in
-	  ;; gnus-Subject-prepare-hook since kill processing may not
+	  ;; gnus-summary-prepare-hook since kill processing may not
 	  ;; work with hidden articles.
 	  (and gnus-show-threads
 	       gnus-thread-hide-subtree
-	       (gnus-Subject-hide-all-threads))
+	       (gnus-summary-hide-all-threads))
 	  ;; Show first unread article if requested.
 	  (goto-char (point-min))
 	  (if (and (not no-article)
 		   gnus-auto-select-first
-		   (gnus-Subject-first-unread-article))
+		   (gnus-summary-first-unread-article))
 	      ;; Window is configured automatically.
 	      ;; Current buffer may be changed as a result of hook
-	      ;; evaluation, especially by gnus-Subject-rmail-digest
+	      ;; evaluation, especially by gnus-summary-rmail-digest
 	      ;; command, so we should adjust cursor point carefully.
-	      (if (eq (current-buffer) (get-buffer gnus-Subject-buffer))
+	      (if (eq (current-buffer) (get-buffer gnus-summary-buffer))
 		  (progn
 		    ;; Adjust cursor point.
 		    (beginning-of-line)
 		    (search-forward ":" nil t)))
-	    (gnus-configure-windows 'SelectNewsgroup)
-	    (pop-to-buffer gnus-Subject-buffer)
-	    (gnus-Subject-set-mode-line)
+	    (gnus-configure-windows 'summary)
+	    (pop-to-buffer gnus-summary-buffer)
+	    (gnus-summary-set-mode-line)
 	    ;; I sometime get confused with the old Article buffer.
-	    (if (get-buffer gnus-Article-buffer)
-		(if (get-buffer-window gnus-Article-buffer)
+	    (if (get-buffer gnus-article-buffer)
+		(if (get-buffer-window gnus-article-buffer)
 		    (save-excursion
-		      (set-buffer gnus-Article-buffer)
+		      (set-buffer gnus-article-buffer)
 		      (let ((buffer-read-only nil))
 			(erase-buffer)))
-		  (kill-buffer gnus-Article-buffer)))
+		  (kill-buffer gnus-article-buffer)))
 	    ;; Adjust cursor point.
 	    (beginning-of-line)
 	    (search-forward ":" nil t))
@@ -1809,43 +2185,50 @@
 	  ;; If NNTP is used, nntp_access file may not be installed
 	  ;; properly.  Otherwise, may be active file problem.
 	  (ding)
-	  (message "Cannot select %s.  May be security or active file problem." group)
+	  (message
+	   (gnus-nntp-message
+	    (format "Cannot select %s.  May be security or active file problem." group)))
 	  (sit-for 0))
       ;; Check bogus newsgroups.
       ;; We must be in Group Mode buffer.
-      (gnus-Group-check-bogus-groups))
+      (gnus-group-check-bogus-groups))
     ))
 
-(defun gnus-Subject-prepare ()
-  "Prepare subject list of current newsgroup in Subject mode buffer."
+(defun gnus-summary-prepare ()
+  "Prepare summary list of current newsgroup in Summary buffer."
   (let ((buffer-read-only nil))
     ;; Note: The next codes are not actually used because the user who
-    ;; want it can define them in gnus-Select-group-hook.
+    ;; want it can define them in gnus-select-group-hook.
     ;; Print verbose messages if too many articles are selected.
     ;;    (and (numberp gnus-large-newsgroup)
     ;;       (> (length gnus-newsgroup-headers) gnus-large-newsgroup)
     ;;       (message "Preparing headers..."))
     (erase-buffer)
-    (gnus-Subject-prepare-threads
+    (gnus-summary-prepare-threads
      (if gnus-show-threads
 	 (gnus-make-threads gnus-newsgroup-headers)
        gnus-newsgroup-headers) 0)
     ;; Erase header retrieval message.
     (message "")
-    ;; Call hooks for modifying Subject mode buffer.
+    ;; Call hooks for modifying Summary buffer.
     ;; Suggested by sven@tde.LTH.Se (Sven Mattisson).
     (goto-char (point-min))
-    (run-hooks 'gnus-Subject-prepare-hook)
+    (run-hooks 'gnus-summary-prepare-hook)
     ))
 
 ;; Basic ideas by Paul Dworkin <paul@media-lab.media.mit.edu>
-
-(defun gnus-Subject-prepare-threads (threads level)
-  "Prepare Subject buffer from THREADS and indentation LEVEL.
-THREADS is a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...]).'"
+;; Subject bug fix by jbw@bigbird.bu.edu (Joe Wells)
+
+(defun gnus-summary-prepare-threads (threads level &optional parent-subject)
+  "Prepare Summary buffer from THREADS and indentation LEVEL.
+THREADS is a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...]).'
+Optional PARENT-SUBJECT specifies the subject of the parent."
   (let ((thread nil)
 	(header nil)
 	(number nil)
+	(subject nil)
+	(child-subject nil)
+	(parent-subject (or parent-subject ""))
 	;; `M Indent NUM: [OPT] SUBJECT'
 	(cntl (format "%%s %%s%%%dd: [%%s] %%s\n"
 		      (length (prin1-to-string gnus-newsgroup-end)))))
@@ -1861,6 +2244,8 @@
       (if (vectorp header)		;Depends on nntp.el.
 	  (progn
 	    (setq number (nntp-header-number header))
+	    (setq subject (nntp-header-subject header))
+	    (setq child-subject (gnus-simplify-subject subject 're-only))
 	    (insert
 	     (format cntl
 		     ;; Read or not.
@@ -1876,51 +2261,87 @@
 			      (funcall gnus-optional-headers header)) "")
 		     ;; Its subject string.
 		     (concat (if (or (zerop level)
-				     (not gnus-thread-hide-subject))
+				     (not gnus-thread-hide-subject)
+				     ;; Subject is different from the parent.
+				     (not (string-equal
+					   parent-subject child-subject)))
 				 nil
 			       (make-string (window-width) ? ))
-			     (nntp-header-subject header))
+			     subject)
 		     ))
 	    ))
       ;; Print subthreads.
       (and (consp thread)
 	   (cdr thread)
-	   (gnus-Subject-prepare-threads (cdr thread) (1+ level)))
+	   (gnus-summary-prepare-threads
+	    (cdr thread) (1+ level) child-subject))
       )))
 
-(defun gnus-Subject-set-mode-line ()
-  "Set Subject mode line string."
-  ;; The value must be a string to escape %-constructs.
-  (let ((subject
-	 (if gnus-current-headers
-	     (nntp-header-subject gnus-current-headers) gnus-newsgroup-name)))
+;;(defun gnus-summary-set-mode-line ()
+;;  "Set Summary mode line string."
+;;  ;; The value must be a string to escape %-constructs.
+;;  (let ((subject
+;;	 (if gnus-current-headers
+;;	     (nntp-header-subject gnus-current-headers) gnus-newsgroup-name)))
+;;    (setq mode-line-buffer-identification
+;;	  (concat "GNUS: "
+;;		  subject
+;;		  ;; Enough spaces to pad subject to 17 positions.
+;;		  (make-string (max 0 (- 17 (length subject))) ? ))))
+;;  (set-buffer-modified-p t))
+
+;; New implementation in gnus 3.14.3
+
+(defun gnus-summary-set-mode-line ()
+  "Set Summary mode line string.
+If you don't like it, define your own gnus-summary-set-mode-line."
+  (let ((unmarked
+	 (- (length gnus-newsgroup-unreads)
+	    (length (gnus-intersection
+		     gnus-newsgroup-unreads gnus-newsgroup-marked))))
+	(unselected
+	 (- (length gnus-newsgroup-unselected)
+	    (length (gnus-intersection
+		     gnus-newsgroup-unselected gnus-newsgroup-marked)))))
     (setq mode-line-buffer-identification
-	  (concat "GNUS: "
-		  subject
-		  ;; Enough spaces to pad subject to 17 positions.
-		  (make-string (max 0 (- 17 (length subject))) ? ))))
+	  (list 17
+		(format "GNUS: %s%s %s"
+			gnus-newsgroup-name
+			(if gnus-current-article
+			    (format "/%d" gnus-current-article) "")
+			;; Basic ideas by tale@pawl.rpi.edu.
+			(cond ((and (zerop unmarked)
+				    (zerop unselected))
+			       "")
+			      ((zerop unselected)
+			       (format "{%d more}" unmarked))
+			      (t
+			       (format "{%d(+%d) more}" unmarked unselected)))
+			))))
   (set-buffer-modified-p t))
 
-;; GNUS Subject mode command.
-
-(defun gnus-Subject-search-group (&optional backward)
+;; GNUS Summary mode command.
+
+(defun gnus-summary-search-group (&optional backward)
   "Search for next unread newsgroup.
 If optional argument BACKWARD is non-nil, search backward instead."
   (save-excursion
-    (set-buffer gnus-Group-buffer)
+    (set-buffer gnus-group-buffer)
     (save-excursion
       ;; We don't want to alter current point of Group mode buffer.
-      (if (gnus-Group-search-forward backward nil)
-	  (gnus-Group-group-name))
+      (if (gnus-group-search-forward backward nil)
+	  (gnus-group-group-name))
       )))
 
-(defun gnus-Subject-search-subject (backward unread subject)
+(defun gnus-summary-search-subject (backward unread subject)
   "Search for article forward.
-If first argument BACKWARD is non-nil, search backward.
-If second argument UNREAD is non-nil, only unread article is selected.
-If third argument SUBJECT is non-nil, the article which has
+If 1st argument BACKWARD is non-nil, search backward.
+If 2nd argument UNREAD is non-nil, only unread article is selected.
+If 3rd argument SUBJECT is non-nil, the article which has
 the same subject will be searched for."
-  (let ((func (if backward 're-search-backward 're-search-forward))
+  (let ((func
+	 (if backward
+	     (function re-search-backward) (function re-search-forward)))
 	(article nil)
 	;; We have to take care of hidden lines.
 	(regexp 
@@ -1948,21 +2369,21 @@
     article
     ))
 
-(defun gnus-Subject-search-forward (&optional unread subject)
+(defun gnus-summary-search-forward (&optional unread subject)
   "Search for article forward.
-If first optional argument UNREAD is non-nil, only unread article is selected.
-If second optional argument SUBJECT is non-nil, the article which has
+If 1st optional argument UNREAD is non-nil, only unread article is selected.
+If 2nd optional argument SUBJECT is non-nil, the article which has
 the same subject will be searched for."
-  (gnus-Subject-search-subject nil unread subject))
-
-(defun gnus-Subject-search-backward (&optional unread subject)
+  (gnus-summary-search-subject nil unread subject))
+
+(defun gnus-summary-search-backward (&optional unread subject)
   "Search for article backward.
-If first optional argument UNREAD is non-nil, only unread article is selected.
-If second optional argument SUBJECT is non-nil, the article which has
+If 1st optional argument UNREAD is non-nil, only unread article is selected.
+If 2nd optional argument SUBJECT is non-nil, the article which has
 the same subject will be searched for."
-  (gnus-Subject-search-subject t unread subject))
-
-(defun gnus-Subject-article-number ()
+  (gnus-summary-search-subject t unread subject))
+
+(defun gnus-summary-article-number ()
   "Article number around point. If nothing, return current number."
   (save-excursion
     (beginning-of-line)
@@ -1973,18 +2394,18 @@
       gnus-current-article
       )))
 
-(defun gnus-Subject-subject-string ()
+(defun gnus-summary-subject-string ()
   "Return current subject string or nil if nothing."
   (save-excursion
     ;; It is possible to implement this function using
-    ;;  `gnus-Subject-article-number' and `gnus-newsgroup-headers'.
+    ;;  `gnus-summary-article-number' and `gnus-newsgroup-headers'.
     (beginning-of-line)
     ;; We have to take care of hidden lines.
     (if (looking-at ".[ \t]+[0-9]+:.\\[[^]\r\n]*\\][ \t]+\\([^\r\n]*\\)[\r\n]")
 	(buffer-substring (match-beginning 1) (match-end 1)))
     ))
 
-(defun gnus-Subject-goto-subject (article)
+(defun gnus-summary-goto-subject (article)
   "Move point to ARTICLE's subject."
   (interactive
    (list
@@ -2003,185 +2424,188 @@
 	(progn (goto-char current) nil))
     ))
 
-(defun gnus-Subject-recenter ()
-  "Center point in Subject mode window."
-  ;; Scroll window so as to cursor comes center of Subject mode window
+(defun gnus-summary-recenter ()
+  "Center point in Summary window."
+  ;; Scroll window so as to cursor comes center of Summary window
   ;;  only when article is displayed.
   ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
   ;; Recenter only when requested.
-  ;; Suggested by popovich@park.cs.columbia.edu
-  (and gnus-auto-center-subject
-       (get-buffer-window gnus-Article-buffer)
+  ;; Subbested by popovich@park.cs.columbia.edu
+  (and gnus-auto-center-summary
+       (get-buffer-window gnus-article-buffer)
        (< (/ (- (window-height) 1) 2)
 	  (count-lines (point) (point-max)))
        (recenter (/ (- (window-height) 2) 2))))
 
 ;; Walking around Group mode buffer.
 
-(defun gnus-Subject-jump-to-group (newsgroup)
+(defun gnus-summary-jump-to-group (newsgroup)
   "Move point to NEWSGROUP in Group mode buffer."
   ;; Keep update point of Group mode buffer if visible.
   (if (eq (current-buffer)
-	  (get-buffer gnus-Group-buffer))
+	  (get-buffer gnus-group-buffer))
       (save-window-excursion
 	;; Take care of tree window mode.
-	(if (get-buffer-window gnus-Group-buffer)
-	    (pop-to-buffer gnus-Group-buffer))
-	(gnus-Group-jump-to-group newsgroup))
+	(if (get-buffer-window gnus-group-buffer)
+	    (pop-to-buffer gnus-group-buffer))
+	(gnus-group-jump-to-group newsgroup))
     (save-excursion
       ;; Take care of tree window mode.
-      (if (get-buffer-window gnus-Group-buffer)
-	  (pop-to-buffer gnus-Group-buffer)
-	(set-buffer gnus-Group-buffer))
-      (gnus-Group-jump-to-group newsgroup))))
-
-(defun gnus-Subject-next-group (no-article)
+      (if (get-buffer-window gnus-group-buffer)
+	  (pop-to-buffer gnus-group-buffer)
+	(set-buffer gnus-group-buffer))
+      (gnus-group-jump-to-group newsgroup))))
+
+(defun gnus-summary-next-group (no-article)
   "Exit current newsgroup and then select next unread newsgroup.
 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
   (interactive "P")
   ;; Make sure Group mode buffer point is on current newsgroup.
-  (gnus-Subject-jump-to-group gnus-newsgroup-name)
-  (let ((group (gnus-Subject-search-group)))
+  (gnus-summary-jump-to-group gnus-newsgroup-name)
+  (let ((group (gnus-summary-search-group)))
     (if (null group)
 	(progn
 	  (message "Exiting %s..." gnus-newsgroup-name)  
-	  (gnus-Subject-exit)
+	  (gnus-summary-exit)
 	  (message ""))
       (message "Selecting %s..." group)
-      (gnus-Subject-exit t)		;Exit Subject mode temporary.
+      (gnus-summary-exit t)		;Exit Summary mode temporary.
       ;; We are now in Group mode buffer.
       ;; Make sure Group mode buffer point is on GROUP.
-      (gnus-Subject-jump-to-group group)
-      (gnus-Subject-read-group group nil no-article)
+      (gnus-summary-jump-to-group group)
+      (gnus-summary-read-group group nil no-article)
       (or (eq (current-buffer)
-	      (get-buffer gnus-Subject-buffer))
+	      (get-buffer gnus-summary-buffer))
 	  (eq gnus-auto-select-next t)
 	  ;; Expected newsgroup has nothing to read since the articles
 	  ;; are marked as read by cross-referencing. So, try next
 	  ;; newsgroup. (Make sure we are in Group mode buffer now.)
 	  (and (eq (current-buffer)
-		   (get-buffer gnus-Group-buffer))
-	       (gnus-Group-group-name)
-	       (gnus-Subject-read-group
-		(gnus-Group-group-name) nil no-article))
+		   (get-buffer gnus-group-buffer))
+	       (gnus-group-group-name)
+	       (gnus-summary-read-group
+		(gnus-group-group-name) nil no-article))
 	  )
       )))
 
-(defun gnus-Subject-prev-group (no-article)
+(defun gnus-summary-prev-group (no-article)
   "Exit current newsgroup and then select previous unread newsgroup.
 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
   (interactive "P")
   ;; Make sure Group mode buffer point is on current newsgroup.
-  (gnus-Subject-jump-to-group gnus-newsgroup-name)
-  (let ((group (gnus-Subject-search-group t)))
+  (gnus-summary-jump-to-group gnus-newsgroup-name)
+  (let ((group (gnus-summary-search-group t)))
     (if (null group)
 	(progn
 	  (message "Exiting %s..." gnus-newsgroup-name)  
-	  (gnus-Subject-exit)
+	  (gnus-summary-exit)
 	  (message ""))
       (message "Selecting %s..." group)
-      (gnus-Subject-exit t)		;Exit Subject mode temporary.
+      (gnus-summary-exit t)		;Exit Summary mode temporary.
       ;; We are now in Group mode buffer.
       ;; We have to adjust point of Group mode buffer because current
       ;; point is moved to next unread newsgroup by exiting.
-      (gnus-Subject-jump-to-group group)
-      (gnus-Subject-read-group group nil no-article)
+      (gnus-summary-jump-to-group group)
+      (gnus-summary-read-group group nil no-article)
       (or (eq (current-buffer)
-	      (get-buffer gnus-Subject-buffer))
+	      (get-buffer gnus-summary-buffer))
 	  (eq gnus-auto-select-next t)
 	  ;; Expected newsgroup has nothing to read since the articles
 	  ;; are marked as read by cross-referencing. So, try next
 	  ;; newsgroup. (Make sure we are in Group mode buffer now.)
 	  (and (eq (current-buffer)
-		   (get-buffer gnus-Group-buffer))
-	       (gnus-Subject-search-group t)
-	       (gnus-Subject-read-group
-		(gnus-Subject-search-group t) nil no-article))
+		   (get-buffer gnus-group-buffer))
+	       (gnus-summary-search-group t)
+	       (gnus-summary-read-group
+		(gnus-summary-search-group t) nil no-article))
 	  )
       )))
 
-;; Walking around subject lines.
-
-(defun gnus-Subject-next-subject (n &optional unread)
-  "Go to next N'th subject line.
+;; Walking around summary lines.
+
+(defun gnus-summary-next-subject (n &optional unread)
+  "Go to next N'th summary line.
 If optional argument UNREAD is non-nil, only unread article is selected."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Subject-search-forward unread))
+	      (gnus-summary-search-forward unread))
     (setq n (1- n)))
-  (cond ((gnus-Subject-search-forward unread)
-	 (gnus-Subject-recenter))
+  (cond ((gnus-summary-search-forward unread)
+	 (gnus-summary-recenter))
 	(unread
 	 (message "No more unread articles"))
 	(t
 	 (message "No more articles"))
 	))
 
-(defun gnus-Subject-next-unread-subject (n)
-  "Go to next N'th unread subject line."
+(defun gnus-summary-next-unread-subject (n)
+  "Go to next N'th unread summary line."
   (interactive "p")
-  (gnus-Subject-next-subject n t))
-
-(defun gnus-Subject-prev-subject (n &optional unread)
-  "Go to previous N'th subject line.
+  (gnus-summary-next-subject n t))
+
+(defun gnus-summary-prev-subject (n &optional unread)
+  "Go to previous N'th summary line.
 If optional argument UNREAD is non-nil, only unread article is selected."
   (interactive "p")
   (while (and (> n 1)
-	      (gnus-Subject-search-backward unread))
+	      (gnus-summary-search-backward unread))
     (setq n (1- n)))
-  (cond ((gnus-Subject-search-backward unread)
-	 (gnus-Subject-recenter))
+  (cond ((gnus-summary-search-backward unread)
+	 (gnus-summary-recenter))
 	(unread
 	 (message "No more unread articles"))
 	(t
 	 (message "No more articles"))
 	))
 
-(defun gnus-Subject-prev-unread-subject (n)
-  "Go to previous N'th unread subject line."
+(defun gnus-summary-prev-unread-subject (n)
+  "Go to previous N'th unread summary line."
   (interactive "p")
-  (gnus-Subject-prev-subject n t))
-
-;; Walking around subject lines with displaying articles.
-
-(defun gnus-Subject-expand-window ()
-  "Expand Subject window to show headers full window."
+  (gnus-summary-prev-subject n t))
+
+;; Walking around summary lines with displaying articles.
+
+(defun gnus-summary-expand-window ()
+  "Expand Summary window to show headers full window."
   (interactive)
-  (gnus-configure-windows 'ExpandSubject)
-  (pop-to-buffer gnus-Subject-buffer))
-
-(defun gnus-Subject-display-article (article &optional all-header)
+  (gnus-configure-windows 'summary)
+  (pop-to-buffer gnus-summary-buffer))
+
+(defun gnus-summary-display-article (article &optional all-header)
   "Display ARTICLE in Article buffer."
   (if (null article)
       nil
-    (gnus-configure-windows 'SelectArticle)
-    (pop-to-buffer gnus-Subject-buffer)
-    (gnus-Article-prepare article all-header)
-    (gnus-Subject-recenter)
-    (gnus-Subject-set-mode-line)
-    (run-hooks 'gnus-Select-article-hook)
+    (gnus-configure-windows 'article)
+    (pop-to-buffer gnus-summary-buffer)
+    (gnus-article-prepare article all-header)
+    (gnus-summary-recenter)
+    (gnus-summary-set-mode-line)
+    (run-hooks 'gnus-select-article-hook)
     ;; Successfully display article.
     t
     ))
 
-(defun gnus-Subject-select-article (&optional all-headers force)
+(defun gnus-summary-select-article (&optional all-headers force)
   "Select the current article.
-Optional argument ALL-HEADERS is non-nil, show all headers."
-  (let ((article (gnus-Subject-article-number)))
+Optional first argument ALL-HEADERS is non-nil, show all header fields.
+Optional second argument FORCE is nil, the article is only selected
+again when current header does not match with ALL-HEADERS option."
+  (let ((article (gnus-summary-article-number))
+	(all-headers (not (not all-headers)))) ;Must be T or NIL.
     (if (or (null gnus-current-article)
 	    (/= article gnus-current-article)
 	    (and force (not (eq all-headers gnus-have-all-headers))))
-	;; The selected subject is different from that of the current article.
-	(gnus-Subject-display-article article all-headers)
-      (gnus-configure-windows 'SelectArticle)
-      (pop-to-buffer gnus-Subject-buffer))
+	;; The selected one is different from that of the current article.
+	(gnus-summary-display-article article all-headers)
+      (gnus-configure-windows 'article)
+      (pop-to-buffer gnus-summary-buffer))
     ))
 
-(defun gnus-Subject-set-current-mark (&optional current-mark)
+(defun gnus-summary-set-current-mark (&optional current-mark)
   "Put `+' at the current article.
 Optional argument specifies CURRENT-MARK instead of `+'."
   (save-excursion
-    (set-buffer gnus-Subject-buffer)
+    (set-buffer gnus-summary-buffer)
     (let ((buffer-read-only nil))
       (goto-char (point-min))
       ;; First of all clear mark at last article.
@@ -2196,43 +2620,56 @@
 	    (insert (or current-mark "+"))))
       )))
 
-(defun gnus-Subject-next-article (unread &optional subject)
+;;(defun gnus-summary-next-article (unread &optional subject)
+;;  "Select article after current one.
+;;If argument UNREAD is non-nil, only unread article is selected."
+;;  (interactive "P")
+;;  (cond ((gnus-summary-display-article
+;;	  (gnus-summary-search-forward unread subject)))
+;;	(unread
+;;	 (message "No more unread articles"))
+;;	(t
+;;	 (message "No more articles"))
+;;	))
+
+(defun gnus-summary-next-article (unread &optional subject)
   "Select article after current one.
 If argument UNREAD is non-nil, only unread article is selected."
   (interactive "P")
   (let ((header nil))
-    (cond ((gnus-Subject-display-article
-	    (gnus-Subject-search-forward unread subject)))
+    (cond ((gnus-summary-display-article
+	    (gnus-summary-search-forward unread subject)))
 	  ((and subject
 		gnus-auto-select-same
 		(gnus-set-difference gnus-newsgroup-unreads
 				     gnus-newsgroup-marked)
 		(memq this-command
-		      '(gnus-Subject-next-unread-article
-			gnus-Subject-next-page
-			gnus-Subject-kill-same-subject-and-select
-			;;gnus-Subject-next-article
-			;;gnus-Subject-next-same-subject
-			;;gnus-Subject-next-unread-same-subject
+		      '(gnus-summary-next-unread-article
+			gnus-summary-next-page
+			gnus-summary-kill-same-subject-and-select
+			;;gnus-summary-next-article
+			;;gnus-summary-next-same-subject
+			;;gnus-summary-next-unread-same-subject
 			)))
 	   ;; Wrap article pointer if there are unread articles.
-	   ;; Hook function, such as gnus-Subject-rmail-digest, may
+	   ;; Hook function, such as gnus-summary-rmail-digest, may
 	   ;; change current buffer, so need check.
 	   (let ((buffer (current-buffer))
 		 (last-point (point)))
 	     ;; No more articles with same subject, so jump to the first
 	     ;; unread article.
-	     (gnus-Subject-first-unread-article)
+	     (gnus-summary-first-unread-article)
 	     ;;(and (eq buffer (current-buffer))
 	     ;;	(= (point) last-point)
 	     ;;	;; Ignore given SUBJECT, and try again.
-	     ;;	(gnus-Subject-next-article unread nil))
+	     ;;	(gnus-summary-next-article unread nil))
 	     (and (eq buffer (current-buffer))
 		  (< (point) last-point)
 		  (message "Wrapped"))
 	     ))
-	  ((and (not unread)
-		gnus-auto-extend-newsgroup
+	  ((and gnus-auto-extend-newsgroup
+		(not unread)		;Not unread only
+		(not subject)		;Only if subject is not specified.
 		(setq header (gnus-more-header-forward)))
 	   ;; Extend to next article if possible.
 	   ;; Basic ideas by himacdonald@watdragon.waterloo.edu
@@ -2240,24 +2677,24 @@
 	   ;; Threads feature must be turned off.
 	   (let ((buffer-read-only nil))
 	     (goto-char (point-max))
-	     (gnus-Subject-prepare-threads (list header) 0))
-	   (gnus-Subject-goto-article gnus-newsgroup-end))
+	     (gnus-summary-prepare-threads (list header) 0))
+	   (gnus-summary-goto-article gnus-newsgroup-end))
 	  (t
 	   ;; Select next newsgroup automatically if requested.
 	   (let ((cmd (string-to-char (this-command-keys)))
-		 (group (gnus-Subject-search-group))
+		 (group (gnus-summary-search-group))
 		 (auto-select
 		  (and gnus-auto-select-next
 		       ;;(null (gnus-set-difference gnus-newsgroup-unreads
 		       ;;				gnus-newsgroup-marked))
 		       (memq this-command
-			     '(gnus-Subject-next-unread-article
-			       gnus-Subject-next-article
-			       gnus-Subject-next-page
-			       gnus-Subject-next-same-subject
-			       gnus-Subject-next-unread-same-subject
-			       gnus-Subject-kill-same-subject
-			       gnus-Subject-kill-same-subject-and-select
+			     '(gnus-summary-next-unread-article
+			       gnus-summary-next-article
+			       gnus-summary-next-page
+			       gnus-summary-next-same-subject
+			       gnus-summary-next-unread-same-subject
+			       gnus-summary-kill-same-subject
+			       gnus-summary-kill-same-subject-and-select
 			       ))
 		       ;; Ignore characters typed ahead.
 		       (not (input-pending-p))
@@ -2267,7 +2704,7 @@
 		      (if (and auto-select
 			       (not (eq gnus-auto-select-next 'quietly)))
 			  (if group
-			      (format " (Type %s to %s [%d])"
+			      (format " (Type %s for %s [%d])"
 				      (key-description (char-to-string cmd))
 				      group
 				      (nth 1 (gnus-gethash group
@@ -2281,145 +2718,146 @@
 	     (cond ((and auto-select
 			 (eq gnus-auto-select-next 'quietly))
 		    ;; Select quietly.
-		    (gnus-Subject-next-group nil))
+		    (gnus-summary-next-group nil))
 		   (auto-select
 		    ;; Confirm auto selection.
 		    (let ((char (read-char)))
 		      (if (= char cmd)
-			  (gnus-Subject-next-group nil)
-			(setq unread-command-events (list char)))))
+			  (gnus-summary-next-group nil)
+			(setq unread-command-char char))))
 		   )
 	     ))
 	  )))
 
-(defun gnus-Subject-next-unread-article ()
+(defun gnus-summary-next-unread-article ()
   "Select unread article after current one."
   (interactive)
-  (gnus-Subject-next-article t (and gnus-auto-select-same
-				    (gnus-Subject-subject-string))))
-
-(defun gnus-Subject-prev-article (unread &optional subject)
+  (gnus-summary-next-article t (and gnus-auto-select-same
+				    (gnus-summary-subject-string))))
+
+(defun gnus-summary-prev-article (unread &optional subject)
   "Select article before current one.
 If argument UNREAD is non-nil, only unread article is selected."
   (interactive "P")
   (let ((header nil))
-    (cond ((gnus-Subject-display-article
-	    (gnus-Subject-search-backward unread subject)))
+    (cond ((gnus-summary-display-article
+	    (gnus-summary-search-backward unread subject)))
 	  ((and subject
 		gnus-auto-select-same
 		(gnus-set-difference gnus-newsgroup-unreads
 				     gnus-newsgroup-marked)
 		(memq this-command
-		      '(gnus-Subject-prev-unread-article
-			;;gnus-Subject-prev-page
-			;;gnus-Subject-prev-article
-			;;gnus-Subject-prev-same-subject
-			;;gnus-Subject-prev-unread-same-subject
+		      '(gnus-summary-prev-unread-article
+			;;gnus-summary-prev-page
+			;;gnus-summary-prev-article
+			;;gnus-summary-prev-same-subject
+			;;gnus-summary-prev-unread-same-subject
 			)))
 	   ;; Ignore given SUBJECT, and try again.
-	   (gnus-Subject-prev-article unread nil))
+	   (gnus-summary-prev-article unread nil))
 	  (unread
 	   (message "No more unread articles"))
 	  ((and gnus-auto-extend-newsgroup
+		(not subject)		;Only if subject is not specified.
 		(setq header (gnus-more-header-backward)))
 	   ;; Extend to previous article if possible.
 	   ;; Basic ideas by himacdonald@watdragon.waterloo.edu
 	   (gnus-extend-newsgroup header t)
 	   (let ((buffer-read-only nil))
 	     (goto-char (point-min))
-	     (gnus-Subject-prepare-threads (list header) 0))
-	   (gnus-Subject-goto-article gnus-newsgroup-begin))
+	     (gnus-summary-prepare-threads (list header) 0))
+	   (gnus-summary-goto-article gnus-newsgroup-begin))
 	  (t
 	   (message "No more articles"))
 	  )))
 
-(defun gnus-Subject-prev-unread-article ()
+(defun gnus-summary-prev-unread-article ()
   "Select unred article before current one."
   (interactive)
-  (gnus-Subject-prev-article t (and gnus-auto-select-same
-				    (gnus-Subject-subject-string))))
-
-(defun gnus-Subject-next-page (lines)
+  (gnus-summary-prev-article t (and gnus-auto-select-same
+				    (gnus-summary-subject-string))))
+
+(defun gnus-summary-next-page (lines)
   "Show next page of selected article.
 If end of artile, select next article.
 Argument LINES specifies lines to be scrolled up."
   (interactive "P")
-  (let ((article (gnus-Subject-article-number))
+  (let ((article (gnus-summary-article-number))
 	(endp nil))
     (if (or (null gnus-current-article)
 	    (/= article gnus-current-article))
 	;; Selected subject is different from current article's.
-	(gnus-Subject-display-article article)
-      (gnus-configure-windows 'SelectArticle)
-      (pop-to-buffer gnus-Subject-buffer)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
-	(setq endp (gnus-Article-next-page lines)))
+	(gnus-summary-display-article article)
+      (gnus-configure-windows 'article)
+      (pop-to-buffer gnus-summary-buffer)
+      (gnus-eval-in-buffer-window gnus-article-buffer
+	(setq endp (gnus-article-next-page lines)))
       (cond ((and endp lines)
 	     (message "End of message"))
 	    ((and endp (null lines))
-	     (gnus-Subject-next-unread-article)))
+	     (gnus-summary-next-unread-article)))
       )))
 
-(defun gnus-Subject-prev-page (lines)
+(defun gnus-summary-prev-page (lines)
   "Show previous page of selected article.
 Argument LINES specifies lines to be scrolled down."
   (interactive "P")
-  (let ((article (gnus-Subject-article-number)))
+  (let ((article (gnus-summary-article-number)))
     (if (or (null gnus-current-article)
 	    (/= article gnus-current-article))
 	;; Selected subject is different from current article's.
-	(gnus-Subject-display-article article)
-      (gnus-configure-windows 'SelectArticle)
-      (pop-to-buffer gnus-Subject-buffer)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
-	(gnus-Article-prev-page lines))
+	(gnus-summary-display-article article)
+      (gnus-configure-windows 'article)
+      (pop-to-buffer gnus-summary-buffer)
+      (gnus-eval-in-buffer-window gnus-article-buffer
+	(gnus-article-prev-page lines))
       )))
 
-(defun gnus-Subject-scroll-up (lines)
+(defun gnus-summary-scroll-up (lines)
   "Scroll up (or down) one line current article.
 Argument LINES specifies lines to be scrolled up (or down if negative)."
   (interactive "p")
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (cond ((> lines 0)
-	   (if (gnus-Article-next-page lines)
+	   (if (gnus-article-next-page lines)
 	       (message "End of message")))
 	  ((< lines 0)
-	   (gnus-Article-prev-page (- 0 lines))))
+	   (gnus-article-prev-page (- 0 lines))))
     ))
 
-(defun gnus-Subject-next-same-subject ()
+(defun gnus-summary-next-same-subject ()
   "Select next article which has the same subject as current one."
   (interactive)
-  (gnus-Subject-next-article nil (gnus-Subject-subject-string)))
-
-(defun gnus-Subject-prev-same-subject ()
+  (gnus-summary-next-article nil (gnus-summary-subject-string)))
+
+(defun gnus-summary-prev-same-subject ()
   "Select previous article which has the same subject as current one."
   (interactive)
-  (gnus-Subject-prev-article nil (gnus-Subject-subject-string)))
-
-(defun gnus-Subject-next-unread-same-subject ()
+  (gnus-summary-prev-article nil (gnus-summary-subject-string)))
+
+(defun gnus-summary-next-unread-same-subject ()
   "Select next unread article which has the same subject as current one."
   (interactive)
-  (gnus-Subject-next-article t (gnus-Subject-subject-string)))
-
-(defun gnus-Subject-prev-unread-same-subject ()
+  (gnus-summary-next-article t (gnus-summary-subject-string)))
+
+(defun gnus-summary-prev-unread-same-subject ()
   "Select previous unread article which has the same subject as current one."
   (interactive)
-  (gnus-Subject-prev-article t (gnus-Subject-subject-string)))
-
-(defun gnus-Subject-refer-parent-article (child)
+  (gnus-summary-prev-article t (gnus-summary-subject-string)))
+
+(defun gnus-summary-refer-parent-article (child)
   "Refer parent article of current article.
 If a prefix argument CHILD is non-nil, go back to the child article
 using internally maintained articles history.
 NOTE: This command may not work with nnspool.el."
   (interactive "P")
-  (gnus-Subject-select-article t t)	;Request all headers.
+  (gnus-summary-select-article t t)	;Request all headers.
   (let ((referenced-id nil))		;Message-id of parent or child article.
     (if child
 	;; Go back to child article using history.
-	(gnus-Subject-refer-article nil)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
+	(gnus-summary-refer-article nil)
+      (gnus-eval-in-buffer-window gnus-article-buffer
 	;; Look for parent Message-ID.
 	;; We cannot use gnus-current-headers to get references
 	;; because we may be looking at parent or refered article.
@@ -2432,23 +2870,23 @@
 				(match-beginning 1) (match-end 1))))
 	  ))
       (if (stringp referenced-id)
-	  (gnus-Subject-refer-article referenced-id)
+	  (gnus-summary-refer-article referenced-id)
 	(error "No more parents"))
       )))
 
-(defun gnus-Subject-refer-article (message-id)
+(defun gnus-summary-refer-article (message-id)
   "Refer article specified by MESSAGE-ID.
-If MESSAGE-ID is nil or an empty string, it is popped from an
+If the MESSAGE-ID is nil or an empty string, Message-ID is poped from
 internally maintained articles history.
-NOTE: This command may not work with nnspool.el."
+NOTE: This command may not work with nnspool.el nor mhspool.el."
   (interactive "sMessage-ID: ")
   ;; Make sure that this command depends on the fact that article
   ;; related information is not updated when an article is retrieved
   ;; by Message-ID.
-  (gnus-Subject-select-article t t)	;Request all headers.
+  (gnus-summary-select-article t t)	;Request all headers.
   (if (and (stringp message-id)
 	   (> (length message-id) 0))
-      (gnus-eval-in-buffer-window gnus-Article-buffer
+      (gnus-eval-in-buffer-window gnus-article-buffer
 	;; Construct the correct Message-ID if necessary.
 	;; Suggested by tale@pawl.rpi.edu.
 	(or (string-match "^<" message-id)
@@ -2469,53 +2907,54 @@
     (setq message-id (car gnus-current-history))
     (setq gnus-current-history (cdr gnus-current-history)))
   (if (stringp message-id)
-      ;; Retrieve article by message-id.  This may not work with nnspool.
-      (gnus-Article-prepare message-id t)
+      ;; Retrieve article by message-id.  This may not work with
+      ;; nnspool nor mhspool.
+      (gnus-article-prepare message-id t)
     (error "No such references"))
   )
 
-(defun gnus-Subject-next-digest (nth)
+(defun gnus-summary-next-digest (nth)
   "Move to head of NTH next digested message."
   (interactive "p")
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
-    (gnus-Article-next-digest (or nth 1))
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
+    (gnus-article-next-digest (or nth 1))
     ))
 
-(defun gnus-Subject-prev-digest (nth)
+(defun gnus-summary-prev-digest (nth)
   "Move to head of NTH previous digested message."
   (interactive "p")
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
-    (gnus-Article-prev-digest (or nth 1))
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
+    (gnus-article-prev-digest (or nth 1))
     ))
 
-(defun gnus-Subject-first-unread-article ()
-  "Select first unread article.  Return non-nil if successfully selected."
+(defun gnus-summary-first-unread-article ()
+  "Select first unread article. Return non-nil if successfully selected."
   (interactive)
   (let ((begin (point)))
     (goto-char (point-min))
     (if (re-search-forward "^ [ \t]+[0-9]+:" nil t)
-	(gnus-Subject-display-article (gnus-Subject-article-number))
+	(gnus-summary-display-article (gnus-summary-article-number))
       ;; If there is no unread articles, stay there.
       (goto-char begin)
-      ;;(gnus-Subject-display-article (gnus-Subject-article-number))
+      ;;(gnus-summary-display-article (gnus-summary-article-number))
       (message "No more unread articles")
       nil
       )
     ))
 
-(defun gnus-Subject-isearch-article ()
+(defun gnus-summary-isearch-article ()
   "Do incremental search forward on current article."
   (interactive)
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (call-interactively 'isearch-forward)
     ))
 
-(defun gnus-Subject-search-article-forward (regexp)
+(defun gnus-summary-search-article-forward (regexp)
   "Search for an article containing REGEXP forward.
-`gnus-Select-article-hook' is not called during the search."
+gnus-select-article-hook is not called during the search."
   (interactive
    (list (read-string
 	  (concat "Search forward (regexp): "
@@ -2524,17 +2963,17 @@
   (if (string-equal regexp "")
       (setq regexp (or gnus-last-search-regexp ""))
     (setq gnus-last-search-regexp regexp))
-  (if (gnus-Subject-search-article regexp nil)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
+  (if (gnus-summary-search-article regexp nil)
+      (gnus-eval-in-buffer-window gnus-article-buffer
 	(recenter 0)
 	;;(sit-for 1)
 	)
     (error "Search failed: \"%s\"" regexp)
     ))
 
-(defun gnus-Subject-search-article-backward (regexp)
+(defun gnus-summary-search-article-backward (regexp)
   "Search for an article containing REGEXP backward.
-`gnus-Select-article-hook' is not called during the search."
+gnus-select-article-hook is not called during the search."
   (interactive
    (list (read-string
 	  (concat "Search backward (regexp): "
@@ -2543,44 +2982,44 @@
   (if (string-equal regexp "")
       (setq regexp (or gnus-last-search-regexp ""))
     (setq gnus-last-search-regexp regexp))
-  (if (gnus-Subject-search-article regexp t)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
+  (if (gnus-summary-search-article regexp t)
+      (gnus-eval-in-buffer-window gnus-article-buffer
 	(recenter 0)
 	;;(sit-for 1)
 	)
     (error "Search failed: \"%s\"" regexp)
     ))
 
-(defun gnus-Subject-search-article (regexp &optional backward)
+(defun gnus-summary-search-article (regexp &optional backward)
   "Search for an article containing REGEXP.
 Optional argument BACKWARD means do search for backward.
-`gnus-Select-article-hook' is not called during the search."
-  (let ((gnus-Select-article-hook nil)	;Disable hook.
-	(gnus-Mark-article-hook nil)	;Inhibit marking as read.
+gnus-select-article-hook is not called during the search."
+  (let ((gnus-select-article-hook nil)	;Disable hook.
+	(gnus-mark-article-hook nil)	;Inhibit marking as read.
 	(re-search
 	 (if backward
 	     (function re-search-backward) (function re-search-forward)))
 	(found nil)
 	(last nil))
     ;; Hidden thread subtrees must be searched for ,too.
-    (gnus-Subject-show-all-threads)
+    (gnus-summary-show-all-threads)
     ;; First of all, search current article.
     ;; We don't want to read article again from NNTP server nor reset
     ;; current point.
-    (gnus-Subject-select-article)
+    (gnus-summary-select-article)
     (message "Searching article: %d..." gnus-current-article)
     (setq last gnus-current-article)
-    (gnus-eval-in-buffer-window gnus-Article-buffer
+    (gnus-eval-in-buffer-window gnus-article-buffer
       (save-restriction
 	(widen)
 	;; Begin search from current point.
 	(setq found (funcall re-search regexp nil t))))
     ;; Then search next articles.
     (while (and (not found)
-		(gnus-Subject-display-article 
-		 (gnus-Subject-search-subject backward nil nil)))
+		(gnus-summary-display-article 
+		 (gnus-summary-search-subject backward nil nil)))
       (message "Searching article: %d..." gnus-current-article)
-      (gnus-eval-in-buffer-window gnus-Article-buffer
+      (gnus-eval-in-buffer-window gnus-article-buffer
 	(save-restriction
 	  (widen)
 	  (goto-char (if backward (point-max) (point-min)))
@@ -2594,8 +3033,8 @@
     found
     ))
 
-(defun gnus-Subject-execute-command (field regexp command &optional backward)
-  "If FIELD of article header matches REGEXP, execute COMMAND string.
+(defun gnus-summary-execute-command (field regexp command &optional backward)
+  "If FIELD of article header matches REGEXP, execute a COMMAND string.
 If FIELD is an empty string (or nil), entire article body is searched for.
 If optional (prefix) argument BACKWARD is non-nil, do backward instead."
   (interactive
@@ -2609,7 +3048,7 @@
 	 (read-key-sequence "Command: ")
 	 current-prefix-arg))
   ;; Hidden thread subtrees must be searched for ,too.
-  (gnus-Subject-show-all-threads)
+  (gnus-summary-show-all-threads)
   ;; We don't want to change current point nor window configuration.
   (save-excursion
     (save-window-excursion
@@ -2621,29 +3060,29 @@
 		    backward)
       (message "Executing %s... done" (key-description command)))))
 
-(defun gnus-Subject-beginning-of-article ()
+(defun gnus-summary-beginning-of-article ()
   "Go to beginning of article body"
   (interactive)
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (widen)
     (beginning-of-buffer)
     (if gnus-break-pages
 	(gnus-narrow-to-page))
     ))
 
-(defun gnus-Subject-end-of-article ()
+(defun gnus-summary-end-of-article ()
   "Go to end of article body"
   (interactive)
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (widen)
     (end-of-buffer)
     (if gnus-break-pages
 	(gnus-narrow-to-page))
     ))
 
-(defun gnus-Subject-goto-article (article &optional all-headers)
+(defun gnus-summary-goto-article (article &optional all-headers)
   "Read ARTICLE if exists.
 Optional argument ALL-HEADERS means all headers are shown."
   (interactive
@@ -2657,23 +3096,23 @@
 			   (int-to-string (nntp-header-number headers)))))
 		       gnus-newsgroup-headers)
 		      nil 'require-match))))
-  (if (gnus-Subject-goto-subject article)
-      (gnus-Subject-display-article article all-headers)))
-
-(defun gnus-Subject-goto-last-article ()
+  (if (gnus-summary-goto-subject article)
+      (gnus-summary-display-article article all-headers)))
+
+(defun gnus-summary-goto-last-article ()
   "Go to last subject line."
   (interactive)
   (if gnus-last-article
-      (gnus-Subject-goto-article gnus-last-article)))
-
-(defun gnus-Subject-show-article ()
+      (gnus-summary-goto-article gnus-last-article)))
+
+(defun gnus-summary-show-article ()
   "Force to show current article."
   (interactive)
   ;; The following is a trick to force to read the current article again.
   (setq gnus-have-all-headers (not gnus-have-all-headers))
-  (gnus-Subject-select-article (not gnus-have-all-headers) t))
-
-(defun gnus-Subject-toggle-header (arg)
+  (gnus-summary-select-article (not gnus-have-all-headers) t))
+
+(defun gnus-summary-toggle-header (arg)
   "Show original header if pruned header currently shown, or vice versa.
 With arg, show original header iff arg is positive."
   (interactive "P")
@@ -2682,21 +3121,33 @@
 	(all-headers
 	 (if (null arg) (not gnus-have-all-headers)
 	   (> (prefix-numeric-value arg) 0))))
-    (gnus-Subject-select-article all-headers t)))
-
-(defun gnus-Subject-show-all-headers ()
+    (gnus-summary-select-article all-headers t)))
+
+(defun gnus-summary-show-all-headers ()
   "Show original article header."
   (interactive)
-  (gnus-Subject-select-article t t))
-
-(defun gnus-Subject-stop-page-breaking ()
+  (gnus-summary-select-article t t))
+
+(defun gnus-summary-toggle-mime (arg)
+  "Toggle MIME processing.
+With arg, turn MIME processing on iff arg is positive."
+  (interactive "P")
+  (setq gnus-show-mime
+	(if (null arg) (not gnus-show-mime)
+	  (> (prefix-numeric-value arg) 0)))
+  ;; The following is a trick to force to read the current article again.
+  (setq gnus-have-all-headers (not gnus-have-all-headers))
+  (gnus-summary-select-article (not gnus-have-all-headers) t))
+
+(defun gnus-summary-stop-page-breaking ()
   "Stop page breaking by linefeed temporary (Widen article buffer)."
   (interactive)
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
-    (widen)))
-
-(defun gnus-Subject-kill-same-subject-and-select (unmark)
+  (gnus-summary-select-article)
+  (gnus-eval-in-buffer-window gnus-article-buffer
+    (widen)
+    ))
+
+(defun gnus-summary-kill-same-subject-and-select (unmark)
   "Mark articles which has the same subject as read, and then select next.
 If argument UNMARK is positive, remove any kinds of marks.
 If argument UNMARK is negative, mark articles as unread instead."
@@ -2704,17 +3155,17 @@
   (if unmark
       (setq unmark (prefix-numeric-value unmark)))
   (let ((count
-	 (gnus-Subject-mark-same-subject
-	  (gnus-Subject-subject-string) unmark)))
+	 (gnus-summary-mark-same-subject
+	  (gnus-summary-subject-string) unmark)))
     ;; Select next unread article. If auto-select-same mode, should
     ;; select the first unread article.
-    (gnus-Subject-next-article t (and gnus-auto-select-same
-				      (gnus-Subject-subject-string)))
+    (gnus-summary-next-article t (and gnus-auto-select-same
+				      (gnus-summary-subject-string)))
     (message "%d articles are marked as %s"
 	     count (if unmark "unread" "read"))
     ))
 
-(defun gnus-Subject-kill-same-subject (unmark)
+(defun gnus-summary-kill-same-subject (unmark)
   "Mark articles which has the same subject as read. 
 If argument UNMARK is positive, remove any kinds of marks.
 If argument UNMARK is negative, mark articles as unread instead."
@@ -2722,145 +3173,144 @@
   (if unmark
       (setq unmark (prefix-numeric-value unmark)))
   (let ((count
-	 (gnus-Subject-mark-same-subject
-	  (gnus-Subject-subject-string) unmark)))
+	 (gnus-summary-mark-same-subject
+	  (gnus-summary-subject-string) unmark)))
     ;; If marked as read, go to next unread subject.
     (if (null unmark)
 	;; Go to next unread subject.
-	(gnus-Subject-next-subject 1 t))
+	(gnus-summary-next-subject 1 t))
     (message "%d articles are marked as %s"
 	     count (if unmark "unread" "read"))
     ))
 
-(defun gnus-Subject-mark-same-subject (subject &optional unmark)
+(defun gnus-summary-mark-same-subject (subject &optional unmark)
   "Mark articles with same SUBJECT as read, and return marked number.
 If optional argument UNMARK is positive, remove any kinds of marks.
 If optional argument UNMARK is negative, mark articles as unread instead."
   (let ((count 1))
     (save-excursion
       (cond ((null unmark)
-	     (gnus-Subject-mark-as-read nil "K"))
+	     (gnus-summary-mark-as-read nil "K"))
 	    ((> unmark 0)
-	     (gnus-Subject-mark-as-unread nil t))
+	     (gnus-summary-mark-as-unread nil t))
 	    (t
-	     (gnus-Subject-mark-as-unread)))
+	     (gnus-summary-mark-as-unread)))
       (while (and subject
-		  (gnus-Subject-search-forward nil subject))
+		  (gnus-summary-search-forward nil subject))
 	(cond ((null unmark)
-	       (gnus-Subject-mark-as-read nil "K"))
+	       (gnus-summary-mark-as-read nil "K"))
 	      ((> unmark 0)
-	       (gnus-Subject-mark-as-unread nil t))
+	       (gnus-summary-mark-as-unread nil t))
 	      (t
-	       (gnus-Subject-mark-as-unread)))
+	       (gnus-summary-mark-as-unread)))
 	(setq count (1+ count))
 	))
     ;; Hide killed thread subtrees.  Does not work properly always.
     ;;(and (null unmark)
     ;;     gnus-thread-hide-killed
-    ;;	   (gnus-Subject-hide-thread))
+    ;;	   (gnus-summary-hide-thread))
     ;; Return number of articles marked as read.
     count
     ))
 
-(defun gnus-Subject-mark-as-unread-forward (count)
+(defun gnus-summary-mark-as-unread-forward (count)
   "Mark current article as unread, and then go forward.
 Argument COUNT specifies number of articles marked as unread."
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-unread nil nil)
-    (gnus-Subject-next-subject 1 nil)
+    (gnus-summary-mark-as-unread nil nil)
+    (gnus-summary-next-subject 1 nil)
     (setq count (1- count))))
 
-(defun gnus-Subject-mark-as-unread-backward (count)
+(defun gnus-summary-mark-as-unread-backward (count)
   "Mark current article as unread, and then go backward.
 Argument COUNT specifies number of articles marked as unread."
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-unread nil nil)
-    (gnus-Subject-prev-subject 1 nil)
+    (gnus-summary-mark-as-unread nil nil)
+    (gnus-summary-prev-subject 1 nil)
     (setq count (1- count))))
 
-(defun gnus-Subject-mark-as-unread (&optional article clear-mark)
+(defun gnus-summary-mark-as-unread (&optional article clear-mark)
   "Mark current article as unread.
-Optional first argument ARTICLE specifies article number to be
-marked as unread.  Optional second argument CLEAR-MARK removes
-any kind of mark."
+Optional 1st argument ARTICLE specifies article number to be marked as unread.
+Optional 2nd argument CLEAR-MARK remove any kinds of mark."
   (save-excursion
-    (set-buffer gnus-Subject-buffer)
+    (set-buffer gnus-summary-buffer)
     ;; First of all, show hidden thread subtrees.
-    (gnus-Subject-show-thread)
+    (gnus-summary-show-thread)
     (let* ((buffer-read-only nil)
-	   (current (gnus-Subject-article-number))
+	   (current (gnus-summary-article-number))
 	   (article (or article current)))
       (gnus-mark-article-as-unread article clear-mark)
       (if (or (eq article current)
-	      (gnus-Subject-goto-subject article))
+	      (gnus-summary-goto-subject article))
 	  (progn
 	    (beginning-of-line)
 	    (delete-char 1)
 	    (insert (if clear-mark " " "-"))))
       )))
 
-(defun gnus-Subject-mark-as-read-forward (count)
+(defun gnus-summary-mark-as-read-forward (count)
   "Mark current article as read, and then go forward.
 Argument COUNT specifies number of articles marked as read"
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-read)
-    (gnus-Subject-next-subject 1 'unread-only)
+    (gnus-summary-mark-as-read)
+    (gnus-summary-next-subject 1 'unread-only)
     (setq count (1- count))))
 
-(defun gnus-Subject-mark-as-read-backward (count)
+(defun gnus-summary-mark-as-read-backward (count)
   "Mark current article as read, and then go backward.
 Argument COUNT specifies number of articles marked as read"
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-read)
-    (gnus-Subject-prev-subject 1 'unread-only)
+    (gnus-summary-mark-as-read)
+    (gnus-summary-prev-subject 1 'unread-only)
     (setq count (1- count))))
 
-(defun gnus-Subject-mark-as-read (&optional article mark)
+(defun gnus-summary-mark-as-read (&optional article mark)
   "Mark current article as read.
-Optional first argument ARTICLE specifies article number to be marked as read.
-Optional second argument MARK specifies a string inserted at beginning of line.
+Optional 1st argument ARTICLE specifies article number to be marked as read.
+Optional 2nd argument MARK specifies a string inserted at beginning of line.
 Any kind of string (length 1) except for a space and `-' is ok."
   (save-excursion
-    (set-buffer gnus-Subject-buffer)
+    (set-buffer gnus-summary-buffer)
     ;; First of all, show hidden thread subtrees.
-    (gnus-Subject-show-thread)
+    (gnus-summary-show-thread)
     (let* ((buffer-read-only nil)
 	   (mark (or mark "D"))		;Default mark is `D'.
-	   (current (gnus-Subject-article-number))
+	   (current (gnus-summary-article-number))
 	   (article (or article current)))
       (gnus-mark-article-as-read article)
       (if (or (eq article current)
-	      (gnus-Subject-goto-subject article))
+	      (gnus-summary-goto-subject article))
 	  (progn
 	    (beginning-of-line)
 	    (delete-char 1)
 	    (insert mark)))
       )))
 
-(defun gnus-Subject-clear-mark-forward (count)
+(defun gnus-summary-clear-mark-forward (count)
   "Remove current article's mark, and go forward.
 Argument COUNT specifies number of articles unmarked"
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-unread nil t)
-    (gnus-Subject-next-subject 1 nil)
+    (gnus-summary-mark-as-unread nil t)
+    (gnus-summary-next-subject 1 nil)
     (setq count (1- count))))
 
-(defun gnus-Subject-clear-mark-backward (count)
+(defun gnus-summary-clear-mark-backward (count)
   "Remove current article's mark, and go backward.
 Argument COUNT specifies number of articles unmarked"
   (interactive "p")
   (while (> count 0)
-    (gnus-Subject-mark-as-unread nil t)
-    (gnus-Subject-prev-subject 1 nil)
+    (gnus-summary-mark-as-unread nil t)
+    (gnus-summary-prev-subject 1 nil)
     (setq count (1- count))))
 
-(defun gnus-Subject-delete-marked-as-read ()
-  "Delete lines which are marked as read."
+(defun gnus-summary-delete-marked-as-read ()
+  "Delete lines which is marked as read."
   (interactive)
   (if gnus-newsgroup-unreads
       (let ((buffer-read-only nil))
@@ -2869,14 +3319,14 @@
 	  (delete-non-matching-lines "^[ ---]"))
 	;; Adjust point.
 	(if (eobp)
-	    (gnus-Subject-prev-subject 1)
+	    (gnus-summary-prev-subject 1)
 	  (beginning-of-line)
 	  (search-forward ":" nil t)))
     ;; It is not so good idea to make the buffer empty.
     (message "All articles are marked as read")
     ))
 
-(defun gnus-Subject-delete-marked-with (marks)
+(defun gnus-summary-delete-marked-with (marks)
   "Delete lines which are marked with MARKS (e.g. \"DK\")."
   (interactive "sMarks: ")
   (let ((buffer-read-only nil))
@@ -2886,26 +3336,26 @@
     ;; Adjust point.
     (or (zerop (buffer-size))
 	(if (eobp)
-	    (gnus-Subject-prev-subject 1)
+	    (gnus-summary-prev-subject 1)
 	  (beginning-of-line)
 	  (search-forward ":" nil t)))
     ))
 
 ;; Thread-based commands.
 
-(defun gnus-Subject-toggle-threads (arg)
+(defun gnus-summary-toggle-threads (arg)
   "Toggle showing conversation threads.
 With arg, turn showing conversation threads on iff arg is positive."
   (interactive "P")
-  (let ((current (gnus-Subject-article-number)))
+  (let ((current (gnus-summary-article-number)))
     (setq gnus-show-threads
 	  (if (null arg) (not gnus-show-threads)
 	    (> (prefix-numeric-value arg) 0)))
-    (gnus-Subject-prepare)
-    (gnus-Subject-goto-subject current)
+    (gnus-summary-prepare)
+    (gnus-summary-goto-subject current)
     ))
 
-(defun gnus-Subject-show-all-threads ()
+(defun gnus-summary-show-all-threads ()
   "Show all thread subtrees."
   (interactive)
   (if gnus-show-threads
@@ -2914,7 +3364,7 @@
 	  (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
 	  ))))
 
-(defun gnus-Subject-show-thread ()
+(defun gnus-summary-show-thread ()
   "Show thread subtrees."
   (interactive)
   (if gnus-show-threads
@@ -2927,7 +3377,7 @@
 				?\^M ?\n t)
 	  ))))
 
-(defun gnus-Subject-hide-all-threads ()
+(defun gnus-summary-hide-all-threads ()
   "Hide all thread subtrees."
   (interactive)
   (if gnus-show-threads
@@ -2936,13 +3386,13 @@
 	(goto-char (point-min))
 	(search-forward ":" nil t)
 	(let ((level (current-column)))
-	  (gnus-Subject-hide-thread)
-	  (while (gnus-Subject-search-forward)
+	  (gnus-summary-hide-thread)
+	  (while (gnus-summary-search-forward)
 	    (and (>= level (current-column))
-		 (gnus-Subject-hide-thread)))
+		 (gnus-summary-hide-thread)))
 	  ))))
 
-(defun gnus-Subject-hide-thread ()
+(defun gnus-summary-hide-thread ()
   "Hide thread subtrees."
   (interactive)
   (if gnus-show-threads
@@ -2954,7 +3404,7 @@
 	      (init (point))
 	      (last (point))
 	      (level (current-column)))
-	  (while (and (gnus-Subject-search-forward)
+	  (while (and (gnus-summary-search-forward)
 		      (< level (current-column)))
 	    ;; Interested in lower levels.
 	    (if (< level (current-column))
@@ -2965,7 +3415,7 @@
 	  (subst-char-in-region init last ?\n ?\^M t)
 	  ))))
 
-(defun gnus-Subject-next-thread (n)
+(defun gnus-summary-next-thread (n)
   "Go to the same level next thread.
 Argument N specifies the number of threads."
   (interactive "p")
@@ -2976,7 +3426,7 @@
 	(last (point))
 	(level (current-column)))
     (while (and (> n 0)
-		(gnus-Subject-search-forward)
+		(gnus-summary-search-forward)
 		(<= level (current-column)))
       ;; We have to skip lower levels.
       (if (= level (current-column))
@@ -2990,7 +3440,7 @@
       (goto-char last))
     ))
 
-(defun gnus-Subject-prev-thread (n)
+(defun gnus-summary-prev-thread (n)
   "Go to the same level previous thread.
 Argument N specifies the number of threads."
   (interactive "p")
@@ -3001,7 +3451,7 @@
 	(last (point))
 	(level (current-column)))
     (while (and (> n 0)
-		(gnus-Subject-search-backward)
+		(gnus-summary-search-backward)
 		(<= level (current-column)))
       ;; We have to skip lower levels.
       (if (= level (current-column))
@@ -3015,7 +3465,7 @@
       (goto-char last))
     ))
 
-(defun gnus-Subject-down-thread (d)
+(defun gnus-summary-down-thread (d)
   "Go downward current thread.
 Argument D specifies the depth goes down."
   (interactive "p")
@@ -3025,7 +3475,7 @@
   (let ((last (point))
 	(level (current-column)))
     (while (and (> d 0)
-		(gnus-Subject-search-forward)
+		(gnus-summary-search-forward)
 		(<= level (current-column))) ;<= can be <.  Which do you like?
       ;; We have to skip the same levels.
       (if (< level (current-column))
@@ -3038,7 +3488,7 @@
     (goto-char last)
     ))
 
-(defun gnus-Subject-up-thread (d)
+(defun gnus-summary-up-thread (d)
   "Go upward current thread.
 Argument D specifies the depth goes up."
   (interactive "p")
@@ -3048,7 +3498,7 @@
   (let ((last (point))
 	(level (current-column)))
     (while (and (> d 0)
-		(gnus-Subject-search-backward))
+		(gnus-summary-search-backward))
       ;; We have to skip the same levels.
       (if (> level (current-column))
 	  (progn
@@ -3060,7 +3510,7 @@
     (goto-char last)
     ))
 
-(defun gnus-Subject-kill-thread (unmark)
+(defun gnus-summary-kill-thread (unmark)
   "Mark articles under current thread as read.
 If argument UNMARK is positive, remove any kinds of marks.
 If argument UNMARK is negative, mark articles as unread instead."
@@ -3074,121 +3524,136 @@
     (let ((level (current-column)))
       ;; Mark current article.
       (cond ((null unmark)
-	     (gnus-Subject-mark-as-read nil "K"))
+	     (gnus-summary-mark-as-read nil "K"))
 	    ((> unmark 0)
-	     (gnus-Subject-mark-as-unread nil t))
+	     (gnus-summary-mark-as-unread nil t))
 	    (t
-	     (gnus-Subject-mark-as-unread))
+	     (gnus-summary-mark-as-unread))
 	    )
       ;; Mark following articles.
-      (while (and (gnus-Subject-search-forward)
+      (while (and (gnus-summary-search-forward)
 		  (< level (current-column)))
 	(cond ((null unmark)
-	       (gnus-Subject-mark-as-read nil "K"))
+	       (gnus-summary-mark-as-read nil "K"))
 	      ((> unmark 0)
-	       (gnus-Subject-mark-as-unread nil t))
+	       (gnus-summary-mark-as-unread nil t))
 	      (t
-	       (gnus-Subject-mark-as-unread))
+	       (gnus-summary-mark-as-unread))
 	      ))
       ))
   ;; Hide killed subtrees.
   (and (null unmark)
        gnus-thread-hide-killed
-       (gnus-Subject-hide-thread))
+       (gnus-summary-hide-thread))
   ;; If marked as read, go to next unread subject.
   (if (null unmark)
       ;; Go to next unread subject.
-      (gnus-Subject-next-subject 1 t))
+      (gnus-summary-next-subject 1 t))
   )
 
-(defun gnus-Subject-toggle-truncation (arg)
-  "Toggle truncation of subject lines.
-With ARG, turn line truncation on iff ARG is positive."
+(defun gnus-summary-toggle-truncation (arg)
+  "Toggle truncation of summary lines.
+With arg, turn line truncation on iff arg is positive."
   (interactive "P")
   (setq truncate-lines
 	(if (null arg) (not truncate-lines)
 	  (> (prefix-numeric-value arg) 0)))
   (redraw-display))
 
-(defun gnus-Subject-sort-by-number (reverse)
-  "Sort subject display buffer by article number.
+(defun gnus-summary-sort-by-number (reverse)
+  "Sort Summary buffer by article number.
 Argument REVERSE means reverse order."
   (interactive "P")
-  (gnus-Subject-sort-subjects
+  (gnus-summary-keysort-summary
+   (function <)
    (function
-    (lambda (a b)
-      (< (nntp-header-number a) (nntp-header-number b))))
+    (lambda (a)
+      (nntp-header-number a)))
    reverse
    ))
 
-(defun gnus-Subject-sort-by-author (reverse)
-  "Sort subject display buffer by author name alphabetically.
+(defun gnus-summary-sort-by-author (reverse)
+  "Sort Summary buffer by author name alphabetically.
 If case-fold-search is non-nil, case of letters is ignored.
 Argument REVERSE means reverse order."
   (interactive "P")
-  (gnus-Subject-sort-subjects
+  (gnus-summary-keysort-summary
+   (function string-lessp)
    (function
-    (lambda (a b)
-      (gnus-string-lessp (nntp-header-from a) (nntp-header-from b))))
+    (lambda (a)
+      (if case-fold-search
+	  (downcase (nntp-header-from a))
+	(nntp-header-from a))))
    reverse
    ))
 
-(defun gnus-Subject-sort-by-subject (reverse)
-  "Sort subject display buffer by subject alphabetically. `Re:'s are ignored.
+(defun gnus-summary-sort-by-subject (reverse)
+  "Sort Summary buffer by subject alphabetically. `Re:'s are ignored.
 If case-fold-search is non-nil, case of letters is ignored.
 Argument REVERSE means reverse order."
   (interactive "P")
-  (gnus-Subject-sort-subjects
+  (gnus-summary-keysort-summary
+   (function string-lessp)
    (function
-    (lambda (a b)
-      (gnus-string-lessp
-       (gnus-simplify-subject (nntp-header-subject a) 're-only)
-       (gnus-simplify-subject (nntp-header-subject b) 're-only))))
+    (lambda (a)
+      (if case-fold-search
+	  (downcase (gnus-simplify-subject (nntp-header-subject a) 're-only))
+	(gnus-simplify-subject (nntp-header-subject a) 're-only))))
    reverse
    ))
 
-(defun gnus-Subject-sort-by-date (reverse)
-  "Sort subject display buffer by posted date.
+(defun gnus-summary-sort-by-date (reverse)
+  "Sort Summary buffer by date.
 Argument REVERSE means reverse order."
   (interactive "P")
-  (gnus-Subject-sort-subjects
+  (gnus-summary-keysort-summary
+   (function string-lessp)
    (function
-    (lambda (a b)
-      (gnus-date-lessp (nntp-header-date a) (nntp-header-date b))))
+    (lambda (a)
+      (gnus-sortable-date (nntp-header-date a))))
    reverse
    ))
 
-(defun gnus-Subject-sort-subjects (predicate &optional reverse)
-  "Sort subject display buffer by PREDICATE.
+(defun gnus-summary-keysort-summary (predicate key &optional reverse)
+  "Sort Summary buffer by PREDICATE using a value passed by KEY.
 Optional argument REVERSE means reverse order."
-  (let ((current (gnus-Subject-article-number)))
+  (let ((current (gnus-summary-article-number)))
+    (gnus-keysort-headers predicate key reverse)
+    (gnus-summary-prepare)
+    (gnus-summary-goto-subject current)
+    ))
+
+(defun gnus-summary-sort-summary (predicate &optional reverse)
+  "Sort Summary buffer by PREDICATE.
+Optional argument REVERSE means reverse order."
+  (let ((current (gnus-summary-article-number)))
     (gnus-sort-headers predicate reverse)
-    (gnus-Subject-prepare)
-    (gnus-Subject-goto-subject current)
+    (gnus-summary-prepare)
+    (gnus-summary-goto-subject current)
     ))
 
-(defun gnus-Subject-reselect-current-group (show-all)
+(defun gnus-summary-reselect-current-group (show-all)
   "Once exit and then reselect the current newsgroup.
 Prefix argument SHOW-ALL means to select all articles."
   (interactive "P")
-  (let ((current-subject (gnus-Subject-article-number)))
-    (gnus-Subject-exit t)
+  (let ((current-subject (gnus-summary-article-number)))
+    (gnus-summary-exit t)
     ;; We have to adjust the point of Group mode buffer because the
     ;; current point was moved to the next unread newsgroup by
     ;; exiting.
-    (gnus-Subject-jump-to-group gnus-newsgroup-name)
-    (gnus-Group-read-group show-all t)
-    (gnus-Subject-goto-subject current-subject)
+    (gnus-summary-jump-to-group gnus-newsgroup-name)
+    (gnus-group-read-group show-all t)
+    (gnus-summary-goto-subject current-subject)
     ))
 
-(defun gnus-Subject-caesar-message (rotnum)
+(defun gnus-summary-caesar-message (rotnum)
   "Caesar rotates all letters of current message by 13/47 places.
 With prefix arg, specifies the number of places to rotate each letter forward.
 Caesar rotates Japanese letters by 47 places in any case."
   (interactive "P")
-  (gnus-Subject-select-article)
+  (gnus-summary-select-article)
   (gnus-overload-functions)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-restriction
       (widen)
       ;; We don't want to jump to the beginning of the message.
@@ -3201,26 +3666,25 @@
 	))
     ))
 
-(defun gnus-Subject-rmail-digest ()
+(defun gnus-summary-rmail-digest ()
   "Run RMAIL on current digest article.
-`gnus-Select-digest-hook' will be called with no arguments, if that
-value is non-nil.  It is possible to modify the article so that Rmail
+gnus-select-digest-hook will be called with no arguments, if that
+value is non-nil. It is possible to modify the article so that Rmail
 can work with it.
-
-`gnus-Rmail-digest-hook' will be called with no arguments, if that value
-is non-nil.  The hook is intended to customize Rmail mode."
+gnus-rmail-digest-hook will be called with no arguments, if that value
+is non-nil. The hook is intended to customize Rmail mode."
   (interactive)
-  (gnus-Subject-select-article)
+  (gnus-summary-select-article)
   (require 'rmail)
-  (let ((artbuf gnus-Article-buffer)
-	(digbuf (get-buffer-create gnus-Digest-buffer))
+  (let ((artbuf gnus-article-buffer)
+	(digbuf (get-buffer-create gnus-digest-buffer))
 	(mail-header-separator ""))
     (set-buffer digbuf)
-    (buffer-disable-undo (current-buffer))
+    (buffer-flush-undo (current-buffer))
     (setq buffer-read-only nil)
     (erase-buffer)
     (insert-buffer-substring artbuf)
-    (run-hooks 'gnus-Select-digest-hook)
+    (run-hooks 'gnus-select-digest-hook)
     (gnus-convert-article-to-rmail)
     (goto-char (point-min))
     ;; Rmail initializations.
@@ -3260,33 +3724,33 @@
 			 ))
 	  ;; Prevent generating new buffer named ***<N> each time.
 	  (setq rmail-summary-buffer
-		(get-buffer-create gnus-Digest-summary-buffer))
-	  (run-hooks 'gnus-Rmail-digest-hook)
+		(get-buffer-create gnus-digest-summary-buffer))
+	  (run-hooks 'gnus-rmail-digest-hook)
 	  ;; Take all windows safely.
 	  (gnus-configure-windows '(1 0 0))
-	  (pop-to-buffer gnus-Group-buffer)
-	  ;; Use Subject and Article windows for Digest summary and
+	  (pop-to-buffer gnus-group-buffer)
+	  ;; Use Summary Article windows for Digest summary and
 	  ;; Digest buffers.
 	  (if gnus-digest-show-summary
-	      (let ((gnus-Subject-buffer gnus-Digest-summary-buffer)
-		    (gnus-Article-buffer gnus-Digest-buffer))
-		(gnus-configure-windows 'SelectArticle)
-		(pop-to-buffer gnus-Digest-buffer)
+	      (let ((gnus-summary-buffer gnus-digest-summary-buffer)
+		    (gnus-article-buffer gnus-digest-buffer))
+		(gnus-configure-windows 'article)
+		(pop-to-buffer gnus-digest-buffer)
 		(rmail-summary)
-		(pop-to-buffer gnus-Digest-summary-buffer)
+		(pop-to-buffer gnus-digest-summary-buffer)
 		(message (substitute-command-keys
 			  "Type \\[rmail-summary-quit] to return to GNUS")))
-	    (let ((gnus-Subject-buffer gnus-Digest-buffer))
-	      (gnus-configure-windows 'ExpandSubject)
-	      (pop-to-buffer gnus-Digest-buffer)
+	    (let ((gnus-summary-buffer gnus-digest-buffer))
+	      (gnus-configure-windows 'summary)
+	      (pop-to-buffer gnus-digest-buffer)
 	      (message (substitute-command-keys
 			"Type \\[rmail-quit] to return to GNUS")))
 	    )
 	  ;; Move the buffers to the end of buffer list.
-	  (bury-buffer gnus-Article-buffer)
-	  (bury-buffer gnus-Group-buffer)
-	  (bury-buffer gnus-Digest-summary-buffer)
-	  (bury-buffer gnus-Digest-buffer))
+	  (bury-buffer gnus-article-buffer)
+	  (bury-buffer gnus-group-buffer)
+	  (bury-buffer gnus-digest-summary-buffer)
+	  (bury-buffer gnus-digest-buffer))
       (error (set-buffer-modified-p nil)
 	     (kill-buffer digbuf)
 	     ;; This command should not signal an error because the
@@ -3294,25 +3758,23 @@
 	     (ding) (message "Article is not a digest")))
     ))
 
-(defun gnus-Subject-save-article ()
+(defun gnus-summary-save-article ()
   "Save this article using default saver function.
-Variable `gnus-default-article-saver' specifies the saver function."
+The variable `gnus-default-article-saver' specifies the saver function."
   (interactive)
-  (gnus-Subject-select-article
-   (not (null gnus-save-all-headers)) gnus-save-all-headers)
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
   (if gnus-default-article-saver
       (call-interactively gnus-default-article-saver)
     (error "No default saver is defined.")))
 
-(defun gnus-Subject-save-in-rmail (&optional filename)
+(defun gnus-summary-save-in-rmail (&optional filename)
   "Append this article to Rmail file.
 Optional argument FILENAME specifies file name.
 Directory to save to is default to `gnus-article-save-directory' which
 is initialized from the SAVEDIR environment variable."
   (interactive)
-  (gnus-Subject-select-article
-   (not (null gnus-save-all-headers)) gnus-save-all-headers)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-excursion
       (save-restriction
 	(widen)
@@ -3337,15 +3799,14 @@
 	  )))
     ))
 
-(defun gnus-Subject-save-in-mail (&optional filename)
+(defun gnus-summary-save-in-mail (&optional filename)
   "Append this article to Unix mail file.
 Optional argument FILENAME specifies file name.
 Directory to save to is default to `gnus-article-save-directory' which
 is initialized from the SAVEDIR environment variable."
   (interactive)
-  (gnus-Subject-select-article
-   (not (null gnus-save-all-headers)) gnus-save-all-headers)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-excursion
       (save-restriction
 	(widen)
@@ -3370,15 +3831,14 @@
 	  )))
     ))
 
-(defun gnus-Subject-save-in-file (&optional filename)
+(defun gnus-summary-save-in-file (&optional filename)
   "Append this article to file.
 Optional argument FILENAME specifies file name.
 Directory to save to is default to `gnus-article-save-directory' which
 is initialized from the SAVEDIR environment variable."
   (interactive)
-  (gnus-Subject-select-article
-   (not (null gnus-save-all-headers)) gnus-save-all-headers)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-excursion
       (save-restriction
 	(widen)
@@ -3403,13 +3863,12 @@
 	  )))
     ))
 
-(defun gnus-Subject-save-in-folder (&optional folder)
+(defun gnus-summary-save-in-folder (&optional folder)
   "Save this article to MH folder (using `rcvstore' in MH library).
 Optional argument FOLDER specifies folder name."
   (interactive)
-  (gnus-Subject-select-article
-   (not (null gnus-save-all-headers)) gnus-save-all-headers)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-restriction
       (widen)
       ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet.
@@ -3438,12 +3897,14 @@
 	))
     ))
 
-(defun gnus-Subject-pipe-output ()
+(defun gnus-summary-pipe-output ()
   "Pipe this article to subprocess."
   (interactive)
   ;; Ignore `gnus-save-all-headers' since this is not save command.
-  (gnus-Subject-select-article)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  ;;(gnus-summary-select-article)
+  ;; Huuum.  Is this right?
+  (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (save-restriction
       (widen)
       (let ((command (read-string "Shell command on article: "
@@ -3455,7 +3916,7 @@
 	))
     ))
 
-(defun gnus-Subject-catch-up (all &optional quietly)
+(defun gnus-summary-catchup (all &optional quietly)
   "Mark all articles not marked as unread in this newsgroup as read.
 If prefix argument ALL is non-nil, all articles are marked as read."
   (interactive "P")
@@ -3468,18 +3929,20 @@
 	     (gnus-set-difference gnus-newsgroup-unreads
 				  (if (not all) gnus-newsgroup-marked))))
         (message "")			;Erase "Yes or No" question.
+	;; Hidden thread subtrees must be searched for ,too.
+	(gnus-summary-show-all-threads)
 	(while unmarked
-          (gnus-Subject-mark-as-read (car unmarked) "C")
+          (gnus-summary-mark-as-read (car unmarked) "C")
 	  (setq unmarked (cdr unmarked))
 	  ))
     ))
 
-(defun gnus-Subject-catch-up-all (&optional quietly)
+(defun gnus-summary-catchup-all (&optional quietly)
   "Mark all articles in this newsgroup as read."
   (interactive)
-  (gnus-Subject-catch-up t quietly))
-
-(defun gnus-Subject-catch-up-and-exit (all &optional quietly)
+  (gnus-summary-catchup t quietly))
+
+(defun gnus-summary-catchup-and-exit (all &optional quietly)
   "Mark all articles not marked as unread in this newsgroup as read, then exit.
 If prefix argument ALL is non-nil, all articles are marked as read."
   (interactive "P")
@@ -3498,46 +3961,46 @@
 	;; Select next newsgroup or exit.
 	(cond ((eq gnus-auto-select-next 'quietly)
 	       ;; Select next newsgroup quietly.
-	       (gnus-Subject-next-group nil))
+	       (gnus-summary-next-group nil))
 	      (t
-	       (gnus-Subject-exit)))
+	       (gnus-summary-exit)))
 	)))
 
-(defun gnus-Subject-catch-up-all-and-exit (&optional quietly)
+(defun gnus-summary-catchup-all-and-exit (&optional quietly)
   "Mark all articles in this newsgroup as read, and then exit."
   (interactive)
-  (gnus-Subject-catch-up-and-exit t quietly))
-
-(defun gnus-Subject-edit-global-kill ()
+  (gnus-summary-catchup-and-exit t quietly))
+
+(defun gnus-summary-edit-global-kill ()
   "Edit a global KILL file."
   (interactive)
-  (setq gnus-current-kill-article (gnus-Subject-article-number))
-  (gnus-Kill-file-edit-file nil)	;Nil stands for global KILL file.
+  (setq gnus-current-kill-article (gnus-summary-article-number))
+  (gnus-kill-file-edit-file nil)	;Nil stands for global KILL file.
   (message
    (substitute-command-keys
-    "Editing a global KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
-
-(defun gnus-Subject-edit-local-kill ()
+    "Editing a global KILL file (Type \\[gnus-kill-file-exit] to exit)")))
+
+(defun gnus-summary-edit-local-kill ()
   "Edit a local KILL file applied to the current newsgroup."
   (interactive)
-  (setq gnus-current-kill-article (gnus-Subject-article-number))
-  (gnus-Kill-file-edit-file gnus-newsgroup-name)
+  (setq gnus-current-kill-article (gnus-summary-article-number))
+  (gnus-kill-file-edit-file gnus-newsgroup-name)
   (message
    (substitute-command-keys
-    "Editing a local KILL file (Type \\[gnus-Kill-file-exit] to exit)")))
-
-(defun gnus-Subject-exit (&optional temporary)
+    "Editing a local KILL file (Type \\[gnus-kill-file-exit] to exit)")))
+
+(defun gnus-summary-exit (&optional temporary)
   "Exit reading current newsgroup, and then return to group selection mode.
-gnus-Exit-group-hook is called with no arguments if that value is non-nil."
+gnus-exit-group-hook is called with no arguments if that value is non-nil."
   (interactive)
   (let ((updated nil)
 	(gnus-newsgroup-headers gnus-newsgroup-headers)
 	(gnus-newsgroup-unreads gnus-newsgroup-unreads)
 	(gnus-newsgroup-unselected gnus-newsgroup-unselected)
 	(gnus-newsgroup-marked gnus-newsgroup-marked))
-    ;; Important internal variables are save, so we can reenter
-    ;; Subject Mode buffer even if hook changes them.
-    (run-hooks 'gnus-Exit-group-hook)
+    ;; Important internal variables are saved, so we can reenter
+    ;; Summary buffer even if hook changes them.
+    (run-hooks 'gnus-exit-group-hook)
     (gnus-update-unread-articles gnus-newsgroup-name
 				 (append gnus-newsgroup-unselected
 					 gnus-newsgroup-unreads)
@@ -3551,55 +4014,55 @@
 					 (eq gnus-use-cross-reference t)
 					 )))
     ;; Do not switch windows but change the buffer to work.
-    (set-buffer gnus-Group-buffer)
+    (set-buffer gnus-group-buffer)
     ;; Update cross referenced group info.
     (while updated
-      (gnus-Group-update-group (car updated) t) ;Ignore invisible group.
+      (gnus-group-update-group (car updated) t) ;Ignore invisible group.
       (setq updated (cdr updated)))
-    (gnus-Group-update-group gnus-newsgroup-name))
+    (gnus-group-update-group gnus-newsgroup-name))
   ;; Make sure where I was, and go to next newsgroup.
-  (gnus-Group-jump-to-group gnus-newsgroup-name)
-  (gnus-Group-next-unread-group 1)
+  (gnus-group-jump-to-group gnus-newsgroup-name)
+  (gnus-group-next-unread-group 1)
   (if temporary
       ;; If exiting temporary, caller should adjust Group mode
       ;; buffer point by itself.
       nil				;Nothing to do.
     ;; Return to Group mode buffer.
-    (if (get-buffer gnus-Subject-buffer)
-	(bury-buffer gnus-Subject-buffer))
-    (if (get-buffer gnus-Article-buffer)
-	(bury-buffer gnus-Article-buffer))
-    (gnus-configure-windows 'ExitNewsgroup)
-    (pop-to-buffer gnus-Group-buffer)))
-
-(defun gnus-Subject-quit ()
+    (if (get-buffer gnus-summary-buffer)
+	(bury-buffer gnus-summary-buffer))
+    (if (get-buffer gnus-article-buffer)
+	(bury-buffer gnus-article-buffer))
+    (gnus-configure-windows 'newsgroups)
+    (pop-to-buffer gnus-group-buffer)))
+
+(defun gnus-summary-quit ()
   "Quit reading current newsgroup without updating read article info."
   (interactive)
   (if (y-or-n-p "Do you really wanna quit reading this group? ")
       (progn
 	(message "")			;Erase "Yes or No" question.
 	;; Return to Group selection mode.
-	(if (get-buffer gnus-Subject-buffer)
-	    (bury-buffer gnus-Subject-buffer))
-	(if (get-buffer gnus-Article-buffer)
-	    (bury-buffer gnus-Article-buffer))
-	(gnus-configure-windows 'ExitNewsgroup)
-	(pop-to-buffer gnus-Group-buffer)
-	(gnus-Group-jump-to-group gnus-newsgroup-name) ;Make sure where I was.
-	(gnus-Group-next-group 1)	;(gnus-Group-next-unread-group 1)
+	(if (get-buffer gnus-summary-buffer)
+	    (bury-buffer gnus-summary-buffer))
+	(if (get-buffer gnus-article-buffer)
+	    (bury-buffer gnus-article-buffer))
+	(gnus-configure-windows 'newsgroups)
+	(pop-to-buffer gnus-group-buffer)
+	(gnus-group-jump-to-group gnus-newsgroup-name) ;Make sure where I was.
+	(gnus-group-next-group 1)	;(gnus-group-next-unread-group 1)
 	)))
 
-(defun gnus-Subject-describe-briefly ()
-  "Describe Subject mode commands briefly."
+(defun gnus-summary-describe-briefly ()
+  "Describe Summary mode commands briefly."
   (interactive)
   (message
    (concat
-    (substitute-command-keys "\\[gnus-Subject-next-page]:Select  ")
-    (substitute-command-keys "\\[gnus-Subject-next-unread-article]:Forward  ")
-    (substitute-command-keys "\\[gnus-Subject-prev-unread-article]:Backward  ")
-    (substitute-command-keys "\\[gnus-Subject-exit]:Exit  ")
-    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
-    (substitute-command-keys "\\[gnus-Subject-describe-briefly]:This help")
+    (substitute-command-keys "\\[gnus-summary-next-page]:Select  ")
+    (substitute-command-keys "\\[gnus-summary-next-unread-article]:Forward  ")
+    (substitute-command-keys "\\[gnus-summary-prev-unread-article]:Backward  ")
+    (substitute-command-keys "\\[gnus-summary-exit]:Exit  ")
+    (substitute-command-keys "\\[gnus-info-find-node]:Run Info  ")
+    (substitute-command-keys "\\[gnus-summary-describe-briefly]:This help")
     )))
 
 
@@ -3607,31 +4070,31 @@
 ;;; GNUS Article Mode
 ;;;
 
-(if gnus-Article-mode-map
+(if gnus-article-mode-map
     nil
-  (setq gnus-Article-mode-map (make-keymap))
-  (suppress-keymap gnus-Article-mode-map)
-  (define-key gnus-Article-mode-map " " 'gnus-Article-next-page)
-  (define-key gnus-Article-mode-map "\177" 'gnus-Article-prev-page)
-  (define-key gnus-Article-mode-map "r" 'gnus-Article-refer-article)
-  (define-key gnus-Article-mode-map "o" 'gnus-Article-pop-article)
-  (define-key gnus-Article-mode-map "h" 'gnus-Article-show-subjects)
-  (define-key gnus-Article-mode-map "s" 'gnus-Article-show-subjects)
-  (define-key gnus-Article-mode-map "?" 'gnus-Article-describe-briefly)
-  (define-key gnus-Article-mode-map "\C-c\C-i" 'gnus-Info-find-node))
-
-(defun gnus-Article-mode ()
+  (setq gnus-article-mode-map (make-keymap))
+  (suppress-keymap gnus-article-mode-map)
+  (define-key gnus-article-mode-map " " 'gnus-article-next-page)
+  (define-key gnus-article-mode-map "\177" 'gnus-article-prev-page)
+  (define-key gnus-article-mode-map "r" 'gnus-article-refer-article)
+  (define-key gnus-article-mode-map "o" 'gnus-article-pop-article)
+  (define-key gnus-article-mode-map "h" 'gnus-article-show-summary)
+  (define-key gnus-article-mode-map "s" 'gnus-article-show-summary)
+  (define-key gnus-article-mode-map "?" 'gnus-article-describe-briefly)
+  (define-key gnus-article-mode-map "\C-c\C-i" 'gnus-info-find-node))
+
+(defun gnus-article-mode ()
   "Major mode for browsing through an article.
 All normal editing commands are turned off.
 Instead, these commands are available:
-\\{gnus-Article-mode-map}
+\\{gnus-article-mode-map}
 
 Various hooks for customization:
- gnus-Article-mode-hook
+ gnus-article-mode-hook
     Entry to this mode calls the value with no arguments, if that
     value is non-nil.
 
- gnus-Article-prepare-hook
+ gnus-article-prepare-hook
     Called with no arguments after an article is prepared for reading,
     if that value is non-nil."
   (interactive)
@@ -3642,80 +4105,113 @@
 	((listp (default-value 'mode-line-format))
 	 (setq mode-line-format
 	       (cons "--- " (cdr (default-value 'mode-line-format))))))
-  (make-local-variable 'global-mode-string)
-  (setq global-mode-string nil)
-  (setq major-mode 'gnus-Article-mode)
+  ;; To disable display-time facility.
+  ;;(make-local-variable 'global-mode-string)
+  ;;(setq global-mode-string nil)
+  (setq major-mode 'gnus-article-mode)
   (setq mode-name "Article")
-  (gnus-Article-set-mode-line)
-  (use-local-map gnus-Article-mode-map)
+  (make-local-variable 'minor-mode-alist)
+  (or (assq 'gnus-show-mime minor-mode-alist)
+      (setq minor-mode-alist
+	    (cons (list 'gnus-show-mime " MIME") minor-mode-alist)))
+  (gnus-article-set-mode-line)
+  (use-local-map gnus-article-mode-map)
   (make-local-variable 'page-delimiter)
   (setq page-delimiter gnus-page-delimiter)
   (make-local-variable 'mail-header-separator)
   (setq mail-header-separator "")	;For caesar function.
-  (buffer-disable-undo (current-buffer))
+  (buffer-flush-undo (current-buffer))
   (setq buffer-read-only t)		;Disable modification
-  (run-hooks 'gnus-Article-mode-hook))
-
-(defun gnus-Article-setup-buffer ()
+  (run-hooks 'gnus-article-mode-hook))
+
+(defun gnus-article-setup-buffer ()
   "Initialize Article mode buffer."
-  (or (get-buffer gnus-Article-buffer)
+  (or (get-buffer gnus-article-buffer)
       (save-excursion
-	(set-buffer (get-buffer-create gnus-Article-buffer))
-	(gnus-Article-mode))
+	(set-buffer (get-buffer-create gnus-article-buffer))
+	(gnus-article-mode))
       ))
 
-(defun gnus-Article-prepare (article &optional all-headers)
+(defun gnus-article-prepare (article &optional all-headers)
   "Prepare ARTICLE in Article mode buffer.
+ARTICLE can be either a article number or Message-ID.
 If optional argument ALL-HEADERS is non-nil, all headers are inserted."
+  ;; Make sure a connection to NNTP server is alive.
+  (if (not (gnus-server-opened))
+      (progn
+	(gnus-start-news-server)
+	(gnus-request-group gnus-newsgroup-name)))
   (save-excursion
-    (set-buffer gnus-Article-buffer)
+    (set-buffer gnus-article-buffer)
     (let ((buffer-read-only nil))
       (erase-buffer)
-      (if (gnus-request-article article)
+      ;; mhspool does not work with Message-ID.  So, let's translate
+      ;; it into an article number as possible as can.  This may help
+      ;; nnspool too.
+      ;; Note: this conversion must be done here since if the article
+      ;; is specified by number or message-id has a different meaning
+      ;; in the following.
+      (if (let* ((header
+		  (and (stringp article)
+		       (gnus-get-header-by-id article)))
+		 (article
+		  (if header
+		      (nntp-header-number header) article)))
+	    (gnus-request-article article))
 	  (progn
 	    ;; Prepare article buffer
 	    (insert-buffer-substring nntp-server-buffer)
-	    (setq gnus-have-all-headers (or all-headers gnus-show-all-headers))
+	    ;; gnus-have-all-headers must be either T or NIL.
+	    (setq gnus-have-all-headers
+		  (not (not (or all-headers gnus-show-all-headers))))
 	    (if (and (numberp article)
 		     (not (eq article gnus-current-article)))
-		;; Seems me that a new article is selected.
+		;; Seems me that a new article has been selected.
 		(progn
 		  ;; gnus-current-article must be an article number.
 		  (setq gnus-last-article gnus-current-article)
 		  (setq gnus-current-article article)
+;;		  (setq gnus-current-headers
+;;			(gnus-find-header-by-number gnus-newsgroup-headers
+;;						    gnus-current-article))
 		  (setq gnus-current-headers
-			(gnus-find-header-by-number gnus-newsgroup-headers
-						    gnus-current-article))
-		  ;; Clear articles history only when articles are
-		  ;; retrieved by article numbers.
-		  (setq gnus-current-history nil)
-		  (run-hooks 'gnus-Mark-article-hook)
+			(gnus-get-header-by-number gnus-current-article))
+		  (run-hooks 'gnus-mark-article-hook)
 		  ))
-	    ;; Hooks for modifying contents of the article. This hook
+	    ;; Clear article history only when the article is
+	    ;; retrieved by the article number.
+	    (if (numberp article)
+		(setq gnus-current-history nil))
+	    ;; Hooks for modifying contents of the article.  This hook
 	    ;; must be called before being narrowed.
-	    (run-hooks 'gnus-Article-prepare-hook)
+	    (run-hooks 'gnus-article-prepare-hook)
+	    ;; Decode MIME message.
+	    (if (and gnus-show-mime
+		     (gnus-fetch-field "Mime-Version"))
+		(funcall gnus-show-mime-method))
 	    ;; Delete unnecessary headers.
 	    (or gnus-have-all-headers
-		(gnus-Article-delete-headers))
+		(gnus-article-delete-headers))
 	    ;; Do page break.
 	    (goto-char (point-min))
 	    (if gnus-break-pages
 		(gnus-narrow-to-page))
 	    ;; Next function must be called after setting
 	    ;;  `gnus-current-article' variable and narrowed to page.
-	    (gnus-Article-set-mode-line)
+	    (gnus-article-set-mode-line)
 	    )
+	;; There is no such article.
 	(if (numberp article)
-	    (gnus-Subject-mark-as-read article))
+	    (gnus-summary-mark-as-read article))
 	(ding) (message "No such article (may be canceled)"))
       )))
 
-(defun gnus-Article-show-all-headers ()
+(defun gnus-article-show-all-headers ()
   "Show all article headers in Article mode buffer."
   (or gnus-have-all-headers
-      (gnus-Article-prepare gnus-current-article t)))
-
-;;(defun gnus-Article-set-mode-line ()
+      (gnus-article-prepare gnus-current-article t)))
+
+;;(defun gnus-article-set-mode-line ()
 ;;  "Set Article mode line string."
 ;;  (setq mode-line-buffer-identification
 ;;	(list 17
@@ -3727,33 +4223,54 @@
 ;;                    )))
 ;;  (set-buffer-modified-p t))
 
-(defun gnus-Article-set-mode-line ()
-  "Set Article mode line string."
-  (let ((unmarked
-	 (- (length gnus-newsgroup-unreads)
-	    (length (gnus-intersection
-		     gnus-newsgroup-unreads gnus-newsgroup-marked))))
-	(unselected
-	 (- (length gnus-newsgroup-unselected)
-	    (length (gnus-intersection
-		     gnus-newsgroup-unselected gnus-newsgroup-marked)))))
+;;(defun gnus-article-set-mode-line ()
+;;  "Set Article mode line string."
+;;  (let ((unmarked
+;;	 (- (length gnus-newsgroup-unreads)
+;;	    (length (gnus-intersection
+;;		     gnus-newsgroup-unreads gnus-newsgroup-marked))))
+;;	(unselected
+;;	 (- (length gnus-newsgroup-unselected)
+;;	    (length (gnus-intersection
+;;		     gnus-newsgroup-unselected gnus-newsgroup-marked)))))
+;;    (setq mode-line-buffer-identification
+;;	  (list 17
+;;		(format "GNUS: %s{%d} %s"
+;;			gnus-newsgroup-name
+;;			gnus-current-article
+;;			;; This is proposed by tale@pawl.rpi.edu.
+;;			(cond ((and (zerop unmarked)
+;;				    (zerop unselected))
+;;			       "      ")
+;;			      ((zerop unselected)
+;;			       (format "%d more" unmarked))
+;;			      (t
+;;			       (format "%d(+%d) more" unmarked unselected)))
+;;			))))
+;;  (set-buffer-modified-p t))
+
+;; New implementation in gnus 3.14.3
+
+(defun gnus-article-set-mode-line ()
+  "Set Article mode line string.
+If you don't like it, define your own gnus-article-set-mode-line."
+  (let ((maxlen 15)			;Maximum subject length
+	(subject
+	 (if gnus-current-headers
+	     (nntp-header-subject gnus-current-headers) "")))
+    ;; The value must be a string to escape %-constructs because of subject.
     (setq mode-line-buffer-identification
-	  (list 17
-		(format "GNUS: %s{%d} %s"
-			gnus-newsgroup-name
-			gnus-current-article
-			;; This is proposed by tale@pawl.rpi.edu.
-			(cond ((and (zerop unmarked)
-				    (zerop unselected))
-			       "      ")
-			      ((zerop unselected)
-			       (format "%d more" unmarked))
-			      (t
-			       (format "%d(+%d) more" unmarked unselected)))
-			))))
+	  (format "GNUS: %s%s %s%s%s"
+		  gnus-newsgroup-name
+		  (if gnus-current-article
+		      (format "/%d" gnus-current-article) "")
+		  (substring subject 0 (min (length subject) maxlen))
+		  (if (> (length subject) maxlen) "..." "")
+		  (make-string (max 0 (- 17 (length subject))) ? )
+		  )))
   (set-buffer-modified-p t))
 
-(defun gnus-Article-delete-headers ()
+(defun gnus-article-delete-headers ()
   "Delete unnecessary headers."
   (save-excursion
     (save-restriction
@@ -3772,7 +4289,7 @@
 
 ;; Working on article's buffer
 
-(defun gnus-Article-next-page (lines)
+(defun gnus-article-next-page (lines)
   "Show next page of current article.
 If end of article, return non-nil. Otherwise return nil.
 Argument LINES specifies lines to be scrolled up."
@@ -3801,7 +4318,7 @@
     nil
     ))
 
-(defun gnus-Article-prev-page (lines)
+(defun gnus-article-prev-page (lines)
   "Show previous page of current article.
 Argument LINES specifies lines to be scrolled down."
   (interactive "P")
@@ -3815,7 +4332,7 @@
 	(recenter -1))
     (scroll-down lines)))
 
-(defun gnus-Article-next-digest (nth)
+(defun gnus-article-next-digest (nth)
   "Move to head of NTH next digested message.
 Set mark at end of digested message."
   ;; Stop page breaking in digest mode.
@@ -3845,7 +4362,7 @@
     (message "End of message")
     ))
 
-(defun gnus-Article-prev-digest (nth)
+(defun gnus-article-prev-digest (nth)
   "Move to head of NTH previous digested message."
   ;; Stop page breaking in digest mode.
   (widen)
@@ -3874,7 +4391,7 @@
     (message "Top of message")
     ))
 
-(defun gnus-Article-refer-article ()
+(defun gnus-article-refer-article ()
   "Read article specified by message-id around point."
   (interactive)
   (save-window-excursion
@@ -3883,35 +4400,35 @@
       (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t)
 	  (let ((message-id
 		 (buffer-substring (match-beginning 1) (match-end 1))))
-	    (set-buffer gnus-Subject-buffer)
-	    (gnus-Subject-refer-article message-id))
+	    (set-buffer gnus-summary-buffer)
+	    (gnus-summary-refer-article message-id))
 	(error "No references around point"))
       )))
 
-(defun gnus-Article-pop-article ()
+(defun gnus-article-pop-article ()
   "Pop up article history."
   (interactive)
   (save-window-excursion
-    (set-buffer gnus-Subject-buffer)
-    (gnus-Subject-refer-article nil)))
-
-(defun gnus-Article-show-subjects ()
-  "Reconfigure windows to show headers."
+    (set-buffer gnus-summary-buffer)
+    (gnus-summary-refer-article nil)))
+
+(defun gnus-article-show-summary ()
+  "Reconfigure windows to show Summary buffer."
   (interactive)
-  (gnus-configure-windows 'SelectArticle)
-  (pop-to-buffer gnus-Subject-buffer)
-  (gnus-Subject-goto-subject gnus-current-article))
-
-(defun gnus-Article-describe-briefly ()
+  (gnus-configure-windows 'article)
+  (pop-to-buffer gnus-summary-buffer)
+  (gnus-summary-goto-subject gnus-current-article))
+
+(defun gnus-article-describe-briefly ()
   "Describe Article mode commands briefly."
   (interactive)
   (message
    (concat
-    (substitute-command-keys "\\[gnus-Article-next-page]:Next page  ")
-    (substitute-command-keys "\\[gnus-Article-prev-page]:Prev page  ")
-    (substitute-command-keys "\\[gnus-Article-show-subjects]:Show headers  ")
-    (substitute-command-keys "\\[gnus-Info-find-node]:Run Info  ")
-    (substitute-command-keys "\\[gnus-Article-describe-briefly]:This help")
+    (substitute-command-keys "\\[gnus-article-next-page]:Next page  ")
+    (substitute-command-keys "\\[gnus-article-prev-page]:Prev page  ")
+    (substitute-command-keys "\\[gnus-article-show-summary]:Show Summary  ")
+    (substitute-command-keys "\\[gnus-info-find-node]:Run Info  ")
+    (substitute-command-keys "\\[gnus-article-describe-briefly]:This help")
     )))
 
 
@@ -3919,27 +4436,27 @@
 ;;; GNUS KILL-File Mode
 ;;;
 
-(if gnus-Kill-file-mode-map
+(if gnus-kill-file-mode-map
     nil
-  (setq gnus-Kill-file-mode-map (copy-keymap emacs-lisp-mode-map))
-  (define-key gnus-Kill-file-mode-map "\C-c\C-k\C-s" 'gnus-Kill-file-kill-by-subject)
-  (define-key gnus-Kill-file-mode-map "\C-c\C-k\C-a" 'gnus-Kill-file-kill-by-author)
-  (define-key gnus-Kill-file-mode-map "\C-c\C-a" 'gnus-Kill-file-apply-buffer)
-  (define-key gnus-Kill-file-mode-map "\C-c\C-e" 'gnus-Kill-file-apply-last-sexp)
-  (define-key gnus-Kill-file-mode-map "\C-c\C-c" 'gnus-Kill-file-exit)
-  (define-key gnus-Kill-file-mode-map "\C-c\C-i" 'gnus-Info-find-node))
-
-(defun gnus-Kill-file-mode ()
+  (setq gnus-kill-file-mode-map (copy-keymap emacs-lisp-mode-map))
+  (define-key gnus-kill-file-mode-map "\C-c\C-k\C-s" 'gnus-kill-file-kill-by-subject)
+  (define-key gnus-kill-file-mode-map "\C-c\C-k\C-a" 'gnus-kill-file-kill-by-author)
+  (define-key gnus-kill-file-mode-map "\C-c\C-a" 'gnus-kill-file-apply-buffer)
+  (define-key gnus-kill-file-mode-map "\C-c\C-e" 'gnus-kill-file-apply-last-sexp)
+  (define-key gnus-kill-file-mode-map "\C-c\C-c" 'gnus-kill-file-exit)
+  (define-key gnus-kill-file-mode-map "\C-c\C-i" 'gnus-info-find-node))
+
+(defun gnus-kill-file-mode ()
   "Major mode for editing KILL file.
 
 In addition to Emacs-Lisp Mode, the following commands are available:
 
-\\[gnus-Kill-file-kill-by-subject]	Insert KILL command for current subject.
-\\[gnus-Kill-file-kill-by-author]	Insert KILL command for current author.
-\\[gnus-Kill-file-apply-buffer]	Apply current buffer to selected newsgroup.
-\\[gnus-Kill-file-apply-last-sexp]	Apply sexp before point to selected newsgroup.
-\\[gnus-Kill-file-exit]	Save file and exit editing KILL file.
-\\[gnus-Info-find-node]	Read Info about KILL file.
+\\[gnus-kill-file-kill-by-subject]	Insert KILL command for current subject.
+\\[gnus-kill-file-kill-by-author]	Insert KILL command for current author.
+\\[gnus-kill-file-apply-buffer]	Apply current buffer to selected newsgroup.
+\\[gnus-kill-file-apply-last-sexp]	Apply sexp before point to selected newsgroup.
+\\[gnus-kill-file-exit]	Save file and exit editing KILL file.
+\\[gnus-info-find-node]	Read Info about KILL file.
 
   A KILL file contains lisp expressions to be applied to a selected
 newsgroup. The purpose is to mark articles as read on the basis of
@@ -3949,20 +4466,20 @@
 use a local one.
 
   A KILL file can contain any kind of Emacs lisp expressions expected
-to be evaluated in the Subject buffer. Writing lisp programs for this
+to be evaluated in the Summary buffer. Writing lisp programs for this
 purpose is not so easy because the internal working of GNUS must be
 well-known. For this reason, GNUS provides a general function which
 does this easily for non-Lisp programmers.
 
-  The `gnus-kill' function executes commands available in Subject Mode
+  The `gnus-kill' function executes commands available in Summary Mode
 by their key sequences. `gnus-kill' should be called with FIELD,
 REGEXP and optional COMMAND and ALL. FIELD is a string representing
 the header field or an empty string. If FIELD is an empty string, the
 entire article body is searched for. REGEXP is a string which is
 compared with FIELD value. COMMAND is a string representing a valid
-key sequence in Subject Mode or Lisp expression. COMMAND is default to
-'(gnus-Subject-mark-as-read nil \"X\"). Make sure that COMMAND is
-executed in the Subject buffer.  If the second optional argument ALL
+key sequence in Summary Mode or Lisp expression. COMMAND is default to
+'(gnus-summary-mark-as-read nil \"X\"). Make sure that COMMAND is
+executed in the Summary buffer.  If the second optional argument ALL
 is non-nil, the COMMAND is applied to articles which are already
 marked as read or unread.  Articles which are marked are skipped over
 by default.
@@ -3978,31 +4495,31 @@
 	(gnus-kill \"Subject\" \"AI\" \"d\")
 
 In this example it is assumed that the command
-`gnus-Subject-mark-as-read-forward' is assigned to `d' in Subject Mode.
+`gnus-summary-mark-as-read-forward' is assigned to `d' in Summary Mode.
 
   It is possible to delete unnecessary headers which are marked with
 `X' in a KILL file as follows:
 
 	(gnus-expunge \"X\")
 
-  If the Subject buffer is empty after applying KILL files, GNUS will
+  If the Summary buffer is empty after applying KILL files, GNUS will
 exit the selected newsgroup normally.  If headers which are marked
 with `D' are deleted in a KILL file, it is impossible to read articles
 which are marked as read in the previous GNUS sessions.  Marks other
 than `D' should be used for articles which should really be deleted.
 
 Entry to this mode calls emacs-lisp-mode-hook and
-gnus-Kill-file-mode-hook with no arguments, if that value is non-nil."
+gnus-kill-file-mode-hook with no arguments, if that value is non-nil."
   (interactive)
   (kill-all-local-variables)
-  (use-local-map gnus-Kill-file-mode-map)
+  (use-local-map gnus-kill-file-mode-map)
   (set-syntax-table emacs-lisp-mode-syntax-table)
-  (setq major-mode 'gnus-Kill-file-mode)
+  (setq major-mode 'gnus-kill-file-mode)
   (setq mode-name "KILL-File")
   (lisp-mode-variables nil)
-  (run-hooks 'emacs-lisp-mode-hook 'gnus-Kill-file-mode-hook))
-
-(defun gnus-Kill-file-edit-file (newsgroup)
+  (run-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook))
+
+(defun gnus-kill-file-edit-file (newsgroup)
   "Begin editing a KILL file of NEWSGROUP.
 If NEWSGROUP is nil, the global KILL file is selected."
   (interactive "sNewsgroup: ")
@@ -4016,24 +4533,24 @@
     (let ((buffer (find-file-noselect file)))
       (cond ((get-buffer-window buffer)
 	     (pop-to-buffer buffer))
-	    ((eq major-mode 'gnus-Group-mode)
+	    ((eq major-mode 'gnus-group-mode)
 	     (gnus-configure-windows '(1 0 0)) ;Take all windows.
-	     (pop-to-buffer gnus-Group-buffer)
-	     (let ((gnus-Subject-buffer buffer))
+	     (pop-to-buffer gnus-group-buffer)
+	     (let ((gnus-summary-buffer buffer))
 	       (gnus-configure-windows '(1 1 0)) ;Split into two.
 	       (pop-to-buffer buffer)))
-	    ((eq major-mode 'gnus-Subject-mode)
-	     (gnus-configure-windows 'SelectArticle)
-	     (pop-to-buffer gnus-Article-buffer)
-	     (bury-buffer gnus-Article-buffer)
+	    ((eq major-mode 'gnus-summary-mode)
+	     (gnus-configure-windows 'article)
+	     (pop-to-buffer gnus-article-buffer)
+	     (bury-buffer gnus-article-buffer)
 	     (switch-to-buffer buffer))
 	    (t				;No good rules.
 	     (find-file-other-window file))
 	    ))
-    (gnus-Kill-file-mode)
+    (gnus-kill-file-mode)
     ))
 
-(defun gnus-Kill-file-kill-by-subject ()
+(defun gnus-kill-file-kill-by-subject ()
   "Insert KILL command for current subject."
   (interactive)
   (insert
@@ -4042,11 +4559,13 @@
 	    (if gnus-current-kill-article
 		(regexp-quote
 		 (nntp-header-subject
+		  ;; No need to speed up this command.
+		  ;;(gnus-get-header-by-number gnus-current-kill-article)
 		  (gnus-find-header-by-number gnus-newsgroup-headers
 					      gnus-current-kill-article)))
 	      "")))))
 
-(defun gnus-Kill-file-kill-by-author ()
+(defun gnus-kill-file-kill-by-author ()
   "Insert KILL command for current author."
   (interactive)
   (insert
@@ -4055,46 +4574,48 @@
 	    (if gnus-current-kill-article
 		(regexp-quote
 		 (nntp-header-from
+		  ;; No need to speed up this command.
+		  ;;(gnus-get-header-by-number gnus-current-kill-article)
 		  (gnus-find-header-by-number gnus-newsgroup-headers
 					      gnus-current-kill-article)))
 	      "")))))
 
-(defun gnus-Kill-file-apply-buffer ()
+(defun gnus-kill-file-apply-buffer ()
   "Apply current buffer to current newsgroup."
   (interactive)
   (if (and gnus-current-kill-article
-	   (get-buffer gnus-Subject-buffer))
+	   (get-buffer gnus-summary-buffer))
       ;; Assume newsgroup is selected.
       (let ((string (concat "(progn \n" (buffer-string) "\n)" )))
 	(save-excursion
 	  (save-window-excursion
-	    (pop-to-buffer gnus-Subject-buffer)
+	    (pop-to-buffer gnus-summary-buffer)
 	    (eval (car (read-from-string string))))))
     (ding) (message "No newsgroup is selected.")))
 
-(defun gnus-Kill-file-apply-last-sexp ()
+(defun gnus-kill-file-apply-last-sexp ()
   "Apply sexp before point in current buffer to current newsgroup."
   (interactive)
   (if (and gnus-current-kill-article
-	   (get-buffer gnus-Subject-buffer))
+	   (get-buffer gnus-summary-buffer))
       ;; Assume newsgroup is selected.
       (let ((string
 	     (buffer-substring
 	      (save-excursion (forward-sexp -1) (point)) (point))))
 	(save-excursion
 	  (save-window-excursion
-	    (pop-to-buffer gnus-Subject-buffer)
+	    (pop-to-buffer gnus-summary-buffer)
 	    (eval (car (read-from-string string))))))
     (ding) (message "No newsgroup is selected.")))
 
-(defun gnus-Kill-file-exit ()
+(defun gnus-kill-file-exit ()
   "Save a KILL file, then return to the previous buffer."
   (interactive)
   (save-buffer)
   (let ((killbuf (current-buffer)))
     ;; We don't want to return to Article buffer.
-    (and (get-buffer gnus-Article-buffer)
-	 (bury-buffer (get-buffer gnus-Article-buffer)))
+    (and (get-buffer gnus-article-buffer)
+	 (bury-buffer (get-buffer gnus-article-buffer)))
     ;; Delete the KILL file windows.
     (delete-windows-on killbuf)
     ;; Restore last window configuration if available.
@@ -4147,16 +4668,18 @@
 	       (or (null no)
 		   (not (string-match no group))))
 	  (progn
-	    (gnus-Subject-read-group group nil t)
-	    (if (eq (current-buffer) (get-buffer gnus-Subject-buffer))
-		(gnus-Subject-exit t))
+	    (gnus-summary-read-group group nil t)
+	    (if (eq (current-buffer) (get-buffer gnus-summary-buffer))
+		(gnus-summary-exit t))
 	    ))
       )
     ;; Finally, exit Emacs.
-    (set-buffer gnus-Group-buffer)
-    (gnus-Group-exit)
+    (set-buffer gnus-group-buffer)
+    (gnus-group-exit)
     ))
 
+;; For saving articles
+
 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
   "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num.
@@ -4164,7 +4687,7 @@
   (let ((default
 	  (expand-file-name
 	   (concat (if gnus-use-long-file-name
-		       (capitalize newsgroup)
+		       (gnus-capitalize-newsgroup newsgroup)
 		     (gnus-newsgroup-directory-form newsgroup))
 		   "/" (int-to-string (nntp-header-number headers)))
 	   (or gnus-article-save-directory "~/News"))))
@@ -4200,7 +4723,7 @@
   (or last-file
       (expand-file-name
        (if gnus-use-long-file-name
-	   (capitalize newsgroup)
+	   (gnus-capitalize-newsgroup newsgroup)
 	 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
        (or gnus-article-save-directory "~/News"))))
 
@@ -4222,7 +4745,7 @@
   (or last-folder
       (concat "+"
 	      (if gnus-use-long-file-name
-		  (capitalize newsgroup)
+		  (gnus-capitalize-newsgroup newsgroup)
 		(gnus-newsgroup-directory-form newsgroup)))))
 
 (defun gnus-folder-save-name (newsgroup headers &optional last-folder)
@@ -4235,6 +4758,8 @@
 		  newsgroup
 		(gnus-newsgroup-directory-form newsgroup)))))
 
+;; For KILL files
+
 (defun gnus-apply-kill-file ()
   "Apply KILL file to the current newsgroup."
   ;; Apply the global KILL file.
@@ -4252,7 +4777,7 @@
 			   (or gnus-article-save-directory "~/News")))
 	(gnus-use-long-file-name
 	 ;; Append ".KILL" to capitalized newsgroup name.
-	 (expand-file-name (concat (capitalize newsgroup)
+	 (expand-file-name (concat (gnus-capitalize-newsgroup newsgroup)
 				   "." gnus-kill-file-name)
 			   (or gnus-article-save-directory "~/News")))
 	(t
@@ -4281,6 +4806,67 @@
 			   (or gnus-article-save-directory "~/News")))
 	))
 
+;; For subscribing new newsgroup
+
+(defun gnus-subscribe-randomly (newsgroup)
+  "Subscribe new NEWSGROUP and insert it at the beginning of newsgroups."
+  (gnus-subscribe-newsgroup newsgroup
+			    (car (car gnus-newsrc-assoc))))
+
+(defun gnus-subscribe-alphabetically (newgroup)
+  "Subscribe new NEWSGROUP and insert it in strict alphabetic order."
+  ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams)
+  (let ((groups gnus-newsrc-assoc)
+	(before nil))
+    (while (and (not before) groups)
+      (if (string< newgroup (car (car groups)))
+	  (setq before (car (car groups)))
+	(setq groups (cdr groups))))
+    (gnus-subscribe-newsgroup newgroup before)
+    ))
+
+(defun gnus-subscribe-hierarchically (newgroup)
+  "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order."
+  ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams)
+  (save-excursion
+    (set-buffer (find-file-noselect gnus-current-startup-file))
+    (let ((groupkey newgroup)
+	  (before nil))
+      (while (and (not before) groupkey)
+	(goto-char (point-min))
+	(let ((groupkey-re
+	       (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]")))
+	  (while (and (re-search-forward groupkey-re nil t)
+		      (progn
+			(setq before (buffer-substring
+				      (match-beginning 1) (match-end 1)))
+			(string< before newgroup)))
+	    ))
+	;; Remove tail of newsgroup name (eg. a.b.c -> a.b)
+	(setq groupkey
+	      (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey)
+		  (substring groupkey (match-beginning 1) (match-end 1)))))
+      (gnus-subscribe-newsgroup newgroup before)
+      )))
+
+(defun gnus-subscribe-interactively (newsgroup)
+  "Subscribe new NEWSGROUP interactively.
+It is inserted in hierarchical newsgroup order if subscribed.
+Unless, it is killed."
+  (if (y-or-n-p (format "Subscribe new newsgroup: %s " newsgroup))
+      (gnus-subscribe-hierarchically newsgroup)
+    ;; Save in kill-ring
+    (gnus-subscribe-newsgroup newsgroup)
+    (gnus-kill-newsgroup newsgroup)))
+
+(defun gnus-subscribe-newsgroup (newsgroup &optional next)
+  "Subscribe new NEWSGROUP.
+If optional argument NEXT is non-nil, it is inserted before NEXT."
+  (gnus-insert-newsgroup (list newsgroup t) next)
+  (message "Subscribe newsgroup: %s" newsgroup))
+
+;; For directories
+
 (defun gnus-newsgroup-directory-form (newsgroup)
   "Make hierarchical directory name from NEWSGROUP name."
   (let ((newsgroup (substring newsgroup 0)) ;Copy string.
@@ -4303,15 +4889,29 @@
 
 (defun gnus-make-directory-1 (head tail)
   (cond ((string-match "^/\\([^/]+\\)" tail)
-	 (setq head
-	       (concat (file-name-as-directory head)
-		       (substring tail (match-beginning 1) (match-end 1))))
-	 (or (file-exists-p head)
-	     (call-process "mkdir" nil nil nil head))
-	 (gnus-make-directory-1 head (substring tail (match-end 1))))
+	 ;; ange-ftp interferes with calling match-* after
+	 ;; calling file-name-as-directory.
+	 (let ((beg (match-beginning 1))
+	       (end (match-end 1)))
+	   (setq head (concat (file-name-as-directory head)
+			      (substring tail beg end)))
+	   (or (file-exists-p head)
+	       (call-process "mkdir" nil nil nil head))
+	   (gnus-make-directory-1 head (substring tail end))))
 	((string-equal tail "") t)
 	))
 
+(defun gnus-capitalize-newsgroup (newsgroup)
+  "Capitalize NEWSGROUP name with treating '.' and '-' as part of words."
+  ;; Suggested by "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>.
+  (let ((current-syntax-table (copy-syntax-table (syntax-table))))
+    (unwind-protect
+	(progn
+	  (modify-syntax-entry ?- "w")
+	  (modify-syntax-entry ?. "w")
+	  (capitalize newsgroup))
+      (set-syntax-table current-syntax-table))))
+
 (defun gnus-simplify-subject (subject &optional re-only)
   "Remove `Re:' and words in parentheses.
 If optional argument RE-ONLY is non-nil, strip `Re:' only."
@@ -4345,58 +4945,101 @@
   "Return a string like `NNN' from HEADER."
   (format "%4d" (nntp-header-lines header)))
 
+;; Basic ideas by flee@cs.psu.edu (Felix Lee)
+
+(defun gnus-keysort-headers (predicate key &optional reverse)
+  "Sort current headers by PREDICATE using a value passed by KEY safely.
+*Safely* means C-g quitting is disabled during sort.
+Optional argument REVERSE means reverse order."
+  (let ((inhibit-quit t))
+    (setq gnus-newsgroup-headers
+	  (if reverse
+	      (nreverse
+	       (gnus-keysort (nreverse gnus-newsgroup-headers) predicate key))
+	    (gnus-keysort gnus-newsgroup-headers predicate key)))
+    ;; Make sure we don't have to call
+    ;; gnus-clear-hashtables-for-newsgroup-headers to clear hash
+    ;; tables for the variable gnus-newsgroup-headers since no new
+    ;; entry is added to nor deleted from the variable.
+    ))
+
+(defun gnus-keysort (list predicate key)
+  "Sort LIST by PREDICATE using a value passed by KEY."
+  (mapcar (function cdr)
+	  (sort (mapcar (function (lambda (a) (cons (funcall key a) a))) list)
+		(function (lambda (a b)
+			    (funcall predicate (car a) (car b)))))))
+
 (defun gnus-sort-headers (predicate &optional reverse)
-  "Sort current group headers by PREDICATE safely.
-*Safely* means C-g quitting is disabled during sorting.
+  "Sort current headers by PREDICATE safely.
+*Safely* means C-g quitting is disabled during sort.
 Optional argument REVERSE means reverse order."
   (let ((inhibit-quit t))
     (setq gnus-newsgroup-headers
 	  (if reverse
 	      (nreverse (sort (nreverse gnus-newsgroup-headers) predicate))
 	    (sort gnus-newsgroup-headers predicate)))
+    ;; Make sure we don't have to call
+    ;; gnus-clear-hashtables-for-newsgroup-headers to clear hash
+    ;; tables for the variable gnus-newsgroup-headers since no new
+    ;; entry is added to nor deleted from the variable.
     ))
 
 (defun gnus-string-lessp (a b)
   "Return T if first arg string is less than second in lexicographic order.
 If case-fold-search is non-nil, case of letters is ignored."
   (if case-fold-search
-      (string-lessp (downcase a) (downcase b)) (string-lessp a b)))
+      (string-lessp (downcase a) (downcase b))
+    (string-lessp a b)))
 
 (defun gnus-date-lessp (date1 date2)
   "Return T if DATE1 is earlyer than DATE2."
-  (string-lessp (gnus-comparable-date date1)
-		(gnus-comparable-date date2)))
-
-(defun gnus-comparable-date (date)
-  "Make comparable string by string-lessp from DATE."
-  (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3")
-		 ("APR" . " 4")("MAY" . " 5")("JUN" . " 6")
-		 ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9")
-		 ("OCT" . "10")("NOV" . "11")("DEC" . "12")))
-	(date (or date "")))
-    ;; Can understand the following styles:
-    ;; (1) 14 Apr 89 03:20:12 GMT
-    ;; (2) Fri, 17 Mar 89 4:01:33 GMT
-    (if (string-match
-	 "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date)
-	(concat
-	 ;; Year
-	 (substring date (match-beginning 3) (match-end 3))
-	 ;; Month
-	 (cdr
-	  (assoc
-	   (upcase (substring date (match-beginning 2) (match-end 2))) month))
-	 ;; Day
-	 (format "%2d" (string-to-int
-			(substring date
-				   (match-beginning 1) (match-end 1))))
-	 ;; Time
-	 (substring date (match-beginning 4) (match-end 4)))
-      ;; Cannot understand DATE string.
-      date
-      )
+  (string-lessp (gnus-sortable-date date1)
+		(gnus-sortable-date date2)))
+
+(defun gnus-sortable-date (date)
+  "Make sortable string by string-lessp from DATE.
+Timezone package is used."
+  (let* ((date   (timezone-parse-date date)) ;[Y M D T]
+	 (year   (string-to-int (aref date 0)))
+	 (month  (string-to-int (aref date 1)))
+	 (day    (string-to-int (aref date 2)))
+	 (time   (aref date 3)))	;HH:MM:SS
+    ;; Timezone package is used.  But, we don't have to care about
+    ;; the timezone since article's timezones are always GMT.
+    (timezone-make-sortable-date year month day time)
     ))
 
+;;(defun gnus-sortable-date (date)
+;;  "Make sortable string by string-lessp from DATE."
+;;  (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3")
+;;		 ("APR" . " 4")("MAY" . " 5")("JUN" . " 6")
+;;		 ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9")
+;;		 ("OCT" . "10")("NOV" . "11")("DEC" . "12")))
+;;	(date (or date "")))
+;;    ;; Can understand the following styles:
+;;    ;; (1) 14 Apr 89 03:20:12 GMT
+;;    ;; (2) Fri, 17 Mar 89 4:01:33 GMT
+;;    (if (string-match
+;;	 "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date)
+;;	(concat
+;;	 ;; Year
+;;	 (substring date (match-beginning 3) (match-end 3))
+;;	 ;; Month
+;;	 (cdr
+;;	  (assoc
+;;	   (upcase (substring date (match-beginning 2) (match-end 2))) month))
+;;	 ;; Day
+;;	 (format "%2d" (string-to-int
+;;			(substring date
+;;				   (match-beginning 1) (match-end 1))))
+;;	 ;; Time
+;;	 (substring date (match-beginning 4) (match-end 4)))
+;;      ;; Cannot understand DATE string.
+;;      date
+;;      )
+;;    ))
+
 (defun gnus-fetch-field (field)
   "Return the value of the header FIELD of current article."
   (save-excursion
@@ -4407,32 +5050,32 @@
 			(progn (search-forward "\n\n" nil 'move) (point)))
       (mail-fetch-field field))))
 
-(fset 'gnus-expunge 'gnus-Subject-delete-marked-with)
+(fset 'gnus-expunge 'gnus-summary-delete-marked-with)
 
 (defun gnus-kill (field regexp &optional command all)
   "If FIELD of an article matches REGEXP, execute COMMAND.
-Optional third argument COMMAND is default to
-	(gnus-Subject-mark-as-read nil \"X\").
-If optional fourth argument ALL is non-nil, articles marked are also applied
-to.  If FIELD is an empty string (or nil), entire article body is searched for.
+Optional 1st argument COMMAND is default to
+	(gnus-summary-mark-as-read nil \"X\").
+If optional 2nd argument ALL is non-nil, articles marked are also applied to.
+If FIELD is an empty string (or nil), entire article body is searched for.
 COMMAND must be a lisp expression or a string representing a key sequence."
   ;; We don't want to change current point nor window configuration.
   (save-excursion
     (save-window-excursion
-      ;; Selected window must be Subject mode buffer to execute
-      ;; keyboard macros correctly. See command_loop_1.
-      (switch-to-buffer gnus-Subject-buffer 'norecord)
+      ;; Selected window must be Summary buffer to execute keyboard
+      ;; macros correctly. See command_loop_1.
+      (switch-to-buffer gnus-summary-buffer 'norecord)
       (goto-char (point-min))		;From the beginning.
       (if (null command)
-	  (setq command '(gnus-Subject-mark-as-read nil "X")))
+	  (setq command '(gnus-summary-mark-as-read nil "X")))
       (gnus-execute field regexp command nil (not all))
       )))
 
 (defun gnus-execute (field regexp form &optional backward ignore-marked)
   "If FIELD of article header matches REGEXP, execute lisp FORM (or a string).
 If FIELD is an empty string (or nil), entire article body is searched for.
-If optional fifth argument BACKWARD is non-nil, do backward instead.
-If optional sixth argument IGNORE-MARKED is non-nil, articles which are
+If optional 1st argument BACKWARD is non-nil, do backward instead.
+If optional 2nd argument IGNORE-MARKED is non-nil, articles which are
 marked as read or unread are ignored."
   (let ((function nil)
 	(header nil)
@@ -4454,25 +5097,26 @@
     ;; Starting from the current article.
     (or (and ignore-marked
 	     ;; Articles marked as read and unread should be ignored.
-	     (setq article (gnus-Subject-article-number))
+	     (setq article (gnus-summary-article-number))
 	     (or (not (memq article gnus-newsgroup-unreads)) ;Marked as read.
 		 (memq article gnus-newsgroup-marked) ;Marked as unread.
 		 ))
 	(gnus-execute-1 function regexp form))
-    (while (gnus-Subject-search-subject backward ignore-marked nil)
+    (while (gnus-summary-search-subject backward ignore-marked nil)
       (gnus-execute-1 function regexp form))
     ))
 
 (defun gnus-execute-1 (function regexp form)
   (save-excursion
-    ;; The point of Subject mode buffer must be saved during execution.
-    (let ((article (gnus-Subject-article-number)))
+    ;; The point of Summary buffer must be saved during execution.
+    (let ((article (gnus-summary-article-number)))
       (if (null article)
 	  nil				;Nothing to do.
 	(if function
 	    ;; Compare with header field.
-	    (let ((header (gnus-find-header-by-number
-			   gnus-newsgroup-headers article))
+	    (let (;;(header (gnus-find-header-by-number
+		  ;;	    gnus-newsgroup-headers article))
+		  (header (gnus-get-header-by-number article))
 		  (value nil))
 	      (and header
 		   (progn
@@ -4488,12 +5132,12 @@
 	  (let ((gnus-current-article nil) ;Save article pointer.
 		(gnus-last-article nil)
 		(gnus-break-pages nil)	;No need to break pages.
-		(gnus-Mark-article-hook nil)) ;Inhibit marking as read.
+		(gnus-mark-article-hook nil)) ;Inhibit marking as read.
 	    (message "Searching for article: %d..." article)
-	    (gnus-Article-setup-buffer)
-	    (gnus-Article-prepare article t)
+	    (gnus-article-setup-buffer)
+	    (gnus-article-prepare article t)
 	    (if (save-excursion
-		  (set-buffer gnus-Article-buffer)
+		  (set-buffer gnus-article-buffer)
 		  (goto-char (point-min))
 		  (re-search-forward regexp nil t))
 		(if (stringp form)	;Keyboard macro.
@@ -4617,7 +5261,7 @@
 		(kill-buffer file-buffer))
 	    (error "Output file does not exist")))
       (set-buffer tmpbuf)
-      (buffer-disable-undo (current-buffer))
+      (buffer-flush-undo (current-buffer))
       (erase-buffer)
       (insert-buffer-substring artbuf)
       (gnus-convert-article-to-rmail)
@@ -4655,7 +5299,7 @@
 	(tmpbuf (get-buffer-create " *GNUS-output*")))
     (save-excursion
       (set-buffer tmpbuf)
-      (buffer-disable-undo (current-buffer))
+      (buffer-flush-undo (current-buffer))
       (erase-buffer)
       (insert-buffer-substring artbuf)
       ;; Append newline at end of the buffer as separator, and then
@@ -4705,7 +5349,7 @@
   "Open network stream to remote NNTP server.
 If optional argument CONFIRM is non-nil, ask you host that NNTP server
 is running even if it is defined.
-Run gnus-Open-server-hook just before opening news server."
+Run gnus-open-server-hook just before opening news server."
   (if (gnus-server-opened)
       ;; Stream is already opened.
       nil
@@ -4722,9 +5366,14 @@
 	  (setq gnus-nntp-server
 		(read-string "NNTP server: " gnus-nntp-server))))
     ;; If no server name is given, local host is assumed.
-    (if (string-equal gnus-nntp-server "")
+    (if (or (string-equal gnus-nntp-server "")
+	    (string-equal gnus-nntp-server "::")) ;RMS preference.
 	(setq gnus-nntp-server (system-name)))
-    (cond ((string= gnus-nntp-server "::")
+    ;; gnus-nntp-server must be either (system-name), ':DIRECTORY', or
+    ;; nntp server name.  I mean '::' cannot be a value of
+    ;; gnus-nntp-server.
+    (cond ((and (null gnus-nntp-service)
+		(string-equal gnus-nntp-server (system-name)))
 	   (require 'nnspool)
 	   (gnus-define-access-method 'nnspool)
 	   (message "Looking up local news spool..."))
@@ -4736,19 +5385,30 @@
 	  (t
 	   (gnus-define-access-method 'nntp)
 	   (message "Connecting to NNTP server on %s..." gnus-nntp-server)))
-    (run-hooks 'gnus-Open-server-hook)
-    (cond ((gnus-open-server gnus-nntp-server gnus-nntp-service))
-	  ((and (stringp (gnus-status-message))
-		(> (length (gnus-status-message)) 0))
-	   ;; Show valuable message if available.
-	   (error (gnus-status-message)))
-	  (t (error "Cannot open NNTP server on %s" gnus-nntp-server)))
+    (run-hooks 'gnus-open-server-hook)
+    (cond ((gnus-server-opened)		;Maybe opened in gnus-open-server-hook.
+	   (message ""))
+	  ((gnus-open-server gnus-nntp-server gnus-nntp-service)
+	   (message ""))
+	  (t
+	   (error
+	    (gnus-nntp-message
+	     (format "Cannot open NNTP server on %s" gnus-nntp-server)))))
     ))
 
 ;; Dummy functions used only once. Should return nil.
 (defun gnus-server-opened () nil)
 (defun gnus-close-server () nil)
 
+(defun gnus-nntp-message (&optional message)
+  "Return a message returned from NNTP server.
+If no message is available and optional MESSAGE is given, return it."
+  (let ((status (gnus-status-message))
+	(message (or message "")))
+    (if (and (stringp status)
+	     (> (length status) 0))
+	status message)))
+
 (defun gnus-define-access-method (method &optional access-methods)
   "Define access functions for the access METHOD.
 Methods defintion is taken from optional argument ACCESS-METHODS or
@@ -4759,7 +5419,8 @@
 	(error "Unknown access method: %s" method)
       ;; Should not use symbol-function here since overload does not work.
       (while bindings
-	(fset (car (car bindings)) (cdr (car bindings)))
+	;; Alist syntax is different from that of 3.14.3.
+	(fset (car (car bindings)) (car (cdr (car bindings))))
 	(setq bindings (cdr bindings)))
       )))
 
@@ -4767,6 +5428,8 @@
   "Select newsgroup GROUP.
 If optional argument SHOW-ALL is non-nil, all of articles in the group
 are selected."
+  ;; Make sure a connection to NNTP server is alive.
+  (gnus-start-news-server)
   (if (gnus-request-group group)
       (let ((articles nil))
 	(setq gnus-newsgroup-name group)
@@ -4834,7 +5497,8 @@
 	(setq gnus-newsgroup-marked
 	      (gnus-intersection (append gnus-newsgroup-unselected
 					 gnus-newsgroup-unreads)
-				 (cdr (assoc group gnus-marked-assoc))))
+				 (cdr
+				  (gnus-gethash group gnus-marked-hashtb))))
 	;; First and last article in this newsgroup.
 	(setq gnus-newsgroup-begin
 	      (if gnus-newsgroup-headers
@@ -4858,11 +5522,66 @@
 	(setq gnus-current-history nil)
 	(setq gnus-have-all-headers nil)
 	(setq gnus-last-article nil)
+	;; Clear old hash tables for the variable gnus-newsgroup-headers.
+	(gnus-clear-hashtables-for-newsgroup-headers)
 	;; GROUP is successfully selected.
 	t
 	)
     ))
 
+;; Hacking for making header search much faster.
+
+(defun gnus-get-header-by-number (number)
+  "Return a header specified by a NUMBER.
+If the variable gnus-newsgroup-headers is updated, the hashed table
+gnus-newsgroup-headers-hashtb-by-number must be set to nil to indicate
+rehash is necessary."
+  (or gnus-newsgroup-headers-hashtb-by-number
+      (gnus-make-headers-hashtable-by-number))
+  (gnus-gethash (int-to-string number)
+		gnus-newsgroup-headers-hashtb-by-number))
+
+(defun gnus-get-header-by-id (id)
+  "Return a header specified by an ID.
+If the variable gnus-newsgroup-headers is updated, the hashed table
+gnus-newsgroup-headers-hashtb-by-id must be set to nil to indicate
+rehash is necessary."
+  (or gnus-newsgroup-headers-hashtb-by-id
+      (gnus-make-headers-hashtable-by-id))
+  (and (stringp id)
+       (gnus-gethash id gnus-newsgroup-headers-hashtb-by-id)))
+
+(defun gnus-make-headers-hashtable-by-number ()
+  "Make hashtable for the variable gnus-newsgroup-headers by number."
+  (let ((header nil)
+	(headers gnus-newsgroup-headers))
+    (setq gnus-newsgroup-headers-hashtb-by-number
+	  (gnus-make-hashtable (length headers)))
+    (while headers
+      (setq header (car headers))
+      (gnus-sethash (int-to-string (nntp-header-number header))
+		    header gnus-newsgroup-headers-hashtb-by-number)
+      (setq headers (cdr headers))
+      )))
+
+(defun gnus-make-headers-hashtable-by-id ()
+  "Make hashtable for the variable gnus-newsgroup-headers by id."
+  (let ((header nil)
+	(headers gnus-newsgroup-headers))
+    (setq gnus-newsgroup-headers-hashtb-by-id
+	  (gnus-make-hashtable (length headers)))
+    (while headers
+      (setq header (car headers))
+      (gnus-sethash (nntp-header-id header)
+		    header gnus-newsgroup-headers-hashtb-by-id)
+      (setq headers (cdr headers))
+      )))
+
+(defun gnus-clear-hashtables-for-newsgroup-headers ()
+  "Clear hash tables created for the variable gnus-newsgroup-headers."
+  (setq gnus-newsgroup-headers-hashtb-by-id nil)
+  (setq gnus-newsgroup-headers-hashtb-by-number nil))
+
 (defun gnus-more-header-backward ()
   "Find new header backward."
   (let ((first
@@ -4898,6 +5617,8 @@
 	      (if backward
 		  (cons header gnus-newsgroup-headers)
 		(append gnus-newsgroup-headers (list header))))
+	;; Clear current hash tables for the variable gnus-newsgroup-headers.
+	(gnus-clear-hashtables-for-newsgroup-headers)
 	;; We have to update unreads and unselected, but don't have to
 	;; care about gnus-newsgroup-marked.
 	(if (memq artnum gnus-newsgroup-unselected)
@@ -4942,8 +5663,15 @@
       (set (car variables) nil)
       (setq variables (cdr variables))))
   ;; Clear other internal variables.
+  (setq gnus-newsrc-hashtb nil)
+  (setq gnus-marked-hashtb nil)
+  (setq gnus-killed-hashtb nil)
   (setq gnus-active-hashtb nil)
+  (setq gnus-octive-hashtb nil)
   (setq gnus-unread-hashtb nil)
+  (setq gnus-newsgroup-headers nil)
+  (setq gnus-newsgroup-headers-hashtb-by-id nil)
+  (setq gnus-newsgroup-headers-hashtb-by-number nil)
   ;; Kill the startup file.
   (and gnus-current-startup-file
        (get-file-buffer gnus-current-startup-file)
@@ -4959,15 +5687,15 @@
 
 (defun gnus-configure-windows (action)
   "Configure GNUS windows according to the next ACTION.
-The ACTION is either a symbol, such as `SelectNewsgroup', or a
+The ACTION is either a symbol, such as `summary', or a
 configuration list such as `(1 1 2)'.  If ACTION is not a list,
-configuration list is got from the variable `gnus-window-configuration'."
+configuration list is got from the variable gnus-window-configuration."
   (let* ((windows
 	  (if (listp action)
 	      action (car (cdr (assq action gnus-window-configuration)))))
-	 (grpwin (get-buffer-window gnus-Group-buffer))
-	 (subwin (get-buffer-window gnus-Subject-buffer))
-	 (artwin (get-buffer-window gnus-Article-buffer))
+	 (grpwin (get-buffer-window gnus-group-buffer))
+	 (subwin (get-buffer-window gnus-summary-buffer))
+	 (artwin (get-buffer-window gnus-article-buffer))
 	 (winsum nil)
 	 (height nil)
 	 (grpheight 0)
@@ -4994,11 +5722,11 @@
 			     (if artwin (window-height artwin) 0)))))
       ;; The Newsgroup buffer exits always. So, use it to extend the
       ;; Group window so as to get enough window space.
-      (switch-to-buffer gnus-Group-buffer 'norecord)
-      (and (get-buffer gnus-Subject-buffer)
-	   (delete-windows-on gnus-Subject-buffer))
-      (and (get-buffer gnus-Article-buffer)
-	   (delete-windows-on gnus-Article-buffer))
+      (switch-to-buffer gnus-group-buffer 'norecord)
+      (and (get-buffer gnus-summary-buffer)
+	   (delete-windows-on gnus-summary-buffer))
+      (and (get-buffer gnus-article-buffer)
+	   (delete-windows-on gnus-article-buffer))
       ;; Compute expected window height.
       (setq winsum (apply (function +) windows))
       (if (not (zerop (nth 0 windows)))
@@ -5023,18 +5751,18 @@
       ;; Then select buffers in each window.
       (and (not (zerop grpheight))
 	   (progn
-	     (switch-to-buffer gnus-Group-buffer 'norecord)
+	     (switch-to-buffer gnus-group-buffer 'norecord)
 	     (other-window 1)))
       (and (not (zerop subheight))
 	   (progn
-	     (switch-to-buffer gnus-Subject-buffer 'norecord)
+	     (switch-to-buffer gnus-summary-buffer 'norecord)
 	     (other-window 1)))
       (and (not (zerop artheight))
 	   (progn
 	     ;; If Article buffer does not exist, it will be created
 	     ;; and initialized.
-	     (gnus-Article-setup-buffer)
-	     (switch-to-buffer gnus-Article-buffer 'norecord)))
+	     (gnus-article-setup-buffer)
+	     (switch-to-buffer gnus-article-buffer 'norecord)))
       )
     ))
 
@@ -5074,18 +5802,19 @@
 	(t
 	 (message "%s; %s" gnus-version nntp-version))))
 
-(defun gnus-Info-find-node ()
+(defun gnus-info-find-node ()
   "Find Info documentation of GNUS."
   (interactive)
   (require 'info)
   ;; Enlarge info window if needed.
-  (cond ((eq major-mode 'gnus-Group-mode)
+  (cond ((eq major-mode 'gnus-group-mode)
 	 (gnus-configure-windows '(1 0 0)) ;Take all windows.
-	 (pop-to-buffer gnus-Group-buffer))
-	((eq major-mode 'gnus-Subject-mode)
+	 (pop-to-buffer gnus-group-buffer))
+	((eq major-mode 'gnus-summary-mode)
 	 (gnus-configure-windows '(0 1 0)) ;Take all windows.
-	 (pop-to-buffer gnus-Subject-buffer)))
-  (Info-goto-node (cdr (assq major-mode gnus-Info-nodes))))
+	 (pop-to-buffer gnus-summary-buffer)))
+  (let ((Info-directory (expand-file-name gnus-info-directory nil)))
+    (Info-goto-node (car (cdr (assq major-mode gnus-info-nodes))))))
 
 (defun gnus-overload-functions (&optional overloads)
   "Overload functions specified by optional argument OVERLOADS.
@@ -5106,6 +5835,7 @@
 (defun gnus-make-threads (newsgroup-headers)
   "Make conversation threads tree from NEWSGROUP-HEADERS."
   (let ((headers newsgroup-headers)
+	(refer nil)
 	(h nil)
 	(d nil)
 	(roots nil)
@@ -5118,13 +5848,19 @@
       (if (vectorp h)			;Depends on nntp.el.
 	  (progn
 	    ;; Ignore broken references, e.g "<123@a.b.c".
-	    (setq d (and (nntp-header-references h)
-			 (string-match "\\(<[^<>]+>\\)[^>]*$"
-				       (nntp-header-references h))
-			 (gnus-find-header-by-id
-			  newsgroup-headers
-			  (substring (nntp-header-references h)
-				     (match-beginning 1) (match-end 1)))))
+	    (setq refer (nntp-header-references h))
+	    (setq d (and refer
+			 (string-match "\\(<[^<>]+>\\)[^>]*$" refer)
+;;			 (gnus-find-header-by-id
+;;			  newsgroup-headers
+;;			  (substring refer (match-beginning 1) (match-end 1)))
+			 ;; In fact if the variable newsgroup-headers
+			 ;; is not 'equal' to the variable
+			 ;; gnus-newsgroup-headers, the following
+			 ;; function call may return bogus value.
+			 (gnus-get-header-by-id
+			  (substring refer (match-beginning 1) (match-end 1)))
+			 ))
 	    ;; Check subject equality.
 	    (or gnus-thread-ignore-subject
 		(null d)
@@ -5206,6 +5942,22 @@
 			(point)))
     ))
 
+;; Create hash table for alist, such as gnus-newsrc-assoc,
+;; gnus-killed-assoc, and gnus-marked-assoc.
+
+(defun gnus-make-hashtable-from-alist (alist &optional hashsize)
+  "Return hash table for ALIST.
+Optional argument HASHSIZE specifies the hashtable size.
+Hash key is a car of alist element, which must be a string."
+  (let ((hashtb (gnus-make-hashtable (or hashsize (length alist)))))
+    (while alist
+      (gnus-sethash (car (car alist))	;Newsgroup name
+		    (car alist)		;Alist element
+		    hashtb)
+      (setq alist (cdr alist)))
+    hashtb
+    ))
+
 (defun gnus-last-element (list)
   "Return last element of LIST."
   (let ((last nil))
@@ -5257,7 +6009,7 @@
 ;;  ("misc"   14 (1 . 10) (12 . 15))
 ;;  ("test"   99 (1 . 99)) ...)
 
-(defun gnus-setup-news-info (&optional rawfile)
+(defun gnus-setup-news (&optional rawfile)
   "Setup news information.
 If optional argument RAWFILE is non-nil, force to read raw startup file."
   (let ((init (not (and gnus-newsrc-assoc
@@ -5270,9 +6022,16 @@
 	(setq gnus-newsrc-assoc nil
 	      gnus-active-hashtb nil
 	      gnus-unread-hashtb nil))
+    (gnus-read-active-file)
+    ;; Initialize only once.
     (if init
-	(gnus-read-newsrc-file rawfile))
-    (gnus-read-active-file)
+	(progn
+	  ;; Get distributions only once.
+	  (gnus-read-distributions-file)
+	  ;; newsrc file must be read after reading active file since
+	  ;; its size is used to guess the size of gnus-newsrc-hashtb.
+	  (gnus-read-newsrc-file rawfile)
+	  ))
     (gnus-expire-marked-articles)
     (gnus-get-unread-articles)
     ;; Check new newsgroups and subscribe them.
@@ -5284,17 +6043,11 @@
 	    )))
     ))
 
-(defun gnus-subscribe-newsgroup (newsgroup &optional next)
-  "Subscribe new NEWSGROUP.
-If optional argument NEXT is non-nil, it is inserted before NEXT."
-  (gnus-insert-newsgroup (list newsgroup t) next)
-  (message "Newsgroup %s is subscribed" newsgroup))
-
 (defun gnus-add-newsgroup (newsgroup)
   "Subscribe new NEWSGROUP safely and put it at top."
-  (and (null (assoc newsgroup gnus-newsrc-assoc)) ;Really new?
+  (and (null (gnus-gethash newsgroup gnus-newsrc-hashtb)) ;Really new?
        (gnus-gethash newsgroup gnus-active-hashtb) ;Really exist?
-       (gnus-insert-newsgroup (or (assoc newsgroup gnus-killed-assoc)
+       (gnus-insert-newsgroup (or (gnus-gethash newsgroup gnus-killed-hashtb)
 				  (list newsgroup t))
 			      (car (car gnus-newsrc-assoc)))))
 
@@ -5312,8 +6065,8 @@
 		 (not (string-match gnus-newsrc-options-n-no group))
 		 (and gnus-newsrc-options-n-yes
 		      (string-match gnus-newsrc-options-n-yes group)))
-	     (null (assoc group gnus-killed-assoc)) ;Ignore killed.
-	     (null (assoc group gnus-newsrc-assoc)) ;Really new.
+	     (null (gnus-gethash group gnus-killed-hashtb)) ;Ignore killed.
+	     (null (gnus-gethash group gnus-newsrc-hashtb)) ;Really new.
 	     ;; Find new newsgroup.
 	     (setq new-newsgroups
 		   (cons group new-newsgroups)))
@@ -5325,15 +6078,18 @@
 
 (defun gnus-kill-newsgroup (group)
   "Kill GROUP from gnus-newsrc-assoc, .newsrc and gnus-unread-hashtb."
-  (let ((info (assoc group gnus-newsrc-assoc)))
+  (let ((info (gnus-gethash group gnus-newsrc-hashtb)))
     (if (null info)
 	nil
-      ;; Delete from gnus-newsrc-assoc
+      ;; Delete from gnus-newsrc-assoc and gnus-newsrc-hashtb.
       (setq gnus-newsrc-assoc (delq info gnus-newsrc-assoc))
-      ;; Add to gnus-killed-assoc.
+      (gnus-sethash group nil gnus-newsrc-hashtb)
+      ;; Add to gnus-killed-assoc and gnus-killed-hashtb.
       (setq gnus-killed-assoc
 	    (cons info
-		  (delq (assoc group gnus-killed-assoc) gnus-killed-assoc)))
+		  (delq (gnus-gethash group gnus-killed-hashtb)
+			gnus-killed-assoc)))
+      (gnus-sethash group info gnus-killed-hashtb)
       ;; Clear unread hashtable.
       ;; Thanks cwitty@csli.Stanford.EDU (Carl Witty).
       (gnus-sethash group nil gnus-unread-hashtb)
@@ -5353,15 +6109,15 @@
 	  (gnus-difference-of-range
 	   (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info))))
     ;; Check duplication.
-    (if (assoc group gnus-newsrc-assoc)
+    (if (gnus-gethash group gnus-newsrc-hashtb)
 	(error "Duplicated: %s" group))
-    ;; Insert to gnus-newsrc-assoc.
+    ;; Insert to gnus-newsrc-assoc and gnus-newsrc-hashtb.
     (if (string-equal next (car (car gnus-newsrc-assoc)))
 	(setq gnus-newsrc-assoc
 	      (cons info gnus-newsrc-assoc))
       (let ((found nil)
-	    (rest gnus-newsrc-assoc)
-	    (tail (cons nil gnus-newsrc-assoc)))
+	    (rest (cdr gnus-newsrc-assoc))
+	    (tail gnus-newsrc-assoc))
 	;; Seach insertion point.
 	(while (and (not found) rest)
 	  (if (string-equal next (car (car rest)))
@@ -5370,13 +6126,17 @@
 	    (setq tail (cdr tail))
 	    ))
 	;; Find it.
-	(setcdr tail nil)
-	(setq gnus-newsrc-assoc
-	      (append gnus-newsrc-assoc (cons info rest)))
+	(if (consp tail)
+	    (setcdr tail (cons info rest))
+	  ;; gnus-newsrc-assoc must be nil.
+	  (setq gnus-newsrc-assoc
+		(append gnus-newsrc-assoc (cons info rest))))
 	))
-    ;; Delete from gnus-killed-assoc.
+    (gnus-sethash group info gnus-newsrc-hashtb)
+    ;; Delete from gnus-killed-assoc and gnus-killed-hashtb.
     (setq gnus-killed-assoc
-	  (delq (assoc group gnus-killed-assoc) gnus-killed-assoc))
+	  (delq (gnus-gethash group gnus-killed-hashtb) gnus-killed-assoc))
+    (gnus-sethash group nil gnus-killed-hashtb)
     ;; Then insert to .newsrc.
     (gnus-update-newsrc-buffer group nil next)
     ;; Add to gnus-unread-hashtb.
@@ -5387,7 +6147,8 @@
     ))
 
 (defun gnus-check-killed-newsgroups ()
-  "Check consistency between gnus-newsrc-assoc and gnus-killed-assoc."
+  "Check consistency between gnus-newsrc-assoc and gnus-killed-assoc.
+gnus-killed-hashtb is also updated."
   (let ((group nil)
 	(new-killed nil)
 	(old-killed gnus-killed-assoc))
@@ -5397,13 +6158,15 @@
 	       (not (string-match gnus-newsrc-options-n-no group))
 	       (and gnus-newsrc-options-n-yes
 		    (string-match gnus-newsrc-options-n-yes group)))
-	   (null (assoc group gnus-newsrc-assoc)) ;No duplication.
+	   (null (gnus-gethash group gnus-newsrc-hashtb)) ;No duplication.
 	   ;; Subscribed in options line and not in gnus-newsrc-assoc.
 	   (setq new-killed
 		 (cons (car old-killed) new-killed)))
       (setq old-killed (cdr old-killed))
       )
     (setq gnus-killed-assoc (nreverse new-killed))
+    (setq gnus-killed-hashtb
+	  (gnus-make-hashtable-from-alist gnus-killed-assoc))
     ))
 
 (defun gnus-check-bogus-newsgroups (&optional confirm)
@@ -5418,7 +6181,7 @@
 	(old-marked gnus-marked-assoc)
 	(new-marked nil))
     (message "Checking bogus newsgroups...")
-    ;; Update gnus-newsrc-assoc.
+    ;; Update gnus-newsrc-assoc and gnus-newsrc-hashtb.
     (while old-newsrc
       (setq group (car (car old-newsrc)))
       (if (or (gnus-gethash group gnus-active-hashtb)
@@ -5432,29 +6195,35 @@
       (setq old-newsrc (cdr old-newsrc))
       )
     (setq gnus-newsrc-assoc (nreverse new-newsrc))
-    ;; Update gnus-killed-assoc.
+    (setq gnus-newsrc-hashtb
+	  (gnus-make-hashtable-from-alist gnus-newsrc-assoc))
+    ;; Update gnus-killed-assoc and gnus-killed-hashtb.
     ;; The killed newsgroups are deleted without any confirmations.
     (while old-killed
       (setq group (car (car old-killed)))
       (and (gnus-gethash group gnus-active-hashtb)
-	   (null (assoc group gnus-newsrc-assoc))
+	   (null (gnus-gethash group gnus-newsrc-hashtb))
 	   ;; Active and really killed newsgroup.
 	   (setq new-killed (cons (car old-killed) new-killed)))
       (setq old-killed (cdr old-killed))
       )
     (setq gnus-killed-assoc (nreverse new-killed))
+    (setq gnus-killed-hashtb
+	  (gnus-make-hashtable-from-alist gnus-killed-assoc))
     ;; Remove BOGUS from .newsrc file.
     (while bogus
       (gnus-update-newsrc-buffer (car bogus) 'delete)
       (setq bogus (cdr bogus)))
-    ;; Update gnus-marked-assoc.
+    ;; Update gnus-marked-assoc and gnus-marked-hashtb.
     (while old-marked
       (setq group (car (car old-marked)))
       (if (and (cdr (car old-marked))	;Non-empty?
-	       (assoc group gnus-newsrc-assoc))	;Not bogus?
+	       (gnus-gethash group gnus-newsrc-hashtb))	;Not bogus?
 	  (setq new-marked (cons (car old-marked) new-marked)))
       (setq old-marked (cdr old-marked)))
     (setq gnus-marked-assoc new-marked)
+    (setq gnus-marked-hashtb
+	  (gnus-make-hashtable-from-alist gnus-marked-assoc))
     (message "Checking bogus newsgroups... done")
     ))
 
@@ -5467,7 +6236,8 @@
 	(range nil))
     (message "Checking new news...")
     (or gnus-unread-hashtb
-	(setq gnus-unread-hashtb (gnus-make-hashtable)))
+	(setq gnus-unread-hashtb
+	      (gnus-make-hashtable (length gnus-active-hashtb))))
     (while read
       (setq group-info (car read))	;About one newsgroup
       (setq group-name (car group-info))
@@ -5516,6 +6286,8 @@
 		(cons (cons (car marked) updated) updated-assoc)))
       (setq marked-assoc (cdr marked-assoc)))
     (setq gnus-marked-assoc updated-assoc)
+    (setq gnus-marked-hashtb
+	  (gnus-make-hashtable-from-alist gnus-marked-assoc))
     ))
 
 (defun gnus-mark-as-read-by-xref
@@ -5542,9 +6314,9 @@
 	  (or (string-equal group gname) ;Ignore current newsgroup.
 	      ;; Ignore unsubscribed newsgroup if requested.
 	      (and subscribed-only
-		   (not (nth 1 (assoc gname gnus-newsrc-assoc))))
+		   (not (nth 1 (gnus-gethash gname gnus-newsrc-hashtb))))
 	      ;; Ignore article marked as unread.
-	      (memq article (cdr (assoc gname gnus-marked-assoc)))
+	      (memq article (cdr (gnus-gethash gname gnus-marked-hashtb)))
 	      (let ((group-xref (assoc gname xref-list)))
 		(if group-xref
 		    (if (memq article (cdr group-xref))
@@ -5628,40 +6400,49 @@
       (if (> (car active) 0)
 	  ;; Articles from 1 to N are not active.
 	  (setq active (cons 1 (cdr active))))
-      (setcdr (cdr (assoc group gnus-newsrc-assoc))
+      (setcdr (cdr (gnus-gethash group gnus-newsrc-hashtb))
 	      (gnus-difference-of-range active (nthcdr 2 unread)))
       ;; Update .newsrc buffer.
       (gnus-update-newsrc-buffer group)
       ;; Update gnus-marked-assoc.
       (if (listp marked-list)		;Includes NIL.
-	  (let ((marked (assoc group gnus-marked-assoc)))
-	    (cond (marked
+	  (let ((marked (gnus-gethash group gnus-marked-hashtb)))
+	    (cond (marked		;There is an entry.
 		   (setcdr marked marked-list))
 		  (marked-list		;Non-NIL.
-		   (setq gnus-marked-assoc
-			 (cons (cons group marked-list)
-			       gnus-marked-assoc)))
+		   (let ((info (cons group marked-list)))
+		     ;; hashtb must share the same cons cell.
+		     (setq gnus-marked-assoc
+			   (cons info gnus-marked-assoc))
+		     (gnus-sethash group info gnus-marked-hashtb)
+		     ))
 		  )))
       )))
 
 (defun gnus-read-active-file ()
   "Get active file from NNTP server."
+  ;; Make sure a connection to NNTP server is alive.
+  (gnus-start-news-server)
   (message "Reading active file...")
   (if (gnus-request-list)		;Get active file from server
       (save-excursion
 	(set-buffer nntp-server-buffer)
-	;; Save OLD active info.
-	(setq gnus-octive-hashtb gnus-active-hashtb)
-	(setq gnus-active-hashtb (gnus-make-hashtable))
 	(gnus-active-to-gnus-format)
 	(message "Reading active file... done"))
     (error "Cannot read active file from NNTP server.")))
 
 (defun gnus-active-to-gnus-format ()
-  "Convert active file format to internal format."
+  "Convert active file format to internal format.
+Lines matching gnus-ignored-newsgroups are ignored."
   ;; Delete unnecessary lines.
   (goto-char (point-min))
-  (delete-matching-lines "^to\\..*$")
+  ;;(delete-matching-lines "^to\\..*$")
+  (delete-matching-lines gnus-ignored-newsgroups)
+  ;; Save OLD active info.
+  (setq gnus-octive-hashtb gnus-active-hashtb)
+  ;; Make large enough hash table.
+  (setq gnus-active-hashtb
+	(gnus-make-hashtable (count-lines (point-min) (point-max))))
   ;; Store active file in hashtable.
   (goto-char (point-min))
   (while
@@ -5677,16 +6458,13 @@
 		  (buffer-substring (match-beginning 3) (match-end 3)))
 		 (string-to-int
 		  (buffer-substring (match-beginning 2) (match-end 2)))))
-     gnus-active-hashtb)))
+     gnus-active-hashtb)
+    ))
 
 (defun gnus-read-newsrc-file (&optional rawfile)
   "Read startup FILE.
 If optional argument RAWFILE is non-nil, the raw startup file is read."
-  (setq gnus-current-startup-file
-	(let* ((file (expand-file-name gnus-startup-file nil))
-	       (real-file (concat file "-" gnus-nntp-server)))
-	  (if (file-exists-p real-file)
-	      real-file file)))
+  (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file))
   ;; Reset variables which may be included in the quick startup file.
   (let ((variables gnus-variable-list))
     (while variables
@@ -5694,35 +6472,35 @@
       (setq variables (cdr variables))))
   (let* ((newsrc-file gnus-current-startup-file)
 	 (quick-file (concat newsrc-file ".el"))
-	 (quick-loaded nil)
-	 (newsrc-mod (nth 5 (file-attributes newsrc-file)))
-	 (quick-mod (nth 5 (file-attributes quick-file))))
+	 (quick-loaded nil))
     (save-excursion
       ;; Prepare .newsrc buffer.
       (set-buffer (find-file-noselect newsrc-file))
       ;; It is not so good idea turning off undo.
-      ;;(buffer-disable-undo (current-buffer))
+      ;;(buffer-flush-undo (current-buffer))
       ;; Load quick .newsrc to restore gnus-marked-assoc and
       ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date.
       (condition-case nil
-	  (setq quick-loaded (load quick-file t t t))
+	  (progn
+	    (setq quick-loaded (load quick-file t t t))
+	    ;; Recreate hashtables.
+	    (setq gnus-killed-hashtb
+		  (gnus-make-hashtable-from-alist gnus-killed-assoc))
+	    (setq gnus-marked-hashtb
+		  (gnus-make-hashtable-from-alist gnus-marked-assoc))
+	    )
 	(error nil))
       (cond ((and (not rawfile)		;Not forced to read the raw file.
-		  (or (and (fboundp 'file-newer-than-file-p)
-			   (file-newer-than-file-p quick-file newsrc-file))
-		      (and newsrc-mod quick-mod
-			   ;; .newsrc.el is newer than .newsrc.
-			   ;; Some older version does not support function
-			   ;; `file-newer-than-file-p'.
-			   (or (< (car newsrc-mod) (car quick-mod))
-			       (and (= (car newsrc-mod) (car quick-mod))
-				    (<= (nth 1 newsrc-mod) (nth 1 quick-mod))))
-			   ))
+		  ;; .newsrc.el is newer than .newsrc.
+		  (file-newer-than-file-p quick-file newsrc-file)
 		  quick-loaded
 		  gnus-newsrc-assoc	;Really loaded?
 		  )
 	     ;; We don't have to read the raw startup file.
-	     )
+	     ;; gnus-newsrc-assoc may be defined in the quick startup file.
+	     ;; So, we have to define the hashtable here.
+	     (setq gnus-newsrc-hashtb
+		   (gnus-make-hashtable-from-alist gnus-newsrc-assoc)))
 	    (t
 	     ;; Since .newsrc file is newer than quick file, read it.
 	     (message "Reading %s..." newsrc-file)
@@ -5753,6 +6531,11 @@
     (setq gnus-newsrc-options-n-yes nil)
     (setq gnus-newsrc-options-n-no nil)
     (setq gnus-newsrc-assoc nil)
+    ;; Make large enough hash table.
+    (setq gnus-newsrc-hashtb
+	  (gnus-make-hashtable
+	   (max (length gnus-active-hashtb)
+		(count-lines (point-min) (point-max)))))
     ;; Save options line to variable.
     ;; Lines beginning with white spaces are treated as continuation
     ;; line.  Refer man page of newsrc(5).
@@ -5785,7 +6568,7 @@
       (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1)))
       ;; Check duplications of newsgroups.
       ;; Note: Checking the duplications takes very long time.
-      (if (assoc newsgroup gnus-newsrc-assoc)
+      (if (gnus-gethash newsgroup gnus-newsrc-hashtb)
 	  (message "Ignore duplicated newsgroup: %s" newsgroup)
 	(setq subscribe
 	      (string-equal
@@ -5817,9 +6600,10 @@
 	(setq gnus-newsrc-assoc
 	      (cons (cons newsgroup (cons subscribe (nreverse read-list)))
 		    gnus-newsrc-assoc))
+	;; Update gnus-newsrc-hashtb one by one.
+	(gnus-sethash newsgroup (car gnus-newsrc-assoc) gnus-newsrc-hashtb)
 	))
-    (setq gnus-newsrc-assoc
-	  (nreverse gnus-newsrc-assoc))
+    (setq gnus-newsrc-assoc (nreverse gnus-newsrc-assoc))
     ))
 
 (defun gnus-parse-n-options (options)
@@ -5846,13 +6630,18 @@
 	      (concat (substring newsgroup 0 (match-end 1))
 		      ".+"
 		      (substring newsgroup (match-beginning 2)))))
+      ;; It is yes or no.
       (cond ((string-equal yes-or-no "!")
 	     (setq no (cons newsgroup no)))
 	    ((string-equal newsgroup ".+")) ;Ignore `all'.
 	    (t
-	     (setq yes (cons newsgroup yes)))
-	    ))
+	     (setq yes (cons newsgroup yes))))
+      )
     ;; Make a cons of regexps from parsing result.
+    ;; We have to append \(\.\|$\) to prevent matching substring of
+    ;; newsgroup.  For example, "jp.net" should not match with
+    ;; "jp.network".
+    ;; Fixes for large regexp problems are from yonezu@nak.math.keio.ac.jp.
     (cons (if yes
 	      (concat "^\\("
 		      (apply (function concat)
@@ -5861,7 +6650,7 @@
 			       (lambda (newsgroup)
 				 (concat newsgroup "\\|")))
 			      (cdr yes)))
-		      (car yes) "\\)"))
+		      (car yes) "\\)\\(\\.\\|$\\)"))
 	  (if no
 	      (concat "^\\("
 		      (apply (function concat)
@@ -5870,7 +6659,7 @@
 			       (lambda (newsgroup)
 				 (concat newsgroup "\\|")))
 			      (cdr no)))
-		      (car no) "\\)")))
+		      (car no) "\\)\\(\\.\\|$\\)")))
     ))
 
 (defun gnus-save-newsrc-file ()
@@ -5891,11 +6680,11 @@
 	     ;; Make backup file of master newsrc.
 	     ;; You can stop or change version control of backup file.
 	     ;; Suggested by jason@violet.berkeley.edu.
-	     (run-hooks 'gnus-Save-newsrc-hook)
+	     (run-hooks 'gnus-save-newsrc-hook)
 	     (save-buffer))
 	   ;; Quickly loadable .newsrc.
 	   (set-buffer (get-buffer-create " *GNUS-newsrc*"))
-	   (buffer-disable-undo (current-buffer))
+	   (buffer-flush-undo (current-buffer))
 	   (erase-buffer)
 	   (gnus-gnus-to-quick-newsrc-format)
 	   (let ((make-backup-files nil)
@@ -5909,8 +6698,8 @@
 
 (defun gnus-update-newsrc-buffer (group &optional delete next)
   "Incrementally update .newsrc buffer about GROUP.
-If optional second argument DELETE is non-nil, delete the group.
-If optional third argument NEXT is non-nil, inserted before it."
+If optional 1st argument DELETE is non-nil, delete the group.
+If optional 2nd argument NEXT is non-nil, inserted before it."
   (save-excursion
     ;; Taking account of the killed startup file.
     ;; Suggested by tale@pawl.rpi.edu.
@@ -5920,6 +6709,7 @@
     ;; Before supporting continuation lines, " newsgroup ! 1-5" was
     ;; okay, but now it is invalid.  It should be "newsgroup! 1-5".
     (let ((deleted nil)
+	  (case-fold-search nil)	;Should NOT ignore case.
 	  (buffer-read-only nil))	;May be not modifiable.
       ;; Delete ALL entries which match for GROUP.
       (goto-char (point-min))
@@ -5932,7 +6722,7 @@
       (if delete
 	  nil
 	;; Insert group entry.
-	(let ((newsrc (assoc group gnus-newsrc-assoc)))
+	(let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
 	  (if (null newsrc)
 	      nil
 	    ;; Find insertion point.
@@ -5963,14 +6753,17 @@
       )))
 
 (defun gnus-gnus-to-quick-newsrc-format ()
-  "Insert GNUS variables such as `gnus-newsrc-assoc' in Lisp format."
+  "Insert GNUS variables such as gnus-newsrc-assoc in lisp format."
   (insert ";; GNUS internal format of .newsrc.\n")
   (insert ";; Touch .newsrc instead if you think to remove this file.\n")
   (let ((variable nil)
 	(variables gnus-variable-list)
-	;; Temporary rebind to make changes invisible.
-	(gnus-killed-assoc gnus-killed-assoc))
-    ;; Remove duplicated or unsubscribed newsgroups in gnus-killed-assoc.
+	;; Temporary rebind to make changes
+	;; gnus-check-killed-newsgroups in invisible.
+	(gnus-killed-assoc gnus-killed-assoc)
+	(gnus-killed-hashtb gnus-killed-hashtb))
+    ;; Remove duplicated or unsubscribed newsgroups in
+    ;; gnus-killed-assoc (and gnus-killed-hashtb).
     (gnus-check-killed-newsgroups)
     ;; Then, insert lisp expressions.
     (while variables
@@ -6083,11 +6876,63 @@
       (list (cons 0 0)))
     ))
 
+(defun gnus-read-distributions-file ()
+  "Get distributions file from NNTP server (NNTP2 functionality)."
+  ;; Make sure a connection to NNTP server is alive.
+  (gnus-start-news-server)
+  (message "Reading distributions file...")
+  (setq gnus-distribution-list nil)
+  (if (gnus-request-list-distributions)
+      (save-excursion
+	(set-buffer nntp-server-buffer)
+	(gnus-distributions-to-gnus-format)
+	(message "Reading distributions file... done"))
+    ;; It's not a fatal error.
+    ;;(error "Cannot read distributions file from NNTP server.")
+    )
+  ;; Merge with user supplied default distributions.
+  (let ((defaults (reverse gnus-local-distributions))
+	(dist nil))
+    (while defaults
+      (setq dist (assoc (car defaults) gnus-distribution-list))
+      (if dist
+	  (setq gnus-distribution-list
+		(delq dist gnus-distribution-list)))
+      (setq gnus-distribution-list
+	    (cons (list (car defaults)) gnus-distribution-list))
+      (setq defaults (cdr defaults))
+      )))
+
+(defun gnus-distributions-to-gnus-format ()
+  "Convert distributions file format to internal format."
+  (setq gnus-distribution-list nil)
+  (goto-char (point-min))
+  (while (re-search-forward "^\\([^ \t\n]+\\).*$" nil t)
+    (setq gnus-distribution-list
+	  (cons (list (buffer-substring (match-beginning 1) (match-end 1)))
+		gnus-distribution-list)))
+  (setq gnus-distribution-list
+	(nreverse gnus-distribution-list)))
+
+;; Some older version of GNU Emacs does not support function
+;; `file-newer-than-file-p'.
+
+(or (fboundp 'file-newer-than-file-p)
+    (defun file-newer-than-file-p (file1 file2)
+      "Return t if file FILE1 is newer than file FILE2.
+If FILE1 does not exist, the answer is nil;
+otherwise, if FILE2 does not exist, the answer is t."
+      (let ((mod1 (nth 5 (file-attributes file1)))
+	    (mod2 (nth 5 (file-attributes file2))))
+	(cond ((not (file-exists-p file1)) nil)
+	      ((not (file-exists-p file2)) t)
+	      ((and mod2 mod1)
+	       (or (< (car mod2) (car mod1))
+		   (and (= (car mod2) (car mod1))
+			(<= (nth 1 mod2) (nth 1 mod1)))))
+	      ))))
+
 
 ;;Local variables:
-;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
+;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
 ;;end:
-
-(provide 'gnus)
-
-;;; gnus.el ends here
--- a/lisp/=gnusmail.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=gnusmail.el	Sun May 16 22:58:52 1993 +0000
@@ -1,6 +1,6 @@
 ;;; gnusmail.el --- mail reply commands for GNUS newsreader
 
-;; Copyright (C) 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1993 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news
@@ -46,34 +46,48 @@
 (autoload 'mh-find-path "mh-e")
 (autoload 'mh-yank-cur-msg "mh-e")
 
-;;; Mail reply commands of GNUS Subject Mode
+;;; Mail reply commands of GNUS Summary Mode
 
-(defun gnus-Subject-mail-reply (yank)
+(defun gnus-summary-reply (yank)
   "Reply mail to news author.
-If prefix arg YANK is non-nil, original article is yanked automatically.
-Customize the variable `gnus-mail-reply-method' to use another mailer."
+If prefix argument YANK is non-nil, original article is yanked automatically.
+Customize the variable gnus-mail-reply-method to use another mailer."
   (interactive "P")
-  (gnus-Subject-select-article)
-  (switch-to-buffer gnus-Article-buffer)
+  ;; Bug fix by jbw@bigbird.bu.edu (Joe Wells)
+  ;; Stripping headers should be specified with mail-yank-ignored-headers.
+  (gnus-summary-select-article t t)
+  (switch-to-buffer gnus-article-buffer)
   (widen)
   (delete-other-windows)
-  (bury-buffer gnus-Article-buffer)
+  (bury-buffer gnus-article-buffer)
   (funcall gnus-mail-reply-method yank))
 
-(defun gnus-Subject-mail-reply-with-original ()
-  "Reply mail to news author with original article."
+(defun gnus-summary-reply-with-original ()
+  "Reply mail to news author with original article.
+Customize the variable gnus-mail-reply-method to use another mailer."
   (interactive)
-  (gnus-Subject-mail-reply t))
+  (gnus-summary-reply t))
 
-(defun gnus-Subject-mail-other-window ()
-  "Compose mail in other window.
-Customize the variable `gnus-mail-other-window-method' to use another mailer."
+(defun gnus-summary-mail-forward ()
+  "Forward the current message to another user.
+Customize the variable gnus-mail-forward-method to use another mailer."
   (interactive)
-  (gnus-Subject-select-article)
-  (switch-to-buffer gnus-Article-buffer)
+  (gnus-summary-select-article)
+  (switch-to-buffer gnus-article-buffer)
   (widen)
   (delete-other-windows)
-  (bury-buffer gnus-Article-buffer)
+  (bury-buffer gnus-article-buffer)
+  (funcall gnus-mail-forward-method))
+
+(defun gnus-summary-mail-other-window ()
+  "Compose mail in other window.
+Customize the variable gnus-mail-other-window-method to use another mailer."
+  (interactive)
+  (gnus-summary-select-article)
+  (switch-to-buffer gnus-article-buffer)
+  (widen)
+  (delete-other-windows)
+  (bury-buffer gnus-article-buffer)
   (funcall gnus-mail-other-window-method))
 
 
@@ -91,6 +105,31 @@
 	(goto-char last)
 	)))
 
+(defun gnus-mail-forward-using-mail ()
+  "Forward the current message to another user using mail."
+  ;; This is almost a carbon copy of rmail-forward in rmail.el.
+  (let ((forward-buffer (current-buffer))
+	(subject
+	 (concat "[" gnus-newsgroup-name "] "
+		 ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
+		 (or (gnus-fetch-field "Subject") ""))))
+    ;; If only one window, use it for the mail buffer.
+    ;; Otherwise, use another window for the mail buffer
+    ;; so that the Rmail buffer remains visible
+    ;; and sending the mail will get back to it.
+    (if (if (one-window-p t)
+	    (mail nil nil subject)
+	  (mail-other-window nil nil subject))
+	(save-excursion
+	  (goto-char (point-max))
+	  (insert "------- Start of forwarded message -------\n")
+	  (insert-buffer forward-buffer)
+	  (goto-char (point-max))
+	  (insert "------- End of forwarded message -------\n")
+	  ;; You have a chance to arrange the message.
+	  (run-hooks 'gnus-mail-forward-hook)
+	  ))))
+
 (defun gnus-mail-other-window-using-mail ()
   "Compose mail other window using mail."
   (news-mail-other-window)
@@ -107,11 +146,11 @@
 (defun gnus-mail-reply-using-mhe (&optional yank)
   "Compose reply mail using mh-e.
 Optional argument YANK means yank original article.
-The command \\[mh-yank-cur-msg] yanks the original message into current buffer."
+The command \\[mh-yank-cur-msg] yank the original message into current buffer."
   ;; First of all, prepare mhe mail buffer.
   (let (from cc subject date to reply-to (buffer (current-buffer)))
     (save-restriction
-      (gnus-Article-show-all-headers)	;I don't think this is really needed.
+      (gnus-article-show-all-headers)	;I don't think this is really needed.
       (setq from (gnus-fetch-field "from")
 	    subject (let ((subject (gnus-fetch-field "subject")))
 		      (if (and subject
@@ -140,12 +179,39 @@
 	(goto-char last)
 	)))
 
+;; gnus-mail-forward-using-mhe is contributed by Jun-ichiro Itoh
+;; <itojun@ingram.mt.cs.keio.ac.jp>
+
+(defun gnus-mail-forward-using-mhe ()
+  "Forward the current message to another user using mh-e."
+  ;; First of all, prepare mhe mail buffer.
+  (let ((to (read-string "To: "))
+ 	(cc (read-string "Cc: "))
+ 	(buffer (current-buffer))
+ 	subject)
+    ;;(gnus-article-show-all-headers)
+    (setq subject
+	  (concat "[" gnus-newsgroup-name "] "
+		  ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
+		  (or (gnus-fetch-field "subject") "")))
+    (setq mh-show-buffer buffer)
+    (mh-find-path)
+    (mh-send to (or cc "") subject)
+    (save-excursion
+      (goto-char (point-max))
+      (insert "\n------- Forwarded Message\n\n")
+      (insert-buffer buffer)
+      (goto-char (point-max))
+      (insert "\n------- End of Forwarded Message\n")
+      (setq mh-sent-from-folder buffer)
+      (setq mh-sent-from-msg 1))))
+
 (defun gnus-mail-other-window-using-mhe ()
-  "Compose mail other window using MH-E Mail."
+  "Compose mail other window using mh-e."
   (let ((to (read-string "To: "))
 	(cc (read-string "Cc: "))
 	(subject (read-string "Subject: " (gnus-fetch-field "subject"))))
-    (gnus-Article-show-all-headers)	;I don't think this is really needed.
+    (gnus-article-show-all-headers)	;I don't think this is really needed.
     (setq mh-show-buffer (current-buffer))
     (mh-find-path)
     (mh-send-other-window to cc subject)
--- a/lisp/=gnusmisc.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=gnusmisc.el	Sun May 16 22:58:52 1993 +0000
@@ -1,6 +1,6 @@
 ;;; gnusmisc.el --- miscellaneous commands for GNUS newsreader
 
-;; Copyright (C) 1989, 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1989, 1990, 1993 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news
@@ -32,48 +32,58 @@
 ;; Some ideas are due to roland@wheaties.ai.mit.edu (Roland McGrath).
 ;; I'd like to thank him very much.
 
-(defvar gnus-Browse-killed-mode-hook nil
+(defvar gnus-browse-killed-mode-hook nil
   "*A hook for GNUS Browse-Killed Mode.")
 
-(defvar gnus-Browse-killed-buffer "*Killed Newsgroup*")
-(defvar gnus-Browse-killed-mode-map nil)
+(defvar gnus-browse-killed-buffer "*Killed Newsgroup*")
+(defvar gnus-browse-killed-mode-map nil)
 (defvar gnus-winconf-browse-killed nil)
 
-(put 'gnus-Browse-killed-mode 'mode-class 'special)
+(autoload 'timezone-make-date-arpa-standard "timezone")
+
+(put 'gnus-browse-killed-mode 'mode-class 'special)
+
+
+;;;
+;;; GNUS Browse-Killed Mode
+;;;
+
+;; Some ideas are due to roland@wheaties.ai.mit.edu (Roland McGrath).
+;; I'd like to thank him very much.
 
 ;; Make the buffer to be managed by GNUS.
 
-(or (memq gnus-Browse-killed-buffer gnus-buffer-list)
+(or (memq gnus-browse-killed-buffer gnus-buffer-list)
     (setq gnus-buffer-list
-	  (cons gnus-Browse-killed-buffer gnus-buffer-list)))
+	  (cons gnus-browse-killed-buffer gnus-buffer-list)))
 
-(if gnus-Browse-killed-mode-map
+(if gnus-browse-killed-mode-map
     nil
-  (setq gnus-Browse-killed-mode-map (make-keymap))
-  (suppress-keymap gnus-Browse-killed-mode-map t)
-  (define-key gnus-Browse-killed-mode-map " " 'gnus-Group-next-group)
-  (define-key gnus-Browse-killed-mode-map "\177" 'gnus-Group-prev-group)
-  (define-key gnus-Browse-killed-mode-map "\C-n" 'gnus-Group-next-group)
-  (define-key gnus-Browse-killed-mode-map "\C-p" 'gnus-Group-prev-group)
-  (define-key gnus-Browse-killed-mode-map "n" 'gnus-Group-next-group)
-  (define-key gnus-Browse-killed-mode-map "p" 'gnus-Group-prev-group)
-  (define-key gnus-Browse-killed-mode-map "y" 'gnus-Browse-killed-yank)
-  (define-key gnus-Browse-killed-mode-map "\C-y" 'gnus-Browse-killed-yank)
-  (define-key gnus-Browse-killed-mode-map "l" 'gnus-Browse-killed-groups)
-  (define-key gnus-Browse-killed-mode-map "q" 'gnus-Browse-killed-exit)
-  (define-key gnus-Browse-killed-mode-map "\C-c\C-c" 'gnus-Browse-killed-exit)
-  (define-key gnus-Browse-killed-mode-map "\C-c\C-i" 'gnus-Info-find-node))
+  (setq gnus-browse-killed-mode-map (make-keymap))
+  (suppress-keymap gnus-browse-killed-mode-map t)
+  (define-key gnus-browse-killed-mode-map " " 'gnus-group-next-group)
+  (define-key gnus-browse-killed-mode-map "\177" 'gnus-group-prev-group)
+  (define-key gnus-browse-killed-mode-map "\C-n" 'gnus-group-next-group)
+  (define-key gnus-browse-killed-mode-map "\C-p" 'gnus-group-prev-group)
+  (define-key gnus-browse-killed-mode-map "n" 'gnus-group-next-group)
+  (define-key gnus-browse-killed-mode-map "p" 'gnus-group-prev-group)
+  (define-key gnus-browse-killed-mode-map "y" 'gnus-browse-killed-yank)
+  (define-key gnus-browse-killed-mode-map "\C-y" 'gnus-browse-killed-yank)
+  (define-key gnus-browse-killed-mode-map "l" 'gnus-list-killed-groups)
+  (define-key gnus-browse-killed-mode-map "q" 'gnus-browse-killed-exit)
+  (define-key gnus-browse-killed-mode-map "\C-c\C-c" 'gnus-browse-killed-exit)
+  (define-key gnus-browse-killed-mode-map "\C-c\C-i" 'gnus-info-find-node))
 
-(defun gnus-Browse-killed-mode ()
+(defun gnus-browse-killed-mode ()
   "Major mode for browsing the killed newsgroups.
 All normal editing commands are turned off.
 Instead, these commands are available:
-\\{gnus-Browse-killed-mode-map}
+\\{gnus-browse-killed-mode-map}
 
-The killed newsgroups are saved in the quick startup file \".newsrc.el\"
-unless disabled inthe options line of the startup file \".newsrc\".
+The killed newsgroups are saved in the quick startup file (.newsrc.el)
+unless it against the options line in the startup file (.newsrc).
 
-Entry to this mode calls `gnus-Browse-killed-mode-hook' with no arguments
+Entry to this mode calls gnus-browse-killed-mode-hook with no arguments,
 if that value is non-nil."
   (interactive)
   (kill-all-local-variables)
@@ -86,65 +96,66 @@
 	(t
 	 (setq mode-line-format
 	       "--- GNUS: Killed Newsgroups  %[(%m)%]----%3p-%-")))
-  (setq major-mode 'gnus-Browse-killed-mode)
+  (setq major-mode 'gnus-browse-killed-mode)
   (setq mode-name "Browse-Killed")
   (setq mode-line-buffer-identification	"GNUS: Killed Newsgroups")
-  (use-local-map gnus-Browse-killed-mode-map)
+  (use-local-map gnus-browse-killed-mode-map)
   (buffer-flush-undo (current-buffer))
   (setq buffer-read-only t)		;Disable modification
-  (run-hooks 'gnus-Browse-killed-mode-hook))
+  (run-hooks 'gnus-browse-killed-mode-hook))
 
-(defun gnus-Browse-killed-groups ()
-  "Browse the killed newsgroups.
-\\<gnus-Browse-killed-mode-map>\\[gnus-Browse-killed-yank] yanks the newsgroup on the current line into the Newsgroups buffer."
+(defun gnus-list-killed-groups ()
+  "List the killed newsgroups.
+The keys y and C-y yank the newsgroup on the current line into the
+Newsgroups buffer."
   (interactive)
   (or gnus-killed-assoc
       (error "No killed newsgroups"))
   ;; Save current window configuration if this is first invocation..
-  (or (get-buffer-window gnus-Browse-killed-buffer)
+  (or (get-buffer-window gnus-browse-killed-buffer)
       (setq gnus-winconf-browse-killed
 	    (current-window-configuration)))
   ;; Prepare browsing buffer.
-  (pop-to-buffer (get-buffer-create gnus-Browse-killed-buffer))
-  (gnus-Browse-killed-mode)
+  (pop-to-buffer (get-buffer-create gnus-browse-killed-buffer))
+  (gnus-browse-killed-mode)
   (let ((buffer-read-only nil)
 	(killed-assoc gnus-killed-assoc))
     (erase-buffer)
     (while killed-assoc
-      (insert (gnus-Group-prepare-line (car killed-assoc)))
+      (insert (gnus-group-prepare-line (car killed-assoc)))
       (setq killed-assoc (cdr killed-assoc)))
     (goto-char (point-min))
     ))
 
-(defun gnus-Browse-killed-yank ()
+(defun gnus-browse-killed-yank ()
   "Yank current newsgroup to Newsgroup buffer."
   (interactive)
-  (let ((group (gnus-Group-group-name)))
+  (let ((group (gnus-group-group-name)))
     (if group
 	(let* ((buffer-read-only nil)
-	       (killed (assoc group gnus-killed-assoc)))
-	  (pop-to-buffer gnus-Group-buffer) ;Needed to adjust point.
+	       (killed (gnus-gethash group gnus-killed-hashtb)))
+	  (pop-to-buffer gnus-group-buffer) ;Needed to adjust point.
 	  (if killed
-	      (gnus-Group-insert-group killed))
-	  (pop-to-buffer gnus-Browse-killed-buffer)
+	      (gnus-group-insert-group killed))
+	  (pop-to-buffer gnus-browse-killed-buffer)
 	  (beginning-of-line)
 	  (delete-region (point)
 			 (progn (forward-line 1) (point)))
 	  )))
-  (gnus-Browse-killed-check-buffer))
+  (gnus-browse-killed-check-buffer))
 
-(defun gnus-Browse-killed-check-buffer ()
+(defun gnus-browse-killed-check-buffer ()
   "Exit if the buffer is empty by deleting the window and killing the buffer."
   (and (null gnus-killed-assoc)
-       (get-buffer gnus-Browse-killed-buffer)
-       (gnus-Browse-killed-exit)))
+       (get-buffer gnus-browse-killed-buffer)
+       (gnus-browse-killed-exit)))
 
-(defun gnus-Browse-killed-exit ()
+(defun gnus-browse-killed-exit ()
   "Exit this mode by deleting the window and killing the buffer."
   (interactive)
-  (and (get-buffer-window gnus-Browse-killed-buffer)
-       (delete-window (get-buffer-window gnus-Browse-killed-buffer)))
-  (kill-buffer gnus-Browse-killed-buffer)
+  (and (get-buffer-window gnus-browse-killed-buffer)
+       (delete-window (get-buffer-window gnus-browse-killed-buffer)))
+  (kill-buffer gnus-browse-killed-buffer)
   ;; Restore previous window configuration if available.
   (and gnus-winconf-browse-killed
        (set-window-configuration gnus-winconf-browse-killed))
@@ -155,14 +166,53 @@
 ;;; kill/yank newsgroup commands of GNUS Group Mode
 ;;;
 
-(defun gnus-Group-kill-group (n)
+(defun gnus-group-transpose-groups (arg)
+  "Exchange current newsgroup and previous newsgroup.
+With argument ARG, takes previous newsgroup and moves it past ARG newsgroup."
+  (interactive "p")
+  ;; BUG: last newsgroup and the last but one cannot be transposed
+  ;; since gnus-group-search-forward does not move forward beyond the
+  ;; last.  If we instead use forward-line, no problem, but I don't
+  ;; want to use it for later extension.
+  (while (> arg 0)
+    (gnus-group-search-forward t t)
+    (gnus-group-kill-group 1)
+    (gnus-group-search-forward nil t)
+    (gnus-group-yank-group)
+    (gnus-group-search-forward nil t)
+    (setq arg (1- arg))
+    ))
+
+(defun gnus-group-kill-region (begin end)
+  "Kill newsgroups in current region (excluding current point).
+The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
+  (interactive "r")
+  (let ((lines
+	 ;; Exclude a line where current point is on.
+	 (1-
+	  ;; Count lines.
+	  (save-excursion
+	    (count-lines
+	     (progn
+	       (goto-char begin)
+	       (beginning-of-line)
+	       (point))
+	     (progn
+	       (goto-char end)
+	       (end-of-line)
+	       (point)))))))
+    (goto-char begin)
+    (beginning-of-line)			;Important when LINES < 1
+    (gnus-group-kill-group lines)))
+
+(defun gnus-group-kill-group (n)
   "Kill newsgroup on current line, repeated prefix argument N times.
-The killed newsgroups can be yanked by using \\[gnus-Group-yank-group]."
+The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
   (interactive "p")
   (let ((buffer-read-only nil)
 	(group nil))
     (while (> n 0)
-      (setq group (gnus-Group-group-name))
+      (setq group (gnus-group-group-name))
       (or group
 	  (signal 'end-of-buffer nil))
       (beginning-of-line)
@@ -171,50 +221,74 @@
       (gnus-kill-newsgroup group)
       (setq n (1- n))
       ;; Add to killed newsgroups in the buffer if exists.
-      (if (get-buffer gnus-Browse-killed-buffer)
+      (if (get-buffer gnus-browse-killed-buffer)
 	  (save-excursion
-	    (set-buffer gnus-Browse-killed-buffer)
+	    (set-buffer gnus-browse-killed-buffer)
 	    (let ((buffer-read-only nil))
 	      (goto-char (point-min))
-	      (insert (gnus-Group-prepare-line (car gnus-killed-assoc)))
+	      (insert (gnus-group-prepare-line (car gnus-killed-assoc)))
 	      )))
       )
     (search-forward ":" nil t)
     ))
 
-(defun gnus-Group-yank-group ()
-  "Yank the last newsgroup killed with \\[gnus-Group-kill-group],
+(defun gnus-group-yank-group ()
+  "Yank the last newsgroup killed with \\[gnus-group-kill-group],
 inserting it before the newsgroup on the line containging point."
   (interactive)
-  (gnus-Group-insert-group (car gnus-killed-assoc))
+  (gnus-group-insert-group (car gnus-killed-assoc))
   ;; Remove killed newsgroups from the buffer if exists.
-  (if (get-buffer gnus-Browse-killed-buffer)
+  (if (get-buffer gnus-browse-killed-buffer)
       (save-excursion
-	(set-buffer gnus-Browse-killed-buffer)
+	(set-buffer gnus-browse-killed-buffer)
 	(let ((buffer-read-only nil))
 	  (goto-char (point-min))
 	  (delete-region (point-min)
 			 (progn (forward-line 1) (point)))
 	  )))
-  (gnus-Browse-killed-check-buffer))
+  (gnus-browse-killed-check-buffer))
 
-(defun gnus-Group-insert-group (info)
-  "Insert newsgroup at current line using `gnus-newsrc-assoc' INFO."
+(defun gnus-group-insert-group (info)
+  "Insert newsgroup at current line using gnus-newsrc-assoc INFO."
   (if (null gnus-killed-assoc)
       (error "No killed newsgroups"))
-  (if (not gnus-have-all-newsgroups)
-      (error
-       (substitute-command-keys
-	"Not all newsgroups are displayed.  Type \\[gnus-Group-list-all-groups] to display all newsgroups.")))
+  ;; Huuum.  It this right?
+  ;;(if (not gnus-have-all-newsgroups)
+  ;;    (error
+  ;;     (substitute-command-keys
+  ;;	"Not all newsgroups are displayed.  Type \\[gnus-group-list-all-groups] to display all newsgroups.")))
   (let ((buffer-read-only nil)
-	(group (gnus-Group-group-name)))
+	(group (gnus-group-group-name)))
     (gnus-insert-newsgroup info group)
     (beginning-of-line)
-    (insert (gnus-Group-prepare-line info))
+    (insert (gnus-group-prepare-line info))
     (forward-line -1)
     (search-forward ":" nil t)
     ))
 
+
+;;; Rewrite Date: field in GMT to local
+
+(defun gnus-gmt-to-local ()
+  "Rewrite Date: field described in GMT to local in current buffer.
+The variable gnus-local-timezone is used for local time zone.
+Intended to be used with gnus-article-prepare-hook."
+  (save-excursion
+    (save-restriction
+      (widen)
+      (goto-char (point-min))
+      (narrow-to-region (point-min)
+			(progn (search-forward "\n\n" nil 'move) (point)))
+      (goto-char (point-min))
+      (if (re-search-forward "^Date:[ \t]\\(.*\\)$" nil t)
+	  (let ((buffer-read-only nil)
+		(date (buffer-substring (match-beginning 1) (match-end 1))))
+	    (delete-region (match-beginning 1) (match-end 1))
+	    (insert
+	     (timezone-make-date-arpa-standard date nil gnus-local-timezone))
+	    ))
+      )))
+
 (provide 'gnusmisc)
 
 ;;; gnusmisc.el ends here
--- a/lisp/=gnuspost.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=gnuspost.el	Sun May 16 22:58:52 1993 +0000
@@ -32,10 +32,11 @@
 (defvar gnus-winconf-post-news nil)
 
 (autoload 'news-reply-mode "rnewspost")
+(autoload 'timezone-make-date-arpa-standard "timezone")
 
-;;; Post news commands of GNUS Group Mode and Subject Mode
+;;; Post news commands of GNUS Group Mode and Summary Mode
 
-(defun gnus-Group-post-news ()
+(defun gnus-group-post-news ()
   "Post an article."
   (interactive)
   ;; Save window configuration.
@@ -46,21 +47,21 @@
 	     (not (zerop (buffer-size))))
 	;; Restore last window configuration.
 	(set-window-configuration gnus-winconf-post-news)))
-  ;; We don't want to return to Subject buffer nor Article buffer later.
-  (if (get-buffer gnus-Subject-buffer)
-      (bury-buffer gnus-Subject-buffer))
-  (if (get-buffer gnus-Article-buffer)
-      (bury-buffer gnus-Article-buffer)))
+  ;; We don't want to return to Summary buffer nor Article buffer later.
+  (if (get-buffer gnus-summary-buffer)
+      (bury-buffer gnus-summary-buffer))
+  (if (get-buffer gnus-article-buffer)
+      (bury-buffer gnus-article-buffer)))
 
-(defun gnus-Subject-post-news ()
+(defun gnus-summary-post-news ()
   "Post an article."
   (interactive)
-  (gnus-Subject-select-article t nil)
+  (gnus-summary-select-article t nil)
   ;; Save window configuration.
   (setq gnus-winconf-post-news (current-window-configuration))
   (unwind-protect
       (progn
-	(switch-to-buffer gnus-Article-buffer)
+	(switch-to-buffer gnus-article-buffer)
 	(widen)
 	(delete-other-windows)
 	(gnus-post-news))
@@ -69,26 +70,26 @@
 	;; Restore last window configuration.
 	(set-window-configuration gnus-winconf-post-news)))
   ;; We don't want to return to Article buffer later.
-  (bury-buffer gnus-Article-buffer))
+  (bury-buffer gnus-article-buffer))
 
-(defun gnus-Subject-post-reply (yank)
+(defun gnus-summary-followup (yank)
   "Post a reply article.
 If prefix argument YANK is non-nil, original article is yanked automatically."
   (interactive "P")
-  (gnus-Subject-select-article t nil)
+  (gnus-summary-select-article t nil)
   ;; Check Followup-To: poster.
-  (set-buffer gnus-Article-buffer)
+  (set-buffer gnus-article-buffer)
   (if (and gnus-use-followup-to
 	   (string-equal "poster" (gnus-fetch-field "followup-to"))
 	   (or (not (eq gnus-use-followup-to t))
 	       (not (y-or-n-p "Do you want to ignore `Followup-To: poster'? "))))
       ;; Mail to the poster.  GNUS is now RFC1036 compliant.
-      (gnus-Subject-mail-reply yank)
+      (gnus-summary-reply yank)
     ;; Save window configuration.
     (setq gnus-winconf-post-news (current-window-configuration))
     (unwind-protect
 	(progn
-	  (switch-to-buffer gnus-Article-buffer)
+	  (switch-to-buffer gnus-article-buffer)
 	  (widen)
 	  (delete-other-windows)
 	  (gnus-news-reply yank))
@@ -97,27 +98,29 @@
 	  ;; Restore last window configuration.
 	  (set-window-configuration gnus-winconf-post-news)))
     ;; We don't want to return to Article buffer later.
-    (bury-buffer gnus-Article-buffer)))
+    (bury-buffer gnus-article-buffer)))
 
-(defun gnus-Subject-post-reply-with-original ()
+(defun gnus-summary-followup-with-original ()
   "Post a reply article with original article."
   (interactive)
-  (gnus-Subject-post-reply t))
+  (gnus-summary-followup t))
 
-(defun gnus-Subject-cancel-article ()
+(defun gnus-summary-cancel-article ()
   "Cancel an article you posted."
   (interactive)
-  (gnus-Subject-select-article t nil)
-  (gnus-eval-in-buffer-window gnus-Article-buffer
+  (gnus-summary-select-article t nil)
+  (gnus-eval-in-buffer-window gnus-article-buffer
     (gnus-cancel-news)))
 
 
 ;;; Post a News using NNTP
 
 ;;;###autoload
-(defalias 'sendnews 'gnus-post-news)
+(fset 'sendnews 'gnus-post-news)
+
 ;;;###autoload
-(defalias 'postnews 'gnus-post-news)
+(fset 'postnews 'gnus-post-news)
+
 ;;;###autoload
 (defun gnus-post-news ()
   "Begin editing a new USENET news article to be posted.
@@ -127,16 +130,24 @@
 	  (y-or-n-p "Are you sure you want to post to all of USENET? "))
       (let ((artbuf (current-buffer))
 	    (newsgroups			;Default newsgroup.
-	     (if (eq major-mode 'gnus-Article-mode) gnus-newsgroup-name))
+	     (if (eq major-mode 'gnus-article-mode) gnus-newsgroup-name))
 	    (subject nil)
-	    (distribution nil))
+	    ;; Get default distribution.
+	    (distribution (car gnus-local-distributions)))
+	;; Connect to NNTP server if not connected yet, and get
+	;; several information.
+	(if (not (gnus-server-opened))
+	    (progn
+	      (gnus-start-news-server t) ;Confirm server.
+	      (gnus-setup-news)))
+	;; Get current article information.
 	(save-restriction
 	  (and (not (zerop (buffer-size)))
 	       ;;(equal major-mode 'news-mode)
-	       (equal major-mode 'gnus-Article-mode)
+	       (equal major-mode 'gnus-article-mode)
 	       (progn
 		 ;;(news-show-all-headers)
-		 (gnus-Article-show-all-headers)
+		 (gnus-article-show-all-headers)
 		 (narrow-to-region (point-min)
 				   (progn (goto-char (point-min))
 					  (search-forward "\n\n")
@@ -165,20 +176,25 @@
 		;; (setq newsgroups (read-string "Newsgroups: " "general"))
 		(or newsgroups		;Use the default newsgroup.
 		    (setq newsgroups
-			  (completing-read "Newsgroup: " gnus-newsrc-assoc
+			  (completing-read "Newsgroup: "
+					   gnus-newsrc-assoc
 					   nil 'require-match
 					   newsgroups ;Default newsgroup.
 					   )))
 		(setq subject (read-string "Subject: "))
+		;; Choose a distribution from gnus-distribution-list.
+		;; completing-read should not be used with
+		;; 'require-match functionality in order to allow use
+		;; of unknow distribution.
 		(setq distribution
-		      (substring newsgroups 0 (string-match "\\." newsgroups)))
-		(if (string-equal distribution newsgroups)
-		    ;; Newsgroup may be general or control. In this
-		    ;; case, use default distribution.
-		    (setq distribution gnus-default-distribution))
-		(setq distribution
-		      (read-string "Distribution: " distribution))
-		;; An empty string is ok to ignore gnus-default-distribution.
+		      (if (consp gnus-distribution-list)
+			  (completing-read "Distribution: "
+					   gnus-distribution-list
+					   nil nil ;Never 'require-match
+					   distribution ;Default distribution.
+					   )
+			(read-string "Distribution: ")))
+		;; Empty string is okay.
 		;;(if (string-equal distribution "")
 		;;    (setq distribution nil))
 		))
@@ -189,7 +205,7 @@
 	  ;; Insert Distribution: field.
 	  ;; Suggested by ichikawa@flab.fujitsu.junet.
 	  (mail-position-on-field "Distribution")
-	  (insert (or distribution gnus-default-distribution ""))
+	  (insert (or distribution ""))
 	  ;; Handle author copy using FCC field.
 	  (if gnus-author-copy
 	      (progn
@@ -217,10 +233,10 @@
 	(save-restriction
 	  (and (not (zerop (buffer-size)))
 	       ;;(equal major-mode 'news-mode)
-	       (equal major-mode 'gnus-Article-mode)
+	       (equal major-mode 'gnus-article-mode)
 	       (progn
 		 ;; (news-show-all-headers)
-		 (gnus-Article-show-all-headers)
+		 (gnus-article-show-all-headers)
 		 (narrow-to-region (point-min)
 				   (progn (goto-char (point-min))
 					  (search-forward "\n\n")
@@ -291,11 +307,18 @@
 	      (progn
 		(mail-position-on-field "FCC")
 		(insert gnus-author-copy)))
+	  ;; Insert To: FROM field, which is expected to mail the
+	  ;; message to the author of the article too.
+	  (if (and gnus-auto-mail-to-author from)
+	      (progn
+		(goto-char (point-min))
+		(insert "To: " from "\n")))
 	  (goto-char (point-max)))
 	;; Yank original article automatically.
 	(if yank
 	    (let ((last (point)))
-	      (goto-char (point-max))
+	      ;;(goto-char (point-max))
+	      ;; Insert at current point.
 	      (news-reply-yank-original nil)
 	      (goto-char last)))
 	)
@@ -307,30 +330,37 @@
   (let* ((case-fold-search nil)
 	 (server-running (gnus-server-opened)))
     (save-excursion
-      ;; It is possible to post a news without reading news using
-      ;; `gnus' before.
+      ;; Connect to default NNTP server if necessary.
       ;; Suggested by yuki@flab.fujitsu.junet.
       (gnus-start-news-server)		;Use default server.
       ;; NNTP server must be opened before current buffer is modified.
       (widen)
       (goto-char (point-min))
       (run-hooks 'news-inews-hook)
-      (goto-char (point-min))
-      (search-forward (concat "\n" mail-header-separator "\n"))
-      (replace-match "\n\n")
-      (goto-char (point-max))
-      ;; require a newline at the end for inews to append .signature to
-      (or (= (preceding-char) ?\n)
-	  (insert ?\n))
+      ;; Mail the message too if To: or Cc: exists.
+      (if (save-restriction
+	    (narrow-to-region
+	     (point-min)
+	     (progn
+	       (goto-char (point-min))
+	       (search-forward (concat "\n" mail-header-separator "\n"))
+	       (point)))
+	    (or (mail-fetch-field "to" nil t)
+		(mail-fetch-field "cc" nil t)))
+	  (if gnus-mail-send-method
+	      (progn
+		(message "Sending via mail...")
+		(funcall gnus-mail-send-method)
+		(message "Sending via mail... done"))
+	    (ding)
+	    (message "No mailer defined.  To: and/or Cc: fields ignored.")
+	    (sit-for 1)))
+      ;; Send to NNTP server. 
       (message "Posting to USENET...")
-      ;; Post to NNTP server. 
       (if (gnus-inews-article)
 	  (message "Posting to USENET... done")
 	;; We cannot signal an error.
 	(ding) (message "Article rejected: %s" (gnus-status-message)))
-      (goto-char (point-min))		;restore internal header separator
-      (search-forward "\n\n")
-      (replace-match (concat "\n" mail-header-separator "\n"))
       (set-buffer-modified-p nil))
     ;; If NNTP server is opened by gnus-inews-news, close it by myself.
     (or server-running
@@ -353,9 +383,9 @@
 	(save-excursion
 	  ;; Get header info. from original article.
 	  (save-restriction
-	    (gnus-Article-show-all-headers)
+	    (gnus-article-show-all-headers)
 	    (goto-char (point-min))
-	    (search-forward "\n\n")
+	    (search-forward "\n\n" nil 'move)
 	    (narrow-to-region (point-min) (point))
 	    (setq from (mail-fetch-field "from"))
 	    (setq newsgroups (mail-fetch-field "newsgroups"))
@@ -368,30 +398,27 @@
 		(downcase (mail-strip-quoted-names from))
 		(downcase (mail-strip-quoted-names (gnus-inews-user-name)))))
 	      (progn
-		(ding) (message "This article is not yours"))
+		(ding) (message "This article is not yours."))
 	    ;; Make control article.
-	    (set-buffer (get-buffer-create " *GNUS-posting*"))
+	    (set-buffer (get-buffer-create " *GNUS-canceling*"))
 	    (buffer-flush-undo (current-buffer))
 	    (erase-buffer)
 	    (insert "Newsgroups: " newsgroups "\n"
 		    "Subject: cancel " message-id "\n"
 		    "Control: cancel " message-id "\n"
-		    ;; We should not use the value of
-		    ;;  `gnus-default-distribution' as default value,
+		    ;; We should not use the first value of
+		    ;;  `gnus-distribution-list' as default value,
 		    ;;  because distribution must be as same as original
 		    ;;  article.
 		    "Distribution: " (or distribution "") "\n"
+		    mail-header-separator "\n"
 		    )
-	    ;; Prepare article headers.
-	    (gnus-inews-insert-headers)
-	    (goto-char (point-max))
-	    ;; Insert empty line.
-	    (insert "\n")
 	    ;; Send the control article to NNTP server.
 	    (message "Canceling your article...")
-	    (if (gnus-request-post)
+	    (if (gnus-inews-article)
 		(message "Canceling your article... done")
 	      (ding) (message "Failed to cancel your article"))
+	    ;; Kill the article buffer.
 	    (kill-buffer (current-buffer))
 	    )))
     ))
@@ -400,55 +427,35 @@
 ;;; Lowlevel inews interface
 
 (defun gnus-inews-article ()
-  "NNTP inews interface."
-  (let ((signature
-	 (if gnus-signature-file
-	     (expand-file-name gnus-signature-file nil)))
-	(distribution nil)
-	(artbuf (current-buffer))
+  "Post an article in current buffer using NNTP protocol."
+  (let ((artbuf (current-buffer))
 	(tmpbuf (get-buffer-create " *GNUS-posting*")))
     (save-excursion
       (set-buffer tmpbuf)
       (buffer-flush-undo (current-buffer))
       (erase-buffer)
       (insert-buffer-substring artbuf)
-      ;; Get distribution.
+      ;; Remove the header separator.
+      (goto-char (point-min))
+      (search-forward (concat "\n" mail-header-separator "\n"))
+      (replace-match "\n\n")
+      (goto-char (point-max))
+      ;; require a newline at the end for inews to append .signature to
+      (or (= (preceding-char) ?\n)
+	  (insert ?\n))
+      ;; This hook may insert a signature.
+      (run-hooks 'gnus-prepare-article-hook)
+      ;; Prepare article headers.  All message body such as signature
+      ;; must be inserted before Lines: field is prepared.
       (save-restriction
 	(goto-char (point-min))
 	(search-forward "\n\n")
 	(narrow-to-region (point-min) (point))
-	(setq distribution (mail-fetch-field "distribution")))
-      (widen)
-      (if signature
-	  (progn
-	    ;; Change signature file by distribution.
-	    ;; Suggested by hyoko@flab.fujitsu.junet.
-	    (if (file-exists-p (concat signature "-" distribution))
-		(setq signature (concat signature "-" distribution)))
-	    ;; Insert signature.
-	    (if (file-exists-p signature)
-		(progn
-		  (goto-char (point-max))
-		  (insert "--\n")
-		  (insert-file-contents signature)))
-	    ))
-      ;; Prepare article headers.
-      (save-restriction
-	(goto-char (point-min))
-	(search-forward "\n\n")
-	(narrow-to-region (point-min) (point))
-	(gnus-inews-insert-headers)
-	;; Save author copy of posted article. The article must be
-	;;  copied before being posted because `gnus-request-post'
-	;;  modifies the buffer.
-	(let ((case-fold-search t))
-	  ;; Find and handle any FCC fields.
-	  (goto-char (point-min))
-	  (if (re-search-forward "^FCC:" nil t)
-	      (gnus-inews-do-fcc))))
-      (widen)
-      ;; Run final inews hooks.
-      (run-hooks 'gnus-Inews-article-hook)
+	(gnus-inews-insert-headers))
+      ;; Run final inews hooks.  This hook may do FCC.
+      ;; The article must be saved before being posted because
+      ;; `gnus-request-post' modifies the buffer.
+      (run-hooks 'gnus-inews-article-hook)
       ;; Post an article to NNTP server.
       ;; Return NIL if post failed.
       (prog1
@@ -456,21 +463,115 @@
 	(kill-buffer (current-buffer)))
       )))
 
+(defun gnus-inews-insert-headers ()
+  "Prepare article headers.
+Fields already prepared in the buffer are not modified.
+Fields in gnus-required-headers will be generated."
+  (save-excursion
+    (let ((date (gnus-inews-date))
+	  (message-id (gnus-inews-message-id))
+	  (organization (gnus-inews-organization)))
+      (goto-char (point-min))
+      (or (mail-fetch-field "path")
+	  (and (memq 'Path gnus-required-headers)
+	       (insert "Path: " (gnus-inews-path) "\n")))
+      (or (mail-fetch-field "from")
+	  (and (memq 'From gnus-required-headers)
+	       (insert "From: " (gnus-inews-user-name) "\n")))
+      ;; If there is no subject, make Subject: field.
+      (or (mail-fetch-field "subject")
+	  (and (memq 'Subject gnus-required-headers)
+	       (insert "Subject: \n")))
+      ;; If there is no newsgroups, make Newsgroups: field.
+      (or (mail-fetch-field "newsgroups")
+	  (and (memq 'Newsgroups gnus-required-headers)
+	       (insert "Newsgroups: \n")))
+      (or (mail-fetch-field "message-id")
+	  (and message-id
+	       (memq 'Message-ID gnus-required-headers)
+	       (insert "Message-ID: " message-id "\n")))
+      (or (mail-fetch-field "date")
+	  (and date
+	       (memq 'Date gnus-required-headers)
+	       (insert "Date: " date "\n")))
+      ;; Optional fields in RFC977 and RFC1036
+      (or (mail-fetch-field "organization")
+	  (and organization
+	       (memq 'Organization gnus-required-headers)
+	       (let ((begin (point))
+		     (fill-column 79)
+		     (fill-prefix "\t"))
+		 (insert "Organization: " organization "\n")
+		 (fill-region-as-paragraph begin (point)))))
+      (or (mail-fetch-field "distribution")
+	  (and (memq 'Distribution gnus-required-headers)
+	       (insert "Distribution: \n")))
+      (or (mail-fetch-field "lines")
+	  (and (memq 'Lines gnus-required-headers)
+	       (insert "Lines: " (gnus-inews-lines) "\n")))
+      )))
+
+
+;; Utility functions.
+
+(defun gnus-inews-insert-signature ()
+  "Insert signature file in current article buffer.
+If there is a file named .signature-DISTRIBUTION, it is used instead
+of usual .signature when the distribution of the article is
+DISTRIBUTION.  Set the variable to nil to prevent appending the
+signature file automatically.
+Signature file is specified by the variable gnus-signature-file."
+  (save-excursion
+    (save-restriction
+      ;; Change signature file by distribution.
+      ;; Suggested by hyoko@flab.fujitsu.co.jp.
+      (let ((signature
+	     (if gnus-signature-file
+		 (expand-file-name gnus-signature-file nil)))
+	    (distribution nil))
+	(goto-char (point-min))
+	(search-forward "\n\n")
+	(narrow-to-region (point-min) (point))
+	(setq distribution (mail-fetch-field "distribution"))
+	(widen)
+	(if signature
+	    (progn
+	      (if (file-exists-p (concat signature "-" distribution))
+		  (setq signature (concat signature "-" distribution)))
+	      ;; Insert signature.
+	      (if (file-exists-p signature)
+		  (progn
+		    (goto-char (point-max))
+		    (insert "--\n")
+		    (insert-file-contents signature)))
+	      ))))))
+
 (defun gnus-inews-do-fcc ()
-  "Process FCC: fields."
+  "Process FCC: fields in current article buffer.
+Unless the first character of the field is `|', the article is saved
+to the specified file using the function specified by the variable
+gnus-author-copy-saver.  The default function rmail-output saves in
+Unix mailbox format.
+If the first character is `|', the contents of the article is send to
+a program specified by the rest of the value."
   (let ((fcc-list nil)
 	(fcc-file nil)
 	(case-fold-search t))		;Should ignore case.
     (save-excursion
       (save-restriction
 	(goto-char (point-min))
+	(search-forward "\n\n")
+	(narrow-to-region (point-min) (point))
+	(goto-char (point-min))
 	(while (re-search-forward "^FCC:[ \t]*" nil t)
-	  (setq fcc-list (cons (buffer-substring (point)
-						 (progn
-						   (end-of-line)
-						   (skip-chars-backward " \t")
-						   (point)))
-			       fcc-list))
+	  (setq fcc-list
+		(cons (buffer-substring
+		       (point)
+		       (progn
+			 (end-of-line)
+			 (skip-chars-backward " \t")
+			 (point)))
+		      fcc-list))
 	  (delete-region (match-beginning 0)
 			 (progn (forward-line 1) (point))))
 	;; Process FCC operations.
@@ -495,36 +596,6 @@
 	))
     ))
 
-(defun gnus-inews-insert-headers ()
-  "Prepare article headers.
-Path:, From:, Subject: and Distribution: are generated.
-Message-ID:, Date: and Organization: are optional."
-  (save-excursion
-    (let ((date (gnus-inews-date))
-	  (message-id (gnus-inews-message-id))
-	  (organization (gnus-inews-organization)))
-      ;; Insert from the top of headers.
-      (goto-char (point-min))
-      (insert "Path: " (gnus-inews-path) "\n")
-      (insert "From: " (gnus-inews-user-name) "\n")
-      ;; If there is no subject, make Subject: field.
-      (or (mail-fetch-field "subject")
-	  (insert "Subject: \n"))
-      ;; Insert random headers.
-      (if message-id
-	  (insert "Message-ID: " message-id "\n"))
-      (if date
-	  (insert "Date: " date "\n"))
-      (if organization
-	  (let ((begin (point))
-		(fill-column 79)
-		(fill-prefix "\t"))
-	    (insert "Organization: " organization "\n")
-	    (fill-region-as-paragraph begin (point))))
-      (or (mail-fetch-field "distribution")
-	  (insert "Distribution: \n"))
-      )))
-
 (defun gnus-inews-path ()
   "Return uucp path."
   (let ((login-name (gnus-inews-login-name)))
@@ -551,15 +622,15 @@
 
 (defun gnus-inews-login-name ()
   "Return user login name.
-Got from the variable `gnus-user-login-name', the environment variables
-USER and LOGNAME, and the function `user-login-name'."
+Got from the variable gnus-user-login-name, the environment variables
+USER and LOGNAME, and the function user-login-name."
   (or gnus-user-login-name
       (getenv "USER") (getenv "LOGNAME") (user-login-name)))
 
 (defun gnus-inews-full-name ()
   "Return user full name.
-Got from the variable `gnus-user-full-name', the environment variable
-NAME, and the function `user-full-name'."
+Got from the variable gnus-user-full-name, the environment variable
+NAME, and the function user-full-name."
   (or gnus-user-full-name
       (getenv "NAME") (user-full-name)))
 
@@ -569,9 +640,14 @@
 name; if it is non-nil, strip of local host name from the domain name.
 If the function `system-name' returns full internet name and the
 domain is undefined, the domain name is got from it."
+  ;; Note: compatibility hack.  This will be removed in the next version.
+  (and (null gnus-local-domain)
+       (boundp 'gnus-your-domain)
+       (setq gnus-local-domain gnus-your-domain))
+  ;; End of compatibility hack.
   (let ((domain (or (if (stringp genericfrom) genericfrom)
 		    (getenv "DOMAINNAME")
-		    gnus-your-domain
+		    gnus-local-domain
 		    ;; Function `system-name' may return full internet name.
 		    ;; Suggested by Mike DeCorte <mrd@sun.soe.clarkson.edu>.
 		    (if (string-match "\\." (system-name))
@@ -582,8 +658,8 @@
 		  (system-name))))
     (if (string-equal "." (substring domain 0 1))
 	(setq domain (substring domain 1)))
-    (if (null gnus-your-domain)
-	(setq gnus-your-domain domain))
+    (if (null gnus-local-domain)
+	(setq gnus-local-domain domain))
     ;; Support GENERICFROM as same as standard Bnews system.
     ;; Suggested by ohm@kaba.junet and vixie@decwrl.dec.com.
     (cond ((null genericfrom)
@@ -616,7 +692,27 @@
     ))
 
 (defun gnus-inews-date ()
-  "Bnews date format string of today.  Time zone is ignored."
+  "Date string of today.
+If the variable gnus-local-timezone is non-nil, valid date will be
+generated in terms of RFC822.  Otherwise, buggy date in which time
+zone is ignored will be generated.  If you are using with Cnews, you
+must use valid date."
+  (cond (gnus-local-timezone
+	 ;; Gnus can generate valid date.
+	 (gnus-inews-valid-date))
+	(t
+	 ;; No timezone info.
+	 (gnus-inews-buggy-date))
+	))
+
+(defun gnus-inews-valid-date ()
+  "Date string of today represented in GMT.
+Local timezone is specified by the variable gnus-local-timezone."
+  (timezone-make-date-arpa-standard
+   (current-time-string) gnus-local-timezone "GMT"))
+
+(defun gnus-inews-buggy-date ()
+  "Buggy date string of today.  Time zone is ignored, but fast."
   ;; Insert buggy date (time zone is ignored), but I don't worry about
   ;; it since inews will rewrite it.
   (let ((date (current-time-string)))
@@ -635,17 +731,22 @@
 (defun gnus-inews-organization ()
   "Return user's organization.
 The ORGANIZATION environment variable is used if defined.
-If not, the variable `gnus-your-organization' is used instead.
+If not, the variable gnus-local-organization is used instead.
 If the value begins with a slash, it is taken as the name of a file
 containing the organization."
   ;; The organization must be got in this order since the ORGANIZATION
   ;; environment variable is intended for user specific while
-  ;; gnus-your-organization is for machine or organization specific.
-  (let ((organization (or (getenv "ORGANIZATION")
-			  gnus-your-organization
-			  (expand-file-name "~/.organization" nil))))
-    (if (equal organization "")
-	(setq organization nil))
+  ;; gnus-local-organization is for machine or organization specific.
+
+  ;; Note: compatibility hack.  This will be removed in the next version.
+  (and (null gnus-local-organization)
+       (boundp 'gnus-your-organization)
+       (setq gnus-local-organization gnus-your-organization))
+  ;; End of compatibility hack.
+  (let* ((private-file (expand-file-name "~/.organization" nil))
+	 (organization (or (getenv "ORGANIZATION")
+			   gnus-local-organization
+			   private-file)))
     (and (stringp organization)
 	 (string-equal (substring organization 0 1) "/")
 	 ;; Get it from the user and system file.
@@ -672,9 +773,19 @@
 	       (prog1 (buffer-string)
 		 (kill-buffer tmpbuf))
 	       )))
+	  ((string-equal organization private-file) nil) ;No such file
 	  (t organization))
     ))
 
+(defun gnus-inews-lines ()
+  "Count the number of lines and return numeric string."
+  (save-excursion
+    (save-restriction
+      (widen)
+      (goto-char (point-min))
+      (search-forward "\n\n" nil 'move)
+      (int-to-string (count-lines (point) (point-max))))))
+
 (provide 'gnuspost)
 
 ;;; gnuspost.el ends here
--- a/lisp/=mhspool.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=mhspool.el	Sun May 16 22:58:52 1993 +0000
@@ -1,6 +1,6 @@
 ;;; mhspool.el --- MH folder access using NNTP for GNU Emacs
 
-;; Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1989, 1990, 1993 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Maintainer: FSF
@@ -39,13 +39,22 @@
 
 (require 'nntp)
 
+(defvar mhspool-list-folders-method
+  (function mhspool-list-folders-using-sh)
+  "*Function to list files in folders.
+The function should accept a directory as its argument, and fill the
+current buffer with file and directory names.  The output format must
+be the same as that of 'ls -R1'.  Two functions
+mhspool-list-folders-using-ls and mhspool-list-folders-using-sh are
+provided now.  I suppose the later is faster.")
+
 (defvar mhspool-list-directory-switches '("-R")
-  "*Switches for `nntp-request-list' to pass to `ls' for gettting file lists.
+  "*Switches for mhspool-list-folders-using-ls to pass to `ls' for gettting file lists.
 One entry should appear on one line. You may need to add `-1' option.")
 
 
 
-(defconst mhspool-version "MHSPOOL 1.5"
+(defconst mhspool-version "MHSPOOL 1.8"
   "Version numbers of this version of MHSPOOL.")
 
 (defvar mhspool-spool-directory "~/Mail"
@@ -62,9 +71,10 @@
   "Return list of article headers specified by SEQUENCE of article id.
 The format of list is
  `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID REFERENCES] ...)'.
+If there is no References: field, In-Reply-To: field is used instead.
 Reader macros for the vector are defined as `nntp-header-FIELD'.
 Writer macros for the vector are defined as `nntp-set-header-FIELD'.
-News group must be selected before calling me."
+Newsgroup must be selected before calling this."
   (save-excursion
     (set-buffer nntp-server-buffer)
     ;;(erase-buffer)
@@ -136,7 +146,12 @@
 			       (buffer-substring
 				(point)
 				(save-excursion (end-of-line) (point)))))
-		(setq lines 0))
+		;; Count lines since there is no lines field in most cases.
+		(setq lines
+		      (save-restriction
+			(goto-char (point-max))
+			(widen)
+			(count-lines (point) (point-max)))))
 	      ;; Extract Xref:
 	      (goto-char (point-min))
 	      (if (search-forward "\nXref: " nil t)
@@ -154,22 +169,25 @@
 				    (point)
 				    (save-excursion (end-of-line) (point))))
 		(setq references nil))
-	      (setq headers
-		    (cons (vector article subject from
-				  xref lines date
-				  message-id references) headers))
+	      ;; Collect valid article only.
+	      (and article
+		   message-id
+		   (setq headers
+			 (cons (vector article subject from
+				       xref lines date
+				       message-id references) headers)))
 	      ))
 	(setq sequence (cdr sequence))
 	(setq count (1+ count))
 	(and (numberp nntp-large-newsgroup)
 	     (> number nntp-large-newsgroup)
 	     (zerop (% count 20))
-	     (message "MHSPOOL: %d%% of headers received."
+	     (message "MHSPOOL: Receiving headers... %d%%"
 		      (/ (* count 100) number)))
 	)
       (and (numberp nntp-large-newsgroup)
 	   (> number nntp-large-newsgroup)
-	   (message "MHSPOOL: 100%% of headers received."))
+	   (message "MHSPOOL: Receiving headers... done"))
       (nreverse headers)
       )))
 
@@ -194,20 +212,20 @@
 		  (expand-file-name "~/" nil))))
 	  (setq host (system-name)))
       (setq mhspool-spool-directory nil))
-    (setq nntp-status-message-string "")
+    (setq nntp-status-string "")
     (cond ((and (stringp host)
 		(stringp mhspool-spool-directory)
 		(file-directory-p mhspool-spool-directory)
 		(string-equal host (system-name)))
 	   (setq status (mhspool-open-server-internal host service)))
 	  ((string-equal host (system-name))
-	   (setq nntp-status-message-string
+	   (setq nntp-status-string
 		 (format "No such directory: %s.  Goodbye."
 			 mhspool-spool-directory)))
 	  ((null host)
-	   (setq nntp-status-message-string "NNTP server is not specified."))
+	   (setq nntp-status-string "NNTP server is not specified."))
 	  (t
-	   (setq nntp-status-message-string
+	   (setq nntp-status-string
 		 (format "MHSPOOL: cannot talk to %s." host)))
 	  )
     status
@@ -227,7 +245,7 @@
 
 (defun mhspool-status-message ()
   "Return server status response as string."
-  nntp-status-message-string
+  nntp-status-string
   )
 
 (defun mhspool-request-article (id)
@@ -266,7 +284,9 @@
 
 (defun mhspool-request-stat (id)
   "Select article by message ID (or number)."
-  (error "MHSPOOL: STAT is not implemented."))
+  (setq nntp-status-string "MHSPOOL: STAT is not implemented.")
+  nil
+  )
 
 (defun mhspool-request-group (group)
   "Select news GROUP."
@@ -285,21 +305,22 @@
 	))
 
 (defun mhspool-request-list ()
-  "List valid newsgoups."
+  "List active newsgoups."
   (save-excursion
     (let* ((newsgroup nil)
 	   (articles nil)
 	   (directory (file-name-as-directory
 		       (expand-file-name mhspool-spool-directory nil)))
 	   (folder-regexp (concat "^" (regexp-quote directory) "\\(.+\\):$"))
-	   (buffer (get-buffer-create " *GNUS file listing*")))
+	   (buffer (get-buffer-create " *MHSPOOL File List*")))
       (set-buffer nntp-server-buffer)
       (erase-buffer)
       (set-buffer buffer)
       (erase-buffer)
-      (apply 'call-process
-	     "ls" nil t nil
-	     (append mhspool-list-directory-switches (list directory)))
+;;      (apply 'call-process
+;;	     "ls" nil t nil
+;;	     (append mhspool-list-directory-switches (list directory)))
+      (funcall mhspool-list-folders-method directory)
       (goto-char (point-min))
       (while (re-search-forward folder-regexp nil t)
 	(setq newsgroup
@@ -328,17 +349,34 @@
       (buffer-size)
       )))
 
+(defun mhspool-request-list-newsgroups ()
+  "List newsgoups (defined in NNTP2)."
+  (setq nntp-status-string "MHSPOOL: LIST NEWSGROUPS is not implemented.")
+  nil
+  )
+
+(defun mhspool-request-list-distributions ()
+  "List distributions (defined in NNTP2)."
+  (setq nntp-status-string "MHSPOOL: LIST DISTRIBUTIONS is not implemented.")
+  nil
+  )
+
 (defun mhspool-request-last ()
-  "Set current article pointer to the previous article in the current newsgroup."
-  (error "MHSPOOL: LAST is not implemented."))
+  "Set current article pointer to the previous article
+in the current news group."
+  (setq nntp-status-string "MHSPOOL: LAST is not implemented.")
+  nil
+  )
 
 (defun mhspool-request-next ()
   "Advance current article pointer."
-  (error "MHSPOOL: NEXT is not implemented."))
+  (setq nntp-status-string "MHSPOOL: NEXT is not implemented.")
+  nil
+  )
 
 (defun mhspool-request-post ()
   "Post a new news in current buffer."
-  (setq nntp-status-message-string "MHSPOOL: what do you mean post?")
+  (setq nntp-status-string "MHSPOOL: POST: what do you mean?")
   nil
   )
 
@@ -408,6 +446,45 @@
     string
     ))
 
+
+;; Methods for listing files in folders.
+
+(defun mhspool-list-folders-using-ls (directory)
+  "List files in folders under DIRECTORY using 'ls'."
+  (apply 'call-process
+	 "ls" nil t nil
+	 (append mhspool-list-directory-switches (list directory))))
+
+;; Basic ideas by tanaka@flab.fujitsu.co.jp (Hiroshi TANAKA)
+
+(defun mhspool-list-folders-using-sh (directory)
+  "List files in folders under DIRECTORY using '/bin/sh'."
+  (let ((buffer (current-buffer))
+	(script (get-buffer-create " *MHSPOOL Shell Script Buffer*")))
+    (save-excursion
+      (save-restriction
+	(set-buffer script)
+	(erase-buffer)
+	;; /bin/sh script which does 'ls -R'.
+	(insert
+	 "PS2=
+          ffind() {
+		cd $1; echo $1:
+		ls -1
+		echo
+		for j in `echo *[a-zA-Z]*`
+		do
+		  if [ -d $1/$j ]; then
+			ffind $1/$j
+		  fi
+		done
+	  }
+	  cd " directory "; ffind `pwd`; exit 0\n")
+	(call-process-region (point-min) (point-max) "sh" nil buffer nil)
+	))
+    (kill-buffer script)
+    ))
+
 (provide 'mhspool)
 
 ;;; mhspool.el ends here
--- a/lisp/=nnspool.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=nnspool.el	Sun May 16 22:58:52 1993 +0000
@@ -1,6 +1,6 @@
 ;;; nnspool.el --- spool access using NNTP for GNU Emacs
 
-;; Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1989, 1990, 1993 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news
@@ -37,12 +37,18 @@
 (defvar nnspool-active-file "/usr/lib/news/active"
   "*Local news active file.")
 
+(defvar nnspool-newsgroups-file "/usr/lib/news/newsgroups"
+  "*Local news newsgroups file.")
+
+(defvar nnspool-distributions-file "/usr/lib/news/distributions"
+  "*Local news distributions file.")
+
 (defvar nnspool-history-file "/usr/lib/news/history"
   "*Local news history file.")
 
 
 
-(defconst nnspool-version "NNSPOOL 1.10"
+(defconst nnspool-version "NNSPOOL 1.12"
   "Version numbers of this version of NNSPOOL.")
 
 (defvar nnspool-current-directory nil
@@ -56,9 +62,10 @@
   "Return list of article headers specified by SEQUENCE of article id.
 The format of list is
  `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID REFERENCES] ...)'.
+If there is no References: field, In-Reply-To: field is used instead.
 Reader macros for the vector are defined as `nntp-header-FIELD'.
 Writer macros for the vector are defined as `nntp-set-header-FIELD'.
-News group must be selected before calling me."
+Newsgroup must be selected before calling this."
   (save-excursion
     (set-buffer nntp-server-buffer)
     ;;(erase-buffer)
@@ -139,28 +146,33 @@
 			      (save-excursion (end-of-line) (point))))
 		(setq xref nil))
 	      ;; Extract References:
+	      ;; If no References: field, use In-Reply-To: field instead.
 	      (goto-char (point-min))
-	      (if (search-forward "\nReferences: " nil t)
+	      (if (or (search-forward "\nReferences: " nil t)
+		      (search-forward "\nIn-Reply-To: " nil t))
 		  (setq references (buffer-substring
 				    (point)
 				    (save-excursion (end-of-line) (point))))
 		(setq references nil))
-	      (setq headers
-		    (cons (vector article subject from
-				  xref lines date
-				  message-id references) headers))
+	      ;; Collect valid article only.
+	      (and article
+		   message-id
+		   (setq headers
+			 (cons (vector article subject from
+				       xref lines date
+				       message-id references) headers)))
 	      ))
 	(setq sequence (cdr sequence))
 	(setq count (1+ count))
 	(and (numberp nntp-large-newsgroup)
 	     (> number nntp-large-newsgroup)
 	     (zerop (% count 20))
-	     (message "NNSPOOL: %d%% of headers received."
+	     (message "NNSPOOL: Receiving headers... %d%%"
 		      (/ (* count 100) number)))
 	)
       (and (numberp nntp-large-newsgroup)
 	   (> number nntp-large-newsgroup)
-	   (message "NNSPOOL: 100%% of headers received."))
+	   (message "NNSPOOL: Receiving headers... done"))
       (nreverse headers)
       )))
 
@@ -175,18 +187,18 @@
 If optional argument SERVICE is non-nil, open by the service name."
   (let ((host (or host (getenv "NNTPSERVER")))
 	(status nil))
-    (setq nntp-status-message-string "")
+    (setq nntp-status-string "")
     (cond ((and (file-directory-p nnspool-spool-directory)
 		(file-exists-p nnspool-active-file)
 		(string-equal host (system-name)))
 	   (setq status (nnspool-open-server-internal host service)))
 	  ((string-equal host (system-name))
-	   (setq nntp-status-message-string
+	   (setq nntp-status-string
 		 (format "%s has no news spool.  Goodbye." host)))
 	  ((null host)
-	   (setq nntp-status-message-string "NNTP server is not specified."))
+	   (setq nntp-status-string "NNTP server is not specified."))
 	  (t
-	   (setq nntp-status-message-string
+	   (setq nntp-status-string
 		 (format "NNSPOOL: cannot talk to %s." host)))
 	  )
     status
@@ -206,7 +218,7 @@
 
 (defun nnspool-status-message ()
   "Return server status response as string."
-  nntp-status-message-string
+  nntp-status-string
   )
 
 (defun nnspool-request-article (id)
@@ -247,7 +259,9 @@
 
 (defun nnspool-request-stat (id)
   "Select article by message ID (or number)."
-  (error "NNSPOOL: STAT is not implemented."))
+  (setq nntp-status-string "NNSPOOL: STAT is not implemented.")
+  nil
+  )
 
 (defun nnspool-request-group (group)
   "Select news GROUP."
@@ -258,17 +272,32 @@
     ))
 
 (defun nnspool-request-list ()
-  "List valid newsgoups."
+  "List active newsgoups."
   (save-excursion
     (nnspool-find-file nnspool-active-file)))
 
+(defun nnspool-request-list-newsgroups ()
+  "List newsgroups (defined in NNTP2)."
+  (save-excursion
+    (nnspool-find-file nnspool-newsgroups-file)))
+
+(defun nnspool-request-list-distributions ()
+  "List distributions (defined in NNTP2)."
+  (save-excursion
+    (nnspool-find-file nnspool-distributions-file)))
+
 (defun nnspool-request-last ()
-  "Set current article pointer to the previous article in the current news group."
-  (error "NNSPOOL: LAST is not implemented."))
+  "Set current article pointer to the previous article
+in the current news group."
+  (setq nntp-status-string "NNSPOOL: LAST is not implemented.")
+  nil
+  )
 
 (defun nnspool-request-next ()
   "Advance current article pointer."
-  (error "NNSPOOL: NEXT is not implemented."))
+  (setq nntp-status-string "NNSPOOL: NEXT is not implemented.")
+  nil
+  )
 
 (defun nnspool-request-post ()
   "Post a new news in current buffer."
@@ -276,7 +305,7 @@
     ;; We have to work in the server buffer because of NEmacs hack.
     (copy-to-buffer nntp-server-buffer (point-min) (point-max))
     (set-buffer nntp-server-buffer)
-    (apply 'call-process-region
+    (apply (function call-process-region)
 	   (point-min) (point-max)
 	   nnspool-inews-program 'delete t nil nnspool-inews-switches)
     (prog1
@@ -289,7 +318,7 @@
 	    (string-match "spooled" (buffer-string)))
       ;; Make status message by unfolding lines.
       (subst-char-in-region (point-min) (point-max) ?\n ?\\ 'noundo)
-      (setq nntp-status-message-string (buffer-string))
+      (setq nntp-status-string (buffer-string))
       (erase-buffer))
     ))
 
@@ -327,7 +356,7 @@
   (setq nntp-server-process nil))
 
 (defun nnspool-find-article-by-message-id (id)
-  "Return full pathname of an article identified by message-ID."
+  "Return full pathname of an artilce identified by message-ID."
   (save-excursion
     (let ((buffer (get-file-buffer nnspool-history-file)))
       (if buffer
--- a/lisp/=nntp.el	Sun May 16 22:35:23 1993 +0000
+++ b/lisp/=nntp.el	Sun May 16 22:58:52 1993 +0000
@@ -1,6 +1,6 @@
 ;;; nntp.el --- NNTP (RFC977) Interface for GNU Emacs
 
-;; Copyright (C) 1987, 1988, 1989, 1990, 1992 Free Software Foundation, Inc.
+;; Copyright (C) 1987, 1988, 1989, 1990, 1992, 1993 Free Software Foundation, Inc.
 
 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
 ;; Keywords: news
@@ -55,14 +55,20 @@
 server must be specified as follows:
 
 (setq nntp-server-hook
-      '(lambda ()
+      (function
+       (lambda ()
 	 ;; Server's Kanji code is EUC (NEmacs hack).
 	 (make-local-variable 'kanji-fileio-code)
-	 (setq kanji-fileio-code 0)))
+	 (setq kanji-fileio-code 0))))
 
 If you'd like to change something depending on the server in this
 hook, use the variable `nntp-server-name'.")
 
+(defvar nntp-large-newsgroup 50
+  "*The number of the articles which indicates a large newsgroup.
+If the number of the articles is greater than the value, verbose
+messages will be shown to indicate the current status.")
+
 (defvar nntp-buggy-select (memq system-type '(usg-unix-v fujitsu-uts))
   "*T if your select routine is buggy.
 If the select routine signals error or fall into infinite loop while
@@ -75,13 +81,12 @@
 If Emacs hangs up while retrieving headers, set the variable to a
 lower value.")
 
-(defvar nntp-large-newsgroup 50
-  "*The number of the articles which indicates a large newsgroup.
-If the number of the articles is greater than the value, verbose
-messages will be shown to indicate the current status.")
+(defvar nntp-debug-read 10000
+  "*Display '...' every 10Kbytes of a message being received if it is non-nil.
+If it is a number, dots are displayed per the number.")
 
 
-(defconst nntp-version "NNTP 3.10"
+(defconst nntp-version "NNTP 3.12"
   "Version numbers of this version of NNTP.")
 
 (defvar nntp-server-name nil
@@ -95,7 +100,7 @@
 You'd better not use this variable in NNTP front-end program but
 instead use `nntp-server-buffer'.")
 
-(defvar nntp-status-message-string nil
+(defvar nntp-status-string nil
   "Save the server response message.
 You'd better not use this variable in NNTP front-end program but
 instead call function `nntp-status-message' to get status message.")
@@ -163,7 +168,7 @@
   (` (aset (, header) 6 (, id))))
 
 (defmacro nntp-header-references (header)
-  "Return references in HEADER."
+  "Return references (or in-reply-to) in HEADER."
   (` (aref (, header) 7)))
 
 (defmacro nntp-set-header-references (header ref)
@@ -174,9 +179,10 @@
   "Return list of article headers specified by SEQUENCE of article id.
 The format of list is
  `([NUMBER SUBJECT FROM XREF LINES DATE MESSAGE-ID REFERENCES] ...)'.
+If there is no References: field, In-Reply-To: field is used instead.
 Reader macros for the vector are defined as `nntp-header-FIELD'.
 Writer macros for the vector are defined as `nntp-set-header-FIELD'.
-News group must be selected before calling me."
+Newsgroup must be selected before calling this."
   (save-excursion
     (set-buffer nntp-server-buffer)
     (erase-buffer)
@@ -216,7 +222,7 @@
 		(and (numberp nntp-large-newsgroup)
 		     (> number nntp-large-newsgroup)
 		     (zerop (% received 20))
-		     (message "NNTP: %d%% of headers received."
+		     (message "NNTP: Receiving headers... %d%%"
 			      (/ (* received 100) number)))
 		(nntp-accept-response))
 	      ))
@@ -231,7 +237,7 @@
 	    (nntp-accept-response)))
       (and (numberp nntp-large-newsgroup)
 	   (> number nntp-large-newsgroup)
-	   (message "NNTP: 100%% of headers received."))
+	   (message "NNTP: Receiving headers... done"))
       ;; Now all of replies are received.
       (setq received number)
       ;; First, fold continuation lines.
@@ -263,7 +269,7 @@
 	       ;; Thanks go to mly@AI.MIT.EDU (Richard Mlynarik)
 	       (while (and (not (eobp))
 			   (not (memq (following-char) '(?2 ?3))))
-		 (if (looking-at "\\(From\\|Subject\\|Date\\|Lines\\|Xref\\|References\\):[ \t]+\\([^ \t\n]+.*\\)\r$")
+		 (if (looking-at "\\(From\\|Subject\\|Date\\|Lines\\|Xref\\|References\\|In-Reply-To\\):[ \t]+\\([^ \t\n]+.*\\)\r$")
 		     (let ((s (buffer-substring
 			       (match-beginning 2) (match-end 2)))
 			   (c (char-after (match-beginning 0))))
@@ -280,6 +286,11 @@
 			      (setq xref s))
 			     ((char-equal c ?R)	;References:
 			      (setq references s))
+			     ;; In-Reply-To: should be used only when
+			     ;; there is no References: field.
+			     ((and (char-equal c ?I) ;In-Reply-To:
+				   (null references))
+			      (setq references s))
 			     )))
 		 (forward-line 1))
 	       ;; Finished to parse one header.
@@ -287,10 +298,13 @@
 		   (setq subject "(None)"))
 	       (if (null from)
 		   (setq from "(Unknown User)"))
-	       (setq headers
-		     (cons (vector article subject from
-				   xref lines date
-				   message-id references) headers))
+	       ;; Collect valid article only.
+	       (and article
+		    message-id
+		    (setq headers
+			  (cons (vector article subject from
+					xref lines date
+					message-id references) headers)))
 	       )
 	      (t (forward-line 1))
 	      )
@@ -318,7 +332,7 @@
 If optional argument SERVICE is non-nil, open by the service name."
   (let ((host (or host (getenv "NNTPSERVER")))
 	(status nil))
-    (setq nntp-status-message-string "")
+    (setq nntp-status-string "")
     (cond ((and host (nntp-open-server-internal host service))
 	   (setq status (nntp-wait-for-response "^[23].*\r$"))
 	   ;; Do check unexpected close of connection.
@@ -331,7 +345,7 @@
 	     (nntp-close-server-internal)
 	     ))
 	  ((null host)
-	   (setq nntp-status-message-string "NNTP server is not specified."))
+	   (setq nntp-status-string "NNTP server is not specified."))
 	  )
     status
     ))
@@ -362,11 +376,11 @@
 
 (defun nntp-status-message ()
   "Return server status response as string."
-  (if (and nntp-status-message-string
+  (if (and nntp-status-string
 	   ;; NNN MESSAGE
 	   (string-match "[0-9][0-9][0-9][ \t]+\\([^\r]*\\).*$"
-			 nntp-status-message-string))
-      (substring nntp-status-message-string (match-beginning 1) (match-end 1))
+			 nntp-status-string))
+      (substring nntp-status-string (match-beginning 1) (match-end 1))
     ;; Empty message if nothing.
     ""
     ))
@@ -405,14 +419,29 @@
   (nntp-send-command "^[23].*$" "GROUP" group))
 
 (defun nntp-request-list ()
-  "List valid newsgoups."
+  "List active newsgroups."
   (prog1
       (nntp-send-command "^\\.\r$" "LIST")
     (nntp-decode-text)
     ))
 
+(defun nntp-request-list-newsgroups ()
+  "List newsgroups (defined in NNTP2)."
+  (prog1
+      (nntp-send-command "^\\.\r$" "LIST NEWSGROUPS")
+    (nntp-decode-text)
+    ))
+
+(defun nntp-request-list-distributions ()
+  "List distributions (defined in NNTP2)."
+  (prog1
+      (nntp-send-command "^\\.\r$" "LIST DISTRIBUTIONS")
+    (nntp-decode-text)
+    ))
+
 (defun nntp-request-last ()
-  "Set current article pointer to the previous article in the current news group."
+  "Set current article pointer to the previous article
+in the current news group."
   (nntp-send-command "^[23].*\r$" "LAST"))
 
 (defun nntp-request-next ()
@@ -514,7 +543,10 @@
   "Wait for server response which matches REGEXP."
   (save-excursion
     (let ((status t)
-	  (wait t))
+	  (wait t)
+	  (dotnum 0)			;Number of "." being displayed.
+	  (dotsize			;How often "." displayed.
+	   (if (numberp nntp-debug-read) nntp-debug-read 10000)))
       (set-buffer nntp-server-buffer)
       ;; Wait for status response (RFC977).
       ;; 1xx - Informative message.
@@ -536,7 +568,7 @@
 	      ))
       ;; Save status message.
       (end-of-line)
-      (setq nntp-status-message-string
+      (setq nntp-status-string
 	    (buffer-substring (point-min) (point)))
       (if status
 	  (progn
@@ -549,10 +581,19 @@
 	      ;;	 (save-excursion (end-of-line) (point))))
 	      (if (looking-at regexp)
 		  (setq wait nil)
-		(message "NNTP: Reading...")
+		(if nntp-debug-read
+		    (let ((newnum (/ (buffer-size) dotsize)))
+		      (if (not (= dotnum newnum))
+			  (progn
+			    (setq dotnum newnum)
+			    (message "NNTP: Reading %s"
+				     (make-string dotnum ?.))))))
 		(nntp-accept-response)
-		(message "")
+		;;(if nntp-debug-read (message ""))
 		))
+	    ;; Remove "...".
+	    (if (and nntp-debug-read (> dotnum 0))
+		(message ""))
 	    ;; Successfully received server response.
 	    t
 	    ))
@@ -572,7 +613,7 @@
       (setq cmd (concat cmd " " (car strings)))
       (setq strings (cdr strings)))
     ;; Command line must be terminated by a CR-LF.
-    (process-send-string nntp-server-process (concat cmd "\n"))
+    (process-send-string nntp-server-process (concat cmd "\r\n"))
     ))
 
 (defun nntp-send-region-to-server (begin end)