==============================================================================
==================== GNUS post utility
==================== gnusputi.el version 1.3
==================== $Id: README,v 1.7 1995/03/25 13:42:42 onono Exp $
==============================================================================

                                      ONO Kouichi
                                      <onono@fuka.info.waseda.ac.jp>

1. What is "gnusputi" ?

"Gnusputi" is an utility on posting with GNUS. The name "gnusputi" is
the abbreviation of "GNUS post utility".

When we GNUSers want to add an entry into Newsgroups field (or
Followup-To field, Distribution field, and so on), we usually operate
the following commands/functions (which are defined in rnewspost.el).
	C-c C-f C-n
		news-reply-newsgroup
	C-c C-f C-f
		news-reply-followup-to
	C-c C-f C-d
		news-reply-distribution
	C-c C-f C-s
		mail-subject
That is the default in the standard configuration.

However, those commands/functions do only jump to the specified field,
not add entry the user wants. For example, when the user wants to add a
newsgroup name (e.g. "gnu.emacs.gnus") into Newsgroups field, he has to
type the comma character and the newsgroup name like the following.
	C-c C-f C-n
	","
	"gnu.emacs.gnus"
That is so inconvenient way. Furthermore, the spelling may be missed (he
may type "gnus.emacs.gnus"). If newsgroup name and distribution name can
be input under the name completion, it will be convenient and exact.

The utility "gnusputi" provides such commands/functions that the user
can input entries under the name completion.

"Gnusputi" provides more commands/functions. The major NetNews systems,
which are Bnews, Cnews, INN and so on, support the Supersedes field to
replace the posted article by new article (However, note that RFC 1036
does not regulated the Supersedes field. Therefore, at a minor NetNews
system somewhere, the article with Supersedes field may not cause the
effect the poster wanted). The current version of GNUS has no commands
to insert Supersedes field, so the user has to read the article which he
wants to supersede, copy its Message-ID from *Article* buffer, and
insert it into *post-news* buffer by his own hands.

The utility "gnusputi" provides such commands/functions that
automatically creates Supersedes field like the cancel command
interface.

2. What version of Emacs and GNUS gnusputi works ?

I guess gnusputi can work on most of versions of GNU Emacs and GNUS.
I've tested and confirmed gnusputi has worked on the following
combinations of GNU Emacs and GNUS.

----------------------------------------+--------------------------------------
Emacs version                           | GNUS version
----------------------------------------+--------------------------------------
GNU Emacs 19.22                         | GNUS 4.1 (bundled in GNU Emacs 19.25)
Mule 1.1PL04 (based on GNU Emacs 18.59) | GNUS 3.13
Mule 1.1PL04 (based on GNU Emacs 18.59) | GNUS 4.1 (bundled in GNU Emacs 19.25)
Mule 2.2PL01 (based on GNU Emacs 19.28) | GNUS 4.1 (bundled in Mule2.2PL01)
Nemacs 3.3.2 (based on GNU Emacs 18.55) | GNUS 4.1 (bundled in GNU Emacs 19.25)
----------------------------------------+--------------------------------------

3. Commands

3-1. Commands on *post-news* buffer

C-c C-f ?
(gnusputi-insert-newsgroup)
Imput a newsgroup name under name completion, and insert it at the point
of current buffer.

C-c C-f C-n
(gnusputi-add-newsgroups)
Input newsgroup name(s) under name completion, move to Newsgroups
field, and add the newsgroup name(s) at the tail of the list. When the
input newsgroup name already exists in Newsgroups field, do not add it.

C-c C-f N
(gnusputi-delete-newsgroups)
Input newsgroup name(s) under name completion, move to Newsgroups field,
and delete the newsgroup name(s) from the list. When the input newsgroup
name does not exist in Newsgroups field, do not delete it and warn.

C-c C-f n
(gnusputi-change-newsgroups)
Input newsgroup name(s) under name completion, move to Newsgroups field,
all of the specified newsgroups are deleted, and replace with the input
newsgroup name(s).

C-c C-f C-f
(gnusputi-add-followup-to)
Input newsgroup name(s) under name completion, move to Followup-To
field, and add the newsgroup name(s) at the tail of the list. If the
field does not exist in the header, create it newly. When the input
newsgroup name already exists in Followup-To field, do not add it.

C-c C-f F
(gnusputi-delete-followup-to)
Input newsgroup name(s) under name completion, move to Followup-To
field, and delete the newsgroup name(s) from the list. When the input
newsgroup name does not exist in Followup-To field, do not delete it and
warn.

C-c C-f f
(gnusputi-change-followup-to)
Input newsgroup name(s) under name completion, move to Followup-To
field, all of the specified newsgroups are deleted, and replace with the
input newsgroup name(s). If the field does not exist in the header,
create it newly.

C-c C-f C-d
(gnusputi-add-distribution)
Input distribution(s) under name completion, move to Distribution field,
and add the distribution(s) at the tail of the list. If the field does
not exist in the header, create it newly. When the input distribution
already exists in Distribution field, do not add it.

C-c C-f D
(gnusputi-delete-distribution)
Input distribution(s) under name completion, move to Distribution field,
and delete the distribution(s) from the list. When the input
distribution does not exist in Distribution field, do not delete it and
warn.

C-c C-f d
(gnusputi-change-distribution))
Input distribution(s) under name completion, move to Distribution field,
all of the specified distributions are deleted, and replace with the
input distribution(s). If the field does not exist in the header, create
it newly.

C-c C-f C-r
(gnusputi-add-reply-to)
Input address(es), move to Reply-To field, and add the address(es) at
the tail of the list. If the field does not exist in the header, create
it newly. When the input address already exists in Reply-To field, do
not add it.

C-c C-f R
(gnusputi-delete-reply-to)
Input address(es), move to Reply-To field, and delete the address(es)
from the list. When the input address does not exist in Reply-To field,
do not delete it and warn.

C-c C-f r
(gnusputi-change-reply-to)
Input address(es), move to Reply-To field, all of the specified
addresses are deleted, and replace with the input address(es). If the
field does not exist in the header, create it newly.

C-c C-f C-s/C-c C-f s
(gnusputi-change-subject)
Input subject, move to Subject field, the specified subect string is
deleted, and replace with the input subject. If the field does not exist
in the header, create it newly.

3-2. Commands on *Subject*/*Summary* buffer

S
(gnusputi-summary-supersede-article)

Create *post-news* buffer and insert Supersedes field for the selected
article into the header if the article is the user's. The content of
*post-news* buffer is same as the selected article (to be superseded).
When *post-news* buffer already exists, the user can select to keep the
buffer and insert Supersedes field into it. When the user selects to use
the selected article as the content of *post-news* buffer, he can select
to truncate his signature from  the content (When the Emacs List
variable gnusputi-truncate-signature-at-supersede is t).

3-3. Other commands

M-x gnusputi-version
Display the version in minibuffer like this.
GNUS post utility version 1.3 (1995/03/23 16:26:14)

4. How to use

4-1. Installation

Copy gnusputi.el into Emacs Lisp Library directory, and
byte-compile-file it. Or maybe Makefile can be used.

4-2. Configuration

Add the following expressions into your ~/.emacs.
Same sample is specified in .emacs.sample.

;------------------------------------------------------------------------
;;;;;;;; Sample of .emacs for gnusputi 1.3
;;;;;;
;;;;;; autoload
;;;;;;
(autoload 'gnusputi-initialize-summary-mode "gnusputi")
(autoload 'gnusputi-initialize-news-reply-mode "gnusputi")

;;;;;;
;;;;;; hooks
;;;;;;
;;;;;;
;;;
;;; gnus-Subject-mode-hook (<= GNUS 3.14.4)
;;; or
;;; gnus-summary-mode-hook (>= GNUS 3.15)
;;;
;; >= GNUS 3.15
(setq gnus-summary-mode-hook
      (list
       (function
	(lambda ()
	  (gnusputi-initialize-summary-mode)))))
;; If you use old GNUS (<= 3.14.4) use the following:
;; <= GNUS 3.14.4
;(setq gnus-Subject-mode-hook
;      (list
;       (function
;	(lambda ()
;	  (gnusputi-initialize-summary-mode)))))

;;;
;;; news-reply-mode-hook
;;;
(setq news-reply-mode-hook
      (list
       (function
	(lambda ()
	  (gnusputi-initialize-news-reply-mode)
;;;; If you have already used mime.el, you should set the variable
;;;; carefully. The expression (gnusputi-initialize-news-reply-mode) is
;;;; needed to be evaluated before (mime-mode) like the following:
	  ;; (mime-mode)
	  ))))
;------------------------------------------------------------------------

5. Notice

5-1. Some key bindings are changed from the originals

Some key bindings are changed in *post-news* buffer as the following.
	C-c C-f C-n
	C-c C-f C-f
	C-c C-f C-d
	C-c C-f C-s
Those key sequences are assigned to functions in gnusputi.el, not
rnewspost.el. If you wants to keep the original key bindings, modify
gnusputi-initialize-news-reply-mode in gnusputi.el.

5-2. When "poster" is specified in Followup-To field

When the command C-c C-f C-f(gnusputi-add-followup-to) is executed to
add newsgroup name(s) into Followup-To field, the case "poster" is
specified will be treated specially. RFC 1036 reglates that the followup
to the article specified "poster" in Followup-To field is to be treated
as a reply mail to the originator. Therefore, even if the normal
newsgroups were specified in the Followup-To field with "poster", a
followup to it shall be a reply mail to the originator. For example, a
followup to an article with the field
	Followup-To: poster,gnu.test
must be a reply mail to the originator. However, some newsreaders treat
the field
	Followup-To: poster
correctly, but the field
	Followup-To: poster,gnu.test
incorrectly so that its followup is to be an article with the field
	Newsgroups: poster,gnu.test
In short, when "poster" is specified in the Followup-To field, any
newsgroup name has no effect and is to be eliminated. Therefore,
gnusputi-add-followup-to eliminates the specified newsgroups from
Followup-To field when the user adds "poster" into it. And
gnusputi-add-followup-to rejects the newsgroup name when "poster" is
already specified in Followup-To field. When the Emacs variable
gnusputi-poster-crossable is non-nil that function is available (the
default is nil).

5-3. Supersedes field

The major NetNews systems, which are Bnews, Cnews, INN and so on,
support the Supersedes field to replace the posted article by new
article. However, RFC 1036 does not regulated the Supersedes field. So
then, a NetNews system which treats the Supersedes field invalid can be.
Therefore, the posted article may be left anywhere in the internet
though the article is revised by gnusputi-supersede-summary-news.

6. Customization

6-1. gnusputi-poster-crossable (default: nil)

When the variable is nil, the Followup-To field will be
	Followup-To: poster
if the user wishes to add "poster" by gnusputi-add-followup-to. All of
specified newsgroups in the field will be deleted and replaced by
"poster". When the variable is non-nil, "poster" will be added as it is.
Also, when the variable is nil and the field is
	Followup-To: poster
addition a newsgroup into the field will be rejected with the message:
	Cannot add newsgroup because "poster" is already specified.
When the variable is non-nil, newsgroup can be added even though
"poster" is specified in the field.

6-2. gnusputi-prev-subject-format (default: "(was %s)")

When the subject is changed by the poster, he may want to leave the
previous subject like this:
	Subject: foo
		is changed into
	Subject: bar (was foo)
When the subject is changed by C-c C-f C-s/C-c C-f s
(gnusputi-change-subject), the previous subject is displayed in
minibuffer, and it can be edited as the new subject. The variable
gnusputi-prev-subject-format specifies the format of the previous
subject. The default value is "(was %s)". For example,
	(setq gnusputi-prev-subject-format "(%s)")
specifies that the previous subject will be displayed without "was",
and,
	(setq gnusputi-prev-subject-format "")
specifies that the previous subject will be deleted clearly.

6-3. gnusputi-iterate-{add,delete,change}-newsgroups (default: t)
     gnusputi-iterate-{add,delete,change}-followup-to (default: t)
     gnusputi-iterate-{add,delete,change}-distribution (default: nil)
     gnusputi-iterate-{add,delete,change}-reply-to (default: nil)

When one of those variables is non-nil, the corresponding function
    gnusputi-{add,delete,change}-{newsgroups,followup-to,distribution,reply-to}
iterates to input and add/delete a newsgroup name/distribution/address
until null is input. When it is nil, the function input and add/delete
just once.

6-4. gnusputi-default-distribution (default: nil)

When the variable is nil, the functions gnusputi-add-distribution and
gnusputi-change-distribution don't use the default value of distribution
to input it. When it is set as a string like this:
	(setq gnusputi-default-distribution "waseda")
the functions use the string as the default value. When it is set as
non-nil and non-string like this:
	(setq gnusputi-default-distribution t)
the functions use gnus-default-distribution or gnus-local-distribution
as the default value.

6-5. gnusputi-default-reply-to (default: t)

When it is set as a list of strings like this:
	(setq gnusputi-default-reply-to '("foo@xxx.edu" "bar@xxx.edu"))
the functions gnusputi-add-reply-to and gnusputi-change-reply-to use the
list as the candidate table of the default values to input it.
When it is set as a string like this:
	(setq gnusputi-default-reply-to "foo@xxx.edu")
the functions use the string as the default value.
When it is set as non-nil and non-string like this:
	(setq gnusputi-default-reply-to t)
the functions use the value of (gnus-inews-user-name) as the default
value.
When the variable is nil, the functions don't use the default value of
address.

6-6. gnusputi-truncate-signature-at-supersede (default: nil)

When the variable is non-nil, gnusputi-summary-supersede-article asks to
truncate signature from the selected article like this:
	Do you want to truncate signature ? (y or n) 
If "y" is input, the signature is truncated. When the variable is nil,
gnusputi-summary-supersede-article does not ask to truncate signature
(the signature is left).

6-7. gnusputi-signature-separator (default: "--")

If the user indicates to truncate signature from the selected article by
gnusputi-summary-supersede-article, the region from the end of the
article backward to the line which is equal to the content of the
variable is considered as the signature and is truncated.

7. NO WARRANTY & NO SUPPORT

If any kind of result and/or damage is occurred by using this utility,
the author never warrants the compensation. The report of bugs is
welcome, but the author does not promise to fix and correct the bug. The
request of extension is also welcome, but the author does not promise to
respond it.

8. Condition to distribute it

You can distribute this package freely under the condition of that the
version description, copyright notice and author description are left.
If you makes some extensions/changes, specify clearly where you have
modified, add information of the modifier into the version description,
copyright notice and author description, and distribute it.
