#	$Id: README,v 8.10 1993/08/26 19:05:38 bostic Exp $ (Berkeley) $Date: 1993/08/26 19:05:38 $

This is the README for version 0.6 of nex/nvi, a (soon to be) freely
redistributable replacement for the vi/ex text editors.

This is still ALPHA software, please do not redistribute it without
talking to me first.  A BETA version will be released RSN, and it
will be redistributable as you choose.  It and future versions this
software will be available by anonymous ftp from ftp.cs.berkeley.edu,
in the file ucb/4bsd/nvi.tar.Z, or from ftp.uu.net.

If you have any questions, please send them by email to me at one
of the following email addresses:

	uunet!bostic
	bostic@cs.berkeley.edu

Keith Bostic
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

o Credit where it's due:

	This software was originally derived from software contributed
	to the University of California, Berkeley by Steve Kirkendall,
	the author of the vi clone elvis.  Without his work, this work
	would have been far more difficult.

	POSIX 1003.2 style regular expression support is courtesy of
	Henry Spencer, for which I am *very* grateful.

	The reworked curses implementation was done by Elan Amir
	while at the University of California, Berkeley.

=-=-=-=-=-=-=-=-=-=-=
o Comments:

This software is alpha software, although it's getting fairly stable.  I
believe that almost all of the necessary functionality for ex/vi is in
it, but it's definitely not ready for prime time.  Code fixes are, of
course, very much appreciated, but if you don't have time, please send me
as much information as you can as to how to reproduce the bug, and I'll
fix it here.  In particular, the screen routines are nasty stuff, and you
probably don't want to mess with them.  Stack traces of core dumps are
helpful, but even more helpful is an example file with a set of keystrokes.

Nvi is mostly 8-bit clean.  This isn't difficult to fix, and was left in
during initial development to make things easier.  Wide character support
will be integrated at the same time it is made fully 8-bit clean.

=-=-=-=-=-=-=-=-=-=-=
o New features:

There aren't a lot of new features in nex/nvi, but there are a few
things you might like:

	o 8-bit clean data, practically infinite lines/files, however,
	  "nvi /vmunix" is a bit slow.
	o Split screens:
		:split [file ...]" splits the screen
		^W switches between screens
	o Buffer display:
		:b[display] displays the current cut buffers
	o Tag stacks:
		^T returns from previous tag location
		":tagpop" returns to previous tag location
		":tagtop" returns to original tag location
	o Infinite undo:
		":set nundo" toggles this behavior
		u un-does the previous operation
		U re-does the next operation
	o Usage information:
		":exu[sage] cmd" for ex commands
		":viu[sage] key" for vi commands
	o Word search:
		^A searches for the word referenced by the cursor
	o Number increment:
		# increments the number referenced by the cursor
	o Previous file:
		:"prev[ious][!]" edits the previous file

=-=-=-=-=-=-=-=-=-=-=
o Known bugs:

	o Erasure of characters input using the 'R' command isn't
	  correct.
	o Several options have not been implemented: wrapmargin,
	  showmatch and a few others.
	o Nvi uses POSIX 1003.2 basic and extended RE's.  The historic
	  RE hack will be put in RSN.
	o Piping more than 4K or so at a time through a system command
	  causes nvi to hang.

	And, frankly, lots of fairly random other stuff.

=-=-=-=-=-=-=-=-=-=-=
o Porting information:

The directory PORT has a old-style Makefile which builds the entire nvi
distribution.  See it and the file PORT/README for more information.

=-=-=-=-=-=-=-=-=-=-=
o Directories:

The main directory, nvi, contains some source files for various pieces
of code that are shared by all the editors, mostly logging code or code
translating line numbers into requests to the dbopen(3) database code.
It also has the code for adding, deleting, and changing "records" in
the underlying database.

The nvi/ex directory is the ex source code.  Because vi has the colon
command, lots of this code is used by vi.  Generally, if functionality
is shared by both ex and vi, it's in nvi/ex, if it's vi only, it's in
nvi/vi.  Files are generally named by the command(s) they support, but
occasionally with a name that describes their functionality.

The nvi/sex directory is the screen support for the ex editor.

The nvi/vi directory is the vi source code.

The nvi/svi directory is the screen support for a curses based vi editor.

The nvi/docs directory has technical information about data structures
and some of the trickier parts of vi like quoting, key mapping, input
queues, and executing buffers.

=-=-=-=-=-=-=-=-=-=-=
o Temporary files and recovery:

There is no "recovery" program for nvi, nor does it run setuid.  Users
may "recover" any file which they may read, thus, the superuser can
recover any edit session.

Edit sessions are backed by files in /var/tmp/vi.recover, and are named
"vi.XXX", where "XXX" is a number related to the process id.  When the
file is first modified, a second file, which contains an email message for
the user, is created, and is named "recover.XXX", where, again, "XXX" is
associated with the process id.  Both files are removed at the end of a
normal edit session, but will remain if the edit session is abnormally
terminated or the user enters the ex/vi ":preserve" command.

The use of /var/tmp/vi.recover may be changed by setting the "directory"
option in the user or system .exrc file.

The recover file has all of the necessary information in it to enable the
user to recover the edit session.  In addition, it has all of the
necessary email headers for sendmail.  When the system is rebooted, all
of the files in /var/tmp/vi.recover named "recover.XXX" should be sent
by email, using the -t flag of sendmail (or a similar mechanism with other
mailers).  A simple way to do this is to insert the following script into
your rc.local file:

	for i in /var/tmp/vi.recover/recover.*; do
		sendmail -t < $i
	done

If nex/nvi receives a hangup (SIGHUP) signal, it mails the recovery
information to the user itself.
