README for tclsh-readline package

Dan Ellis <dpwe@icsi.berkeley.edu> 1996nov15

Source home location:
    ftp://ftp.icsi.berkeley.edu/pub/real/dpwe/tclsh-readline-?.?.tgz

These replacements for tclMain.c and tkMain.c link in the GNU readline
interface to allow editable command lines with history and path
completion for the tcl shells.  The readline library must be obtained
and compiled separately, and the Makefile edited to point to it.

The necessary changes to tclMain.c and tkMain.c change with every
version!  See the files with numeric suffixes for other versions of
Tcl/Tk.  This package is set to run for a Solaris machine and
Tcl7.6/Tk4.2.  Linking is done with CC rather than cc, so that
loadable extensions using C++ will work.  You need to 'setenv CXX' to
the name of your C++ compiler, 'setenv MACHTYPE' to a specifier for
your architecture type (e.g. sun4-sunos5) and 'mkdir' a directory
called $MACHTYPE-$CXX into which the object files are written.

You can get the GNU readline package in many places, for instance:
    ftp://ftp.gnu.ai.mit.edu/pub/gnu/readline-2.0.tar.gz
Or it may already be installed on your system, for instance as a 
subdirectory within the gdb source.

CAVEATS:

The 'readline' code assumes it can use the 'standard' stdin and stdout
channels, so the Tcl 'standard channels' are ignored.  This hasn't been 
a problem for me, nor probably other Unix users.

The tcl_prompt1 and tcl_prompt2 variables are originally defined as the 
place to put commands that output a prompt in normal and command-
continuation conditions respectively.  Since readline wants the prompt 
in a string, I have redefined the semantics of these variables so that, 
if used, they *return a string* that should be used as the prompt.  
Thus if you formerly had:

	set tcl_prompt1 {puts -nonewline "[history nextid] > "}

you would need to change it to:

	set tcl_prompt1 {return "[history nextid] > "}

I haven't actually seen this used, so hopefully it won't break too much.

HISTORY: 

1996nov15 dpwe@icsi.berkeley.edu
	Ver 0.1 released.

1997jan10 dpwe@icsi.berkeley.edu
	Added support for [incr tcl] v 2.2's shells, itclsh and itkwish.  
	Just point the ITCL_BASE variable in Makefile to the right place.

1997jan17 dpwe@icsi.berkeley.edu
	Chris Ang <ang@nueville.amd.com> pointed out that tclsh didn't 
	handle multi-line entries correctly.  Located excess DString_Init 
	in tclMain.c & fixed.
	Ver 0.2 released.
