Index: README ================================================================== --- README +++ README @@ -1,8 +1,8 @@ FILE: "/home/joze/src/tclreadline/README" - LAST MODIFICATION: "Sun Aug 22 23:24:34 1999 (joze)" + LAST MODIFICATION: "Mon Aug 23 00:21:24 1999 (joze)" (C) 1998, 1999 by Johannes Zellner, $Id$ --- tclreadline -- gnu readline for tcl @@ -81,18 +81,28 @@ changes: - tclreadline::readline customcompleter - tclreadline::readline builtincompleter - tclreadline::readline eofchar - - variable, array and '[' command completion. + - variable, array and '[' command completion by the script + tclreadline::ScriptCompleter. See the man page or try + typing "puts $env" ... Command completion currently only + works, if a '[' preceeds immediately a non-white character. + - the redefinition of the command `cd' was removed due to + multiple requests. This redefinition can be found in the + file `sample.tclshrc' and can be uncommented, if desired. + - the definition of the command `ls' was moved outside the + proc tclreadline::Setup and can be used with the command + namespace import tclreadline::ls (see sample.tclshrc). bug fixes: - - history entries. - - macro mappings didn't work. (only on hitting + - lines added to tcl's history. (were only in readline's hist.) + - macro mappings didn't work. (only when hitting mapped characters more than once.) - minor fixes in configure.in -tclreadline-0.8: - minor bug fixes. +tclreadline-0.8: (May 1999) + - adapted for tcl8.1. + - minor bug fixes. -tclreadline-0.7: +tclreadline-0.7: (Mar 1999) first `public release'. Index: sample.tclshrc ================================================================== --- sample.tclshrc +++ sample.tclshrc @@ -1,16 +1,51 @@ #!/bin/sh -# FILE: "/diska/home/joze/src/tclreadline/sample.tclshrc" -# LAST MODIFICATION: "Fri Aug 20 15:39:58 1999 (joze)" +# FILE: "/home/joze/src/tclreadline/sample.tclshrc" +# LAST MODIFICATION: "Mon Aug 23 00:00:23 1999 (joze)" # (C) 1999 by Johannes Zellner, # $Id$ # vim:set ft=tcl: \ exec tclsh "$0" "$@" if {$tcl_interactive} { + package require tclreadline - namespace import ::tclreadline::Print -# ::tclreadline::Print no + + # uncomment the following if block, if you + # want `ls' executed after every `cd'. (This was + # the default up to 0.8 == tclreadline_version.) + # + # if {"" == [info procs cd]} { + # catch {rename ::tclreadline::Cd ""} + # rename cd ::tclreadline::Cd + # proc cd {args} { + # if {[catch {eval ::tclreadline::Cd $args} message]} { + # puts stderr "$message" + # } + # ls + # } + # } + + # uncomment the following line to use + # tclreadline's fancy ls proc. + # + # namespace import ::tclreadline::ls + + # tclreadline::Print is on (`yes') by default. + # This mimics the command echoing like in the + # non-readline interactive tclsh. + # If you don't like this, uncomment the following + # line. + # + # ::tclreadline::Print no + + # uncomment the folling line, if you want + # to change tclreadline's print behaviour + # frequently with less typing. + # + # namespace import ::tclreadline::Print + + # go to tclrealdine's main loop. ::tclreadline::Loop } Index: tclreadline.n.in ================================================================== --- tclreadline.n.in +++ tclreadline.n.in @@ -1,10 +1,10 @@ .TH tclreadline n "@TCLREADLINE_VERSION@" "Johannes Zellner" .\" (C) 1999 by Johannes Zellner .\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in" -.\" LAST MODIFICATION: "Sun Aug 22 23:24:34 1999 (joze)" +.\" LAST MODIFICATION: "Mon Aug 23 00:15:10 1999 (joze)" .\" (C) 1998, 1999 by Johannes Zellner, .\" $Id$ .\" --- .\" .\" tclreadline -- gnu readline for the tcl scripting language @@ -121,11 +121,11 @@ with the four arguments \fI"$b"\fP, \fI"5"\fP, \fI"8"\fP and \fI"puts $b"\fP. The custom completer could return a string like "$bl $black $blue", which will complete "$b" to "$bl" (the longest match) and offer a list of two further matches "$black" and "$blue". -For further reference, see the proc tclreadline::script_completer in +For further reference, see the proc tclreadline::ScriptCompleter in the file tclreadlineSetup.tcl. .TP 5 \fB::tclreadline::readline builtincompleter\fP [\fIbool\fP] enable or disable the builtin completer. If the builtin completer @@ -166,17 +166,23 @@ \fB::tclreadline::Print\fP [\fIyes / no\fP] turns on or off the default behavior of tclsh to print the result of every command. This is turned on by default, so it will just behave as the tclsh w/o tclreadline. Turning off might be useful, when reading binary data for example. If \fB::tclreadline::Print\fP is called w/o -arguments, it just returns the current setting. +arguments, it returns the current setting. .TP 5 \fB::tclreadline::Loop\fP enter the tclreadline main loop. This command is typically called from the startup resource file (something .tclshrc, depending on the interpreter -you use). \fB::tclreadline::Loop\fP will normally not return. +you use, see the file `sample.tclshrc'). The main loop sets up some +completion characteristics as variable -- try something like "puts $b" -- +and command completion -- try "puts [in". +\fB::tclreadline::Loop\fP will normally not return. +If you want to write your own main loop and/or own custom completers, +it is probably a good idea to start with tclreadline::Loop +(see the file tclreadlineSetup.tcl). .TP 5 \fB::tclreadline::prompt1\fP a proc which is called by ::tclreadline::Loop and returns a string which will be displayed as the primary prompt. This prompt will be @@ -278,11 +284,17 @@ David Engel , .SH DEBIAN PACKAGE David Engel , -.SH HISTORY +.SH DISCLAIMER + This version of \fBtclreadline\fP is still a development version. Pretty a lot of features and ideas are not implemented yet. The reason for this is the lack of time and manpower. So you are welcome to modify and contribute to the code. If you have suggestions, please let me know. + +\fBtclreadline\fP comes with the GPL (GNU General Public License). +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Index: tclreadlineSetup.tcl.in ================================================================== --- tclreadlineSetup.tcl.in +++ tclreadlineSetup.tcl.in @@ -1,8 +1,8 @@ #!/usr/local/bin/tclsh # FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in" -# LAST MODIFICATION: "Sun Aug 22 22:30:43 1999 (joze)" +# LAST MODIFICATION: "Sun Aug 22 23:54:09 1999 (joze)" # (C) 1998, 1999 by Johannes Zellner, # $Id$ # --- # # tclreadline -- gnu readline for tcl @@ -161,11 +161,11 @@ } } return ${part} } -proc tclreadline::vars_cmds_completer {part start end line} { +proc tclreadline::ScriptCompleter {part start end line} { if {{$} == [string index $part 0]} { # variable completion. Check first, if the # variable starts with a plain `$' or should # be enclosed in braces. # @@ -228,11 +228,11 @@ uplevel #0 { if {[info commands ::tclreadline::readline] == ""} { ::tclreadline::Init } - tclreadline::readline customcompleter tclreadline::vars_cmds_completer + tclreadline::readline customcompleter tclreadline::ScriptCompleter if {[catch {set a [::tclreadline::prompt1]}] \ && [info nameofexecutable] != ""} { namespace eval ::tclreadline {