Check-in [4d2e761f67]
Not logged in
Overview
SHA1:4d2e761f6715e54e3c3ad0f8b52fdc46cf503c8e
Date: 2000-03-23 22:51:28
User: johannes@zellner.org
Comment: works with tcl8.3
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2000-03-24
00:50
[55d574a588] Fri Mar 24 01:50:58 CET 2000 (user: johannes@zellner.org, tags: trunk)
2000-03-23
22:51
[4d2e761f67] works with tcl8.3 (user: johannes@zellner.org, tags: trunk)
19:54
[a280a34644] Thu Mar 23 20:54:24 CET 2000 (user: johannes@zellner.org, tags: trunk)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified AUTHORS from [0d3e16f9eb] to [cfbe12ee19].

     1         -Johannes Zellner, <johannes@zellner.org>, http://www.zellner.org/
            1  +   Johannes Zellner      <johannes@zellner.org>      http://www.zellner.org/

Modified Makefile.in from [749e11d6f6] to [d78217767c].

     1      1   # -*- make -*-
     2         -# FILE: "/home/joze/src/tclreadline/Makefile.in.bak"
     3         -# LAST MODIFICATION: "Thu, 23 Mar 2000 20:47:35 +0100 (joze)"
            2  +# FILE: "/home/joze/src/tclreadline/Makefile.in"
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 23:26:56 +0100 (joze)"
     4      4   # (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9      9   # Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   #
................................................................................
   141    141   TOP_DIR              = $(srcdir)
   142    142   TCL_INCLUDE_DIR      = @TCL_INCLUDE_DIR@
   143    143   TCL_LIB_SPEC         = @TCL_LIB_SPEC@
   144    144   TK_LIB_SPEC          = @TK_LIB_SPEC@
   145    145   READLINE_INCLUDE_DIR = @READLINE_INCLUDE_DIR@
   146    146   TCLREADLINE_LIB_FILE = @TCLREADLINE_LIB_FILE@
   147    147   
   148         -READLINE_LIB         = -L@READLINE_LIB_DIR@ -lreadline
          148  +READLINE_LIB         = @READLINE_LIB_DIR@ -lreadline
   149    149   TERMLIB              = @TERMLIB@
   150    150   TERMLIB_DIR          = @TERMLIB_DIR@
   151    151   
   152    152   #----------------------------------------------------------------
   153    153   # The information below should be usable as is.  The configure
   154    154   # script won't modify it and you shouldn't need to modify it
   155    155   # either.

Modified README from [fe12ffe1fc] to [a59b6fbfd8].

     1      1   
     2      2       FILE: "/home/joze/src/tclreadline/README"
     3         -    LAST MODIFICATION: "Thu Dec 16 22:17:39 1999 (joze)"
     4         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            3  +    LAST MODIFICATION: "Thu, 23 Mar 2000 21:16:15 +0100 (joze)"
            4  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5       $Id$
     6      6       ---
     7      7   
     8      8       tclreadline -- gnu readline for tcl
     9         -    Copyright (C) 1999  Johannes Zellner
            9  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   
    11     11       This program is free software; you can redistribute it and/or
    12     12       modify it under the terms of the GNU General Public License
    13     13       as published by the Free Software Foundation; either version 2
    14     14       of the License, or (at your option) any later version.
    15     15   
    16     16       This program is distributed in the hope that it will be useful,

Modified TODO from [68a22a50ce] to [c2db190709].

     1      1   
     2      2    /* ==================================================================
     3      3      
     4         -    FILE: "/diska/home/joze/src/tclreadline/TODO"
     5         -    LAST MODIFICATION: "Mon Sep  6 08:44:35 1999 (joze)"
     6         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            4  +    FILE: "/home/joze/src/tclreadline/TODO"
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 21:16:21 +0100 (joze)"
            6  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       ---
     9      9   
    10     10       tclreadline -- gnu readline for tcl
    11         -    Copyright (C) 1999  Johannes Zellner
           11  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    12     12   
    13     13       This program is free software; you can redistribute it and/or
    14     14       modify it under the terms of the GNU General Public License
    15     15       as published by the Free Software Foundation; either version 2
    16     16       of the License, or (at your option) any later version.
    17     17   
    18     18       This program is distributed in the hope that it will be useful,

Modified config.h.in from [0d9d9d2e87] to [3eba5936c6].

     1      1   
     2      2    /* ==================================================================
     3      3      
     4         -    FILE: "/home/joze/src/tclreadline/config.h.in.bak"
     5         -    LAST MODIFICATION: "Thu, 23 Mar 2000 20:53:11 +0100 (joze)"
            4  +    FILE: "/home/joze/src/tclreadline/config.h.in"
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 21:16:34 +0100 (joze)"
     6      6       (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       vim:set ft=c:
     9      9       ---
    10     10   
    11     11       tclreadline -- gnu readline for tcl
    12         -    Copyright (C) 1998 - 2000 Johannes Zellner
           12  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    13     13   
    14     14       This program is free software; you can redistribute it and/or
    15     15       modify it under the terms of the GNU General Public License
    16     16       as published by the Free Software Foundation; either version 2
    17     17       of the License, or (at your option) any later version.
    18     18   
    19     19       This program is distributed in the hope that it will be useful,

Modified configure.in from [4e05867f99] to [f77c7b4ed7].

     1      1   dnl -*- autoconf -*-
     2      2   dnl FILE: "/home/joze/src/tclreadline/configure.in"
     3         -dnl LAST MODIFICATION: "Thu, 23 Mar 2000 20:46:59 +0100 (joze)"
            3  +dnl LAST MODIFICATION: "Thu, 23 Mar 2000 23:26:48 +0100 (joze)"
     4      4   dnl (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   dnl $Id$
     6      6   dnl ---
     7      7   dnl
     8      8   dnl tclreadline -- gnu readline for tcl
     9         -dnl Copyright (C) 1998 - 2000 Johannes Zellner
            9  +dnl Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   dnl
    11     11   dnl This program is free software; you can redistribute it and/or
    12     12   dnl modify it under the terms of the GNU General Public License
    13     13   dnl as published by the Free Software Foundation; either version 2
    14     14   dnl of the License, or (at your option) any later version.
    15     15   dnl
    16     16   dnl This program is distributed in the hope that it will be useful,
................................................................................
    29     29   
    30     30   dnl	This file is an input file used by the GNU "autoconf" program to
    31     31   dnl	generate the file "configure", which is run during Tk installation
    32     32   dnl	to configure the system for the local environment.
    33     33   
    34     34   
    35     35   AC_INIT(tclreadline.c)
    36         -AM_CONFIG_HEADER(config.h)
           36  +AC_CONFIG_HEADER(config.h)
    37     37   AC_PREREQ(2.13)
    38     38   AC_REVISION($Revision$)
    39     39   AC_CONFIG_AUX_DIR(./aux)
    40     40   
    41     41   TCLREADLINE_MAJOR_VERSION=1
    42     42   TCLREADLINE_MINOR_VERSION=1
    43     43   TCLREADLINE_PATCHLEVEL=0
    44     44   TCLREADLINE_VERSION=$TCLREADLINE_MAJOR_VERSION.$TCLREADLINE_MINOR_VERSION
    45     45   TCLREADLINE_PATCHLEVEL_STR=${TCLREADLINE_VERSION}.${TCLREADLINE_PATCHLEVEL}
    46     46   VERSION=$TCLREADLINE_VERSION
    47     47   
    48         -AM_INIT_AUTOMAKE(libtclreadline, $VERSION)
    49         -
    50     48   dnl AM_INIT_AUTOMAKE(tclreadline, $VERSION)
    51     49   
    52     50   AC_CANONICAL_HOST
    53     51   
    54     52   
    55     53   TCLREADLINE_LPATH=`echo $LD_LIBRARY_PATH $LD_RUN_PATH $LPATH | sed 's/:/ /g'`
    56     54   TCLREADLINE_LPATH="$TCLREADLINE_LPATH /usr/local/lib /lib /usr/lib /usr/shlib"
................................................................................
    89     87   #--------------------------------------------------------------------
    90     88   #    eventually check for tkConfig.sh
    91     89   #--------------------------------------------------------------------
    92     90   
    93     91   tk_search="no"
    94     92   AC_ARG_WITH(
    95     93       tk,
    96         -    [  --with-tk=DIR           where to look for tclConfig.sh],
           94  +    [  --with-tk=DIR           where to look for tkConfig.sh],
    97     95       tk_search=$withval,
    98     96       tk_search="yes"
    99     97   )
   100     98   
   101     99   if test "$tk_search" != "no"; then
   102    100       AC_MSG_CHECKING([which tkConfig.sh to use])
   103    101       TK_LIB_DIR=""
   104         -    for dir in $tk_search /usr/lib /usr/local/lib $exec_prefix/lib /usr/local/lib/unix /opt/tcl/lib; do
          102  +    for dir in $tk_search $TCL_LIB_DIR /usr/lib /usr/local/lib $exec_prefix/lib /usr/local/lib/unix /opt/tcl/lib; do
   105    103   	if test -r $dir/tkConfig.sh; then
   106    104   	    TK_LIB_DIR=$dir
   107    105   	    break
   108    106   	fi
   109    107       done
   110    108   
   111    109       if test -z "$TK_LIB_DIR"; then
................................................................................
   167    165   TCLREADLINE_LIBRARY=${exec_prefix}/lib/tclreadline$TCLREADLINE_VERSION
   168    166   
   169    167   
   170    168   # -----------------------------------------------------------------------
   171    169   #   Check for some programs here.
   172    170   # -----------------------------------------------------------------------
   173    171   
   174         -AM_PROG_LIBTOOL
   175    172   AC_PROG_INSTALL
   176    173   AC_PROG_RANLIB
   177    174   AC_PROG_LN_S
   178    175   
   179    176   
   180    177   
   181    178   # -----------------------------------------------------------------------
................................................................................
   200    197   #   checking for the preprocessor.
   201    198   #   FIXME: do we need this ?
   202    199   # -----------------------------------------------------------------------
   203    200   
   204    201   AC_PROG_CPP
   205    202   
   206    203   
   207         -
   208         -#--------------------------------------------------------------------
   209         -#   If this is gcc, add some extra compile flags.
   210         -#--------------------------------------------------------------------
   211         -
   212         -AC_MSG_CHECKING([whether C compiler is gcc])
   213         -AC_CACHE_VAL(tclreadline_cv_prog_gcc,
   214         -    AC_EGREP_CPP(_cc_is_gcc_, [
   215         -#ifdef __GNUC__
   216         -_cc_is_gcc_
   217         -#endif
   218         -],      [tclreadline_cv_prog_gcc=yes], [tclreadline_cv_prog_gcc=no]))
   219         -AC_MSG_RESULT([$tclreadline_cv_prog_gcc])
   220         -
   221    204   if test -z "$CFLAGS" ; then
   222    205       CFLAGS=$TCL_CFLAGS_OPTIMIZE
   223    206   fi
   224         -if test "$tclreadline_cv_prog_gcc" = "yes" ; then
   225         -    CFLAGS="$CFLAGS -Wshadow -Wtraditional -Wall"
   226         -fi
   227    207   
   228         -AC_MSG_CHECKING([default compiler flags])
   229         -AC_ARG_WITH(cflags, [  --with-cflags=FLAGS     set compiler flags to FLAGS],
   230         -    [CFLAGS="$with_cflags"])
   231         -
   232         -AC_MSG_RESULT([$CFLAGS])
          208  +dnl #--------------------------------------------------------------------
          209  +dnl #   If this is gcc, add some extra compile flags.
          210  +dnl #--------------------------------------------------------------------
          211  +dnl 
          212  +dnl AC_MSG_CHECKING([whether C compiler is gcc])
          213  +dnl AC_CACHE_VAL(tclreadline_cv_prog_gcc,
          214  +dnl     AC_EGREP_CPP(_cc_is_gcc_, [
          215  +dnl #ifdef __GNUC__
          216  +dnl _cc_is_gcc_
          217  +dnl #endif
          218  +dnl ],      [tclreadline_cv_prog_gcc=yes], [tclreadline_cv_prog_gcc=no]))
          219  +dnl AC_MSG_RESULT([$tclreadline_cv_prog_gcc])
          220  +dnl 
          221  +dnl if test -z "$CFLAGS" ; then
          222  +dnl     CFLAGS=$TCL_CFLAGS_OPTIMIZE
          223  +dnl fi
          224  +dnl if test "$tclreadline_cv_prog_gcc" = "yes" ; then
          225  +dnl     CFLAGS="$CFLAGS -Wshadow -Wtraditional -Wall"
          226  +dnl fi
          227  +dnl 
          228  +dnl AC_MSG_CHECKING([default compiler flags])
          229  +dnl AC_ARG_WITH(cflags, [  --with-cflags=FLAGS     set compiler flags to FLAGS],
          230  +dnl     [CFLAGS="$with_cflags"])
          231  +dnl 
          232  +dnl AC_MSG_RESULT([$CFLAGS])
   233    233   
   234    234   if test "$TCL_CC" != "$CC" ; then
   235    235       echo ""
   236    236       echo "WARNING:  Compiler is $CC but Tcl was compiled with $TCL_CC"
   237    237       echo ""
   238    238   fi
   239    239   
................................................................................
   355    355   AC_MSG_CHECKING([where to look for libreadline$SHLIB_SUFFIX])
   356    356   READLINE_LIB_DIR=""
   357    357   READLINE_VERSION_SUFFIX=""
   358    358   for dir in $rl_library $TCLREADLINE_LPATH $prefix/lib/readline; do
   359    359       if test -r $dir/libreadline$SHLIB_SUFFIX; then
   360    360           READLINE_LIB_DIR=$dir
   361    361           break
          362  +    fi
          363  +    if test -r $dir/libreadline$SHLIB_SUFFIX.4; then
          364  +        READLINE_VERSION_SUFFIX=".4"
          365  +        READLINE_LIB_DIR=$dir
          366  +        break
   362    367       fi
   363    368       if test -r $dir/libreadline$SHLIB_SUFFIX.4.0; then
   364    369           READLINE_VERSION_SUFFIX=".4.0"
   365    370           READLINE_LIB_DIR=$dir
   366    371           break
          372  +    fi
          373  +    if test -r $dir/libreadline$SHLIB_SUFFIX.3; then
          374  +        READLINE_VERSION_SUFFIX=".3"
          375  +        READLINE_LIB_DIR=$dir
          376  +        break
   367    377       fi
   368    378       if test -r $dir/libreadline$SHLIB_SUFFIX.3.0; then
   369    379           READLINE_VERSION_SUFFIX=".3.0"
   370    380           READLINE_LIB_DIR=$dir
   371    381           break
   372    382       fi
   373    383   done

Modified pkgIndex.tcl.in from [62387bbed8] to [6c7af61e8f].

     1      1   #!/usr/local/bin/tclsh
     2         -# FILE: "/diska/home/joze/src/tclreadline/pkgIndex.tcl"
     3         -# LAST MODIFICATION: "Fri Aug 20 15:33:25 1999 (joze)"
     4         -# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            2  +# FILE: "/home/joze/src/tclreadline/pkgIndex.tcl.in"
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 21:13:00 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9         -# Copyright (C) 1999  Johannes Zellner
            9  +# Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   #
    11     11   # This program is free software; you can redistribute it and/or
    12     12   # modify it under the terms of the GNU General Public License
    13     13   # as published by the Free Software Foundation; either version 2
    14     14   # of the License, or (at your option) any later version.
    15     15   #
    16     16   # This program is distributed in the hope that it will be useful,

Modified sample.tclshrc from [f68b1de54f] to [25ec261415].

     1      1   #!/bin/sh
     2         -# FILE: "/diska/home/joze/src/tclreadline/sample.tclshrc"
     3         -# LAST MODIFICATION: "Mon Sep 13 18:21:52 1999 (joze)"
     4         -# (C) 1999 by Johannes Zellner, <johannes@zellner.org>
            2  +# FILE: "/home/joze/src/tclreadline/sample.tclshrc"
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 21:13:08 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # vim:set ft=tcl: \
     7      7   exec tclsh "$0" "$@"
     8      8   
     9      9   
    10     10   if {$tcl_interactive} {
    11     11   

Modified tclreadline.c from [1d8264541a] to [83f0651eba].

     1      1   
     2      2    /* ==================================================================
     3      3   
     4      4       FILE: "/home/joze/src/tclreadline/tclreadline.c"
     5         -    LAST MODIFICATION: "Tue Sep 21 21:19:35 1999 (joze)"
     6         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 22:42:52 +0100 (joze)"
            6  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       ---
     9      9   
    10     10       tclreadline -- gnu readline for tcl
    11         -    Copyright (C) 1999  Johannes Zellner
           11  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    12     12   
    13     13       This program is free software; you can redistribute it and/or
    14     14       modify it under the terms of the GNU General Public License
    15     15       as published by the Free Software Foundation; either version 2
    16     16       of the License, or (at your option) any later version.
    17     17   
    18     18       This program is distributed in the hope that it will be useful,
................................................................................
   121    121   
   122    122   
   123    123   char*
   124    124   stripleft(char* in)
   125    125   {
   126    126       char* ptr = in;
   127    127       while (*ptr && *ptr <= ' ')
   128         -        ptr++;
          128  +	ptr++;
   129    129       if (in != ptr)
   130         -        memmove(in, ptr, strlen(ptr) + 1);
          130  +	memmove(in, ptr, strlen(ptr) + 1);
   131    131       return in;
   132    132   }
   133    133   
   134    134   char*
   135    135   stripright(char* in)
   136    136   {
   137    137       char* ptr;
   138    138       for (ptr = strchr(in, '\0') - 1; ptr >= in && *ptr <= ' '; ptr--)
   139         -        *ptr = '\0';
          139  +	*ptr = '\0';
   140    140       return in;
   141    141   }
   142    142   
   143    143   char*
   144    144   stripwhite(char* in)
   145    145   {
   146    146       stripleft(in);
................................................................................
   167    167       char* ptr;
   168    168       char* result_c;
   169    169       int i, len = strlen(quotechars);
   170    170       Tcl_DString result;
   171    171   
   172    172       Tcl_DStringInit(&result);
   173    173       for (ptr = text; ptr && *ptr; ptr++) {
   174         -        for (i = 0; i < len; i++) {
   175         -            if (quotechars[i] == *ptr) {
   176         -                Tcl_DStringAppend(&result, "\\", 1);
   177         -                break;
   178         -            }
   179         -        }
   180         -        Tcl_DStringAppend(&result, ptr, 1);
          174  +	for (i = 0; i < len; i++) {
          175  +	    if (quotechars[i] == *ptr) {
          176  +		Tcl_DStringAppend(&result, "\\", 1);
          177  +		break;
          178  +	    }
          179  +	}
          180  +	Tcl_DStringAppend(&result, ptr, 1);
   181    181       }
   182    182       result_c = strdup(Tcl_DStringValue(&result));
   183    183       return result_c;
   184    184   }
   185    185   
   186    186   int
   187    187   TclReadlineCmd(
   188    188       ClientData  clientData,
   189    189       Tcl_Interp* interp,     /* Current interpreter */
   190    190       int         argc,       /* Number of arguments */
   191    191       char**      argv        /* Argument strings    */
   192         -)
          192  +	      )
   193    193   {
   194    194       int i, obj_idx, status;
   195    195       Tcl_Obj** objv = (Tcl_Obj**) MALLOC((argc + 1) * sizeof(Tcl_Obj *));
   196    196   
   197    197       static char *subCmds[] = {
   198         -        "read", "initialize", "write", "add", "complete",
   199         -        "customcompleter", "builtincompleter", "eofchar",
   200         -		"reset-terminal", "bell",
   201         -        (char *) NULL
          198  +	"read", "initialize", "write", "add", "complete",
          199  +	"customcompleter", "builtincompleter", "eofchar",
          200  +	"reset-terminal", "bell",
          201  +	(char *) NULL
   202    202       };
   203    203       enum SubCmdIdx {
   204         -        TCLRL_READ, TCLRL_INITIALIZE, TCLRL_WRITE, TCLRL_ADD, TCLRL_COMPLETE,
   205         -        TCLRL_CUSTOMCOMPLETER, TCLRL_BUILTINCOMPLETER, TCLRL_EOFCHAR,
   206         -		TCLRL_RESET_TERMINAL, TCLRL_BELL
          204  +	TCLRL_READ, TCLRL_INITIALIZE, TCLRL_WRITE, TCLRL_ADD, TCLRL_COMPLETE,
          205  +	TCLRL_CUSTOMCOMPLETER, TCLRL_BUILTINCOMPLETER, TCLRL_EOFCHAR,
          206  +	TCLRL_RESET_TERMINAL, TCLRL_BELL
   207    207       };
   208    208   
   209    209   
   210    210       Tcl_ResetResult(interp); /* clear the result space */
   211    211   
   212    212       for (i = 0;  i < argc;  i++) {
   213         -        Tcl_Obj* objPtr = Tcl_NewStringObj(argv[i], -1);
   214         -        Tcl_IncrRefCount(objPtr);
   215         -        objv[i] = objPtr;
          213  +	Tcl_Obj* objPtr = Tcl_NewStringObj(argv[i], -1);
          214  +	Tcl_IncrRefCount(objPtr);
          215  +	objv[i] = objPtr;
   216    216       }
   217    217       objv[argc] = 0; /* terminate */
   218    218   
   219    219       if (argc < 2) {
   220         -        Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
   221         -        return TCL_ERROR;
          220  +	Tcl_WrongNumArgs(interp, 1, objv, "option ?arg arg ...?");
          221  +	return TCL_ERROR;
   222    222       }
   223         -    
          223  +
   224    224       status = Tcl_GetIndexFromObj
   225         -        (interp, objv[1], subCmds, "option", 0, (int *) &obj_idx);
          225  +    (interp, objv[1], subCmds, "option", 0, (int *) &obj_idx);
   226    226   
   227    227       if (status != TCL_OK) {
   228         -        FREE(objv)
   229         -        return status;
          228  +	FREE(objv)
          229  +	return status;
   230    230       }
   231    231   
   232    232       switch (obj_idx) {
   233    233   
   234         -        case TCLRL_READ:
          234  +	case TCLRL_READ:
   235    235   
   236         -            rl_callback_handler_install(argc == 3 ? argv[2] : "%",
   237         -                TclReadlineLineCompleteHandler);
          236  +	    rl_callback_handler_install(argc == 3 ? argv[2] : "%",
          237  +		TclReadlineLineCompleteHandler);
   238    238   
   239         -            Tcl_CreateFileHandler(0, TCL_READABLE,
   240         -                TclReadlineReadHandler, (ClientData) NULL);
          239  +	    Tcl_CreateFileHandler(0, TCL_READABLE,
          240  +		TclReadlineReadHandler, (ClientData) NULL);
   241    241   
   242         -            /**
   243         -             * Main Loop.
   244         -             * XXX each modification of the global variables
   245         -             *     which terminates the main loop must call
   246         -             *     rl_callback_handler_remove() to leave
   247         -             *     readline in a defined state.          XXX
   248         -             */
   249         -            tclrl_state = LINE_PENDING;
          242  +	    /**
          243  +	     * Main Loop.
          244  +	     * XXX each modification of the global variables
          245  +	     *     which terminates the main loop must call
          246  +	     *     rl_callback_handler_remove() to leave
          247  +	     *     readline in a defined state.          XXX
          248  +	     */
          249  +	    tclrl_state = LINE_PENDING;
   250    250   
   251         -            while (!TclReadlineLineComplete()) {
          251  +	    while (!TclReadlineLineComplete()) {
   252    252   #ifdef EXECUTING_MACRO_HACK
   253         -                /**
   254         -                 * check first, if more characters are
   255         -                 * available from _rl_executing_macro,
   256         -                 * because Tcl_DoOneEvent() will (naturally)
   257         -                 * not detect this `event'.
   258         -                 */
   259         -                if (_rl_executing_macro)
   260         -                    TclReadlineReadHandler((ClientData) NULL, TCL_READABLE);
   261         -                else
          253  +		/**
          254  +		 * check first, if more characters are
          255  +		 * available from _rl_executing_macro,
          256  +		 * because Tcl_DoOneEvent() will (naturally)
          257  +		 * not detect this `event'.
          258  +		 */
          259  +		if (_rl_executing_macro)
          260  +		    TclReadlineReadHandler((ClientData) NULL, TCL_READABLE);
          261  +		else
   262    262   #endif
   263         -                    Tcl_DoOneEvent(TCL_ALL_EVENTS);
   264         -            }
   265         -
   266         -            Tcl_DeleteFileHandler(0);
   267         -
   268         -            switch (tclrl_state) {
   269         -
   270         -                case LINE_COMPLETE:
   271         -
   272         -                    return TCL_OK;
   273         -                    /* NOTREACHED */
   274         -                    break;
   275         -
   276         -                case LINE_EOF:
   277         -                    if (tclrl_eof_string)
   278         -                        return Tcl_Eval(interp, tclrl_eof_string);
   279         -                    else
   280         -                        return TCL_OK;
   281         -                    /* NOTREACHED */
   282         -                    break;
   283         -
   284         -                default:
   285         -                    return tclrl_state;
   286         -                    /* NOTREACHED */
   287         -                    break;
   288         -            }
   289         -            break;
   290         -
   291         -        case TCLRL_INITIALIZE:
   292         -            if (3 != argc) {
   293         -                Tcl_WrongNumArgs(interp, 2, objv, "historyfile");
   294         -                return TCL_ERROR;
   295         -            } else {
   296         -                return TclReadlineInitialize(interp, argv[2]);
   297         -            }
   298         -            break;
   299         -
   300         -        case TCLRL_WRITE:
   301         -            if (3 != argc) {
   302         -                Tcl_WrongNumArgs(interp, 2, objv, "historyfile");
   303         -                return TCL_ERROR;
   304         -            }  else if (write_history(argv[2])) {
   305         -                Tcl_AppendResult(interp, "unable to write history to `",
   306         -                    argv[2], "'\n", (char*) NULL);
   307         -                return TCL_ERROR;
   308         -            }
   309         -            if (tclrl_history_length >= 0) {
   310         -                history_truncate_file(argv[2], tclrl_history_length);
   311         -            }
   312         -            return TCL_OK;
   313         -            break;
   314         -
   315         -        case TCLRL_ADD:
   316         -            if (3 != argc) {
   317         -                Tcl_WrongNumArgs(interp, 2, objv, "completerLine");
   318         -                return TCL_ERROR;
   319         -            } else if (TclReadlineKnownCommands(argv[2], (int) 0, _CMD_SET)) {
   320         -                Tcl_AppendResult(interp, "unable to add command \"",
   321         -                    argv[2], "\"\n", (char*) NULL);
   322         -            }
   323         -            break;
   324         -
   325         -        case TCLRL_COMPLETE:
   326         -            if (3 != argc) {
   327         -                Tcl_WrongNumArgs(interp, 2, objv, "line");
   328         -                return TCL_ERROR;
   329         -            } else if (Tcl_CommandComplete(argv[2])) {
   330         -                Tcl_AppendResult(interp, "1", (char*) NULL);
   331         -            } else {
   332         -                Tcl_AppendResult(interp, "0", (char*) NULL);
   333         -            }
   334         -            break;
   335         -
   336         -        case TCLRL_CUSTOMCOMPLETER:
   337         -            if (argc > 3) {
   338         -                Tcl_WrongNumArgs(interp, 2, objv, "?scriptCompleter?");
   339         -                return TCL_ERROR;
   340         -            } else if (3 == argc) {
   341         -                if (tclrl_custom_completer)
   342         -                    FREE(tclrl_custom_completer);
   343         -                if (!blank_line(argv[2]))
   344         -                    tclrl_custom_completer = stripwhite(strdup(argv[2]));
   345         -            }
   346         -            Tcl_AppendResult(interp, tclrl_custom_completer, (char*) NULL);
   347         -            break;
   348         -
   349         -        case TCLRL_BUILTINCOMPLETER:
   350         -            if (argc > 3) {
   351         -                Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
   352         -                return TCL_ERROR;
   353         -            } else if (3 == argc) {
   354         -                int bool = tclrl_use_builtin_completer;
   355         -                if (TCL_OK != Tcl_GetBoolean(interp, argv[2], &bool)) {
   356         -                    Tcl_AppendResult(interp,
   357         -                        "wrong # args: should be a boolean value.",
   358         -                        (char*) NULL);
   359         -                    return TCL_ERROR;
   360         -                } else {
   361         -                    tclrl_use_builtin_completer = bool;
   362         -                }
   363         -            }
   364         -            Tcl_AppendResult(interp, tclrl_use_builtin_completer ? "1" : "0",
   365         -                (char*) NULL);
   366         -            break;
   367         -
   368         -        case TCLRL_EOFCHAR:
   369         -            if (argc > 3) {
   370         -                Tcl_WrongNumArgs(interp, 2, objv, "?script?");
   371         -                return TCL_ERROR;
   372         -            } else if (3 == argc) {
   373         -                if (tclrl_eof_string)
   374         -                    FREE(tclrl_eof_string);
   375         -                if (!blank_line(argv[2]))
   376         -                    tclrl_eof_string = stripwhite(strdup(argv[2]));
   377         -            }
   378         -            Tcl_AppendResult(interp, tclrl_eof_string, (char*) NULL);
   379         -            break;
   380         -
   381         -        case TCLRL_RESET_TERMINAL:
   382         -			/* TODO: add this to the completer */
   383         -            if (argc > 3) {
   384         -                Tcl_WrongNumArgs(interp, 2, objv, "?terminal-name?");
   385         -                return TCL_ERROR;
   386         -			}
   387         -            if (3 == argc) {
   388         -				/*
   389         -				 * - tcl8.0 doesn't have Tcl_GetString()
   390         -				 * - rl_reset_terminal() might be defined
   391         -				 *   to take no arguments. This might produce
   392         -				 *   a compiler warning.
   393         -				 */
   394         -				rl_reset_terminal(Tcl_GetStringFromObj(objv[2], (int*) NULL));
          263  +		    Tcl_DoOneEvent(TCL_ALL_EVENTS);
          264  +	    }
          265  +
          266  +	    Tcl_DeleteFileHandler(0);
          267  +
          268  +	    switch (tclrl_state) {
          269  +
          270  +		case LINE_COMPLETE:
          271  +
          272  +		    return TCL_OK;
          273  +		    /* NOTREACHED */
          274  +		    break;
          275  +
          276  +		case LINE_EOF:
          277  +		    if (tclrl_eof_string)
          278  +			return Tcl_Eval(interp, tclrl_eof_string);
          279  +		    else
          280  +			return TCL_OK;
          281  +		    /* NOTREACHED */
          282  +		    break;
          283  +
          284  +		default:
          285  +		    return tclrl_state;
          286  +		    /* NOTREACHED */
          287  +		    break;
          288  +	    }
          289  +	    break;
          290  +
          291  +	case TCLRL_INITIALIZE:
          292  +	    if (3 != argc) {
          293  +		Tcl_WrongNumArgs(interp, 2, objv, "historyfile");
          294  +		return TCL_ERROR;
          295  +	    } else {
          296  +		return TclReadlineInitialize(interp, argv[2]);
          297  +	    }
          298  +	    break;
          299  +
          300  +	case TCLRL_WRITE:
          301  +	    if (3 != argc) {
          302  +		Tcl_WrongNumArgs(interp, 2, objv, "historyfile");
          303  +		return TCL_ERROR;
          304  +	    }  else if (write_history(argv[2])) {
          305  +		Tcl_AppendResult(interp, "unable to write history to `",
          306  +		    argv[2], "'\n", (char*) NULL);
          307  +		return TCL_ERROR;
          308  +	    }
          309  +	    if (tclrl_history_length >= 0) {
          310  +		history_truncate_file(argv[2], tclrl_history_length);
          311  +	    }
          312  +	    return TCL_OK;
          313  +	    break;
          314  +
          315  +	case TCLRL_ADD:
          316  +	    if (3 != argc) {
          317  +		Tcl_WrongNumArgs(interp, 2, objv, "completerLine");
          318  +		return TCL_ERROR;
          319  +	    } else if (TclReadlineKnownCommands(argv[2], (int) 0, _CMD_SET)) {
          320  +		Tcl_AppendResult(interp, "unable to add command \"",
          321  +		    argv[2], "\"\n", (char*) NULL);
          322  +	    }
          323  +	    break;
          324  +
          325  +	case TCLRL_COMPLETE:
          326  +	    if (3 != argc) {
          327  +		Tcl_WrongNumArgs(interp, 2, objv, "line");
          328  +		return TCL_ERROR;
          329  +	    } else if (Tcl_CommandComplete(argv[2])) {
          330  +		Tcl_AppendResult(interp, "1", (char*) NULL);
          331  +	    } else {
          332  +		Tcl_AppendResult(interp, "0", (char*) NULL);
          333  +	    }
          334  +	    break;
          335  +
          336  +	case TCLRL_CUSTOMCOMPLETER:
          337  +	    if (argc > 3) {
          338  +		Tcl_WrongNumArgs(interp, 2, objv, "?scriptCompleter?");
          339  +		return TCL_ERROR;
          340  +	    } else if (3 == argc) {
          341  +		if (tclrl_custom_completer)
          342  +		    FREE(tclrl_custom_completer);
          343  +		if (!blank_line(argv[2]))
          344  +		    tclrl_custom_completer = stripwhite(strdup(argv[2]));
          345  +	    }
          346  +	    Tcl_AppendResult(interp, tclrl_custom_completer, (char*) NULL);
          347  +	    break;
          348  +
          349  +	case TCLRL_BUILTINCOMPLETER:
          350  +	    if (argc > 3) {
          351  +		Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
          352  +		return TCL_ERROR;
          353  +	    } else if (3 == argc) {
          354  +		int bool = tclrl_use_builtin_completer;
          355  +		if (TCL_OK != Tcl_GetBoolean(interp, argv[2], &bool)) {
          356  +		    Tcl_AppendResult(interp,
          357  +			"wrong # args: should be a boolean value.",
          358  +			(char*) NULL);
          359  +		    return TCL_ERROR;
          360  +		} else {
          361  +		    tclrl_use_builtin_completer = bool;
          362  +		}
          363  +	    }
          364  +	    Tcl_AppendResult(interp, tclrl_use_builtin_completer ? "1" : "0",
          365  +		(char*) NULL);
          366  +	    break;
          367  +
          368  +	case TCLRL_EOFCHAR:
          369  +	    if (argc > 3) {
          370  +		Tcl_WrongNumArgs(interp, 2, objv, "?script?");
          371  +		return TCL_ERROR;
          372  +	    } else if (3 == argc) {
          373  +		if (tclrl_eof_string)
          374  +		    FREE(tclrl_eof_string);
          375  +		if (!blank_line(argv[2]))
          376  +		    tclrl_eof_string = stripwhite(strdup(argv[2]));
          377  +	    }
          378  +	    Tcl_AppendResult(interp, tclrl_eof_string, (char*) NULL);
          379  +	    break;
          380  +
          381  +	case TCLRL_RESET_TERMINAL:
          382  +	    /* TODO: add this to the completer */
          383  +	    if (argc > 3) {
          384  +		Tcl_WrongNumArgs(interp, 2, objv, "?terminal-name?");
          385  +		return TCL_ERROR;
          386  +	    }
          387  +	    if (3 == argc) {
          388  +		/*
          389  +		 * - tcl8.0 doesn't have Tcl_GetString()
          390  +		 * - rl_reset_terminal() might be defined
          391  +		 *   to take no arguments. This might produce
          392  +		 *   a compiler warning.
          393  +		 */
          394  +		rl_reset_terminal(Tcl_GetStringFromObj(objv[2], (int*) NULL));
   395    395   #ifdef CLEANUP_AFER_SIGNAL
   396         -            } else {
   397         -				rl_cleanup_after_signal();
          396  +	    } else {
          397  +		rl_cleanup_after_signal();
   398    398   #endif
   399         -			}
   400         -            break;
          399  +	    }
          400  +	    break;
   401    401   
   402         -        case TCLRL_BELL:
   403         -			/*
   404         -			 * ring the terminal bell obeying the current
   405         -			 * settings -- audible or visible.
   406         -			 */
   407         -			ding();
   408         -			break;
          402  +	case TCLRL_BELL:
          403  +	    /*
          404  +	     * ring the terminal bell obeying the current
          405  +	     * settings -- audible or visible.
          406  +	     */
          407  +	    ding();
          408  +	    break;
   409    409   
   410         -        default:
   411         -            goto BAD_COMMAND;
   412         -            /* NOTREACHED */
   413         -            break;
          410  +	default:
          411  +	    goto BAD_COMMAND;
          412  +	    /* NOTREACHED */
          413  +	    break;
   414    414       }
   415    415   
   416    416       return TCL_OK;
   417    417   
   418    418   BAD_COMMAND:
   419    419       Tcl_AppendResult(interp,
   420         -        "wrong # args: should be \"readline option ?arg ...?\"",
   421         -        (char*) NULL);
          420  +	"wrong # args: should be \"readline option ?arg ...?\"",
          421  +	(char*) NULL);
   422    422       return TCL_ERROR;
   423    423   
   424    424   }
   425    425   
   426    426   void
   427    427   TclReadlineReadHandler(ClientData clientData, int mask)
   428    428   {
   429    429       if (mask & TCL_READABLE) {
   430    430   #ifdef EXECUTING_MACRO_HACK
   431         -        do {
          431  +	do {
   432    432   #endif
   433         -            rl_callback_read_char();
          433  +	    rl_callback_read_char();
   434    434   #ifdef EXECUTING_MACRO_HACK
   435         -            /**
   436         -             * check, if we're inside a macro and
   437         -             * if so, read all macro characters
   438         -             * until the next eol.
   439         -             */
   440         -        } while (_rl_executing_macro && !TclReadlineLineComplete());
          435  +	    /**
          436  +	     * check, if we're inside a macro and
          437  +	     * if so, read all macro characters
          438  +	     * until the next eol.
          439  +	     */
          440  +	} while (_rl_executing_macro && !TclReadlineLineComplete());
   441    441   #endif
   442    442       }
   443    443   }
   444    444   
   445    445   void
   446    446   TclReadlineLineCompleteHandler(char* ptr)
   447    447   {
   448    448       if (!ptr) { /* <c-d> */
   449    449   
   450         -        TclReadlineTerminate(LINE_EOF);
          450  +	TclReadlineTerminate(LINE_EOF);
   451    451   
   452    452       } else {
   453    453   
   454         -        /**
   455         -         * From version 0.9.3 upwards, all lines are
   456         -         * returned, even empty lines. (Only non-empty
   457         -         * lines are stuffed in readline's history.)
   458         -         * The calling script is responsible for handling
   459         -         * empty strings.
   460         -         */
          454  +	/**
          455  +	 * From version 0.9.3 upwards, all lines are
          456  +	 * returned, even empty lines. (Only non-empty
          457  +	 * lines are stuffed in readline's history.)
          458  +	 * The calling script is responsible for handling
          459  +	 * empty strings.
          460  +	 */
   461    461   
   462         -        char* expansion = (char*) NULL;
   463         -        int status = history_expand(ptr, &expansion);
          462  +	char* expansion = (char*) NULL;
          463  +	int status = history_expand(ptr, &expansion);
   464    464   
   465         -        if (status >= 1) {
          465  +	if (status >= 1) {
   466    466   #if 0
   467         -            Tcl_Channel channel = Tcl_MakeFileChannel(stdout, TCL_WRITABLE);
   468         -            /* Tcl_RegisterChannel(interp, channel); */
   469         -            (void) Tcl_WriteChars(channel, expansion, -1);
   470         -            Tcl_Flush(channel);
   471         -            Tcl_Close(interp, channel);
          467  +	    Tcl_Channel channel = Tcl_MakeFileChannel(stdout, TCL_WRITABLE);
          468  +	    /* Tcl_RegisterChannel(interp, channel); */
          469  +	    (void) Tcl_WriteChars(channel, expansion, -1);
          470  +	    Tcl_Flush(channel);
          471  +	    Tcl_Close(interp, channel);
   472    472   #else
   473         -            /* TODO: make this a valid tcl output */
   474         -            printf("%s\n", expansion);
          473  +	    /* TODO: make this a valid tcl output */
          474  +	    printf("%s\n", expansion);
   475    475   #endif
   476         -        } else if (-1 == status) {
   477         -            Tcl_AppendResult
   478         -                (tclrl_interp, "error in history expansion\n", (char*) NULL);
   479         -            TclReadlineTerminate(TCL_ERROR);
   480         -        }
   481         -        /**
   482         -         * TODO: status == 2 ...
   483         -         */
          476  +	} else if (-1 == status) {
          477  +	    Tcl_AppendResult
          478  +	    (tclrl_interp, "error in history expansion\n", (char*) NULL);
          479  +	    TclReadlineTerminate(TCL_ERROR);
          480  +	}
          481  +	/**
          482  +	 * TODO: status == 2 ...
          483  +	 */
   484    484   
   485         -        Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
          485  +	Tcl_AppendResult(tclrl_interp, expansion, (char*) NULL);
   486    486   
   487    487   #ifdef EXECUTING_MACRO_HACK
   488         -        /**
   489         -         * don't stuff macro lines
   490         -         * into readline's history.
   491         -         */
   492         -        if(!_rl_executing_macro) {
          488  +	/**
          489  +	 * don't stuff macro lines
          490  +	 * into readline's history.
          491  +	 */
          492  +	if(!_rl_executing_macro) {
   493    493   #endif
   494         -            /**
   495         -             * don't stuff empty lines
   496         -             * into readline's history.
   497         -             * don't stuff twice the same
   498         -             * line into readline's history.
   499         -             */
   500         -            if (expansion && *expansion && (!tclrl_last_line ||
   501         -                strcmp(tclrl_last_line, expansion))) {
   502         -                add_history(expansion);
   503         -            }
   504         -            if (tclrl_last_line)
   505         -                free(tclrl_last_line);
   506         -            tclrl_last_line = strdup(expansion);
          494  +	    /**
          495  +	     * don't stuff empty lines
          496  +	     * into readline's history.
          497  +	     * don't stuff twice the same
          498  +	     * line into readline's history.
          499  +	     */
          500  +	    if (expansion && *expansion && (!tclrl_last_line ||
          501  +		    strcmp(tclrl_last_line, expansion))) {
          502  +		add_history(expansion);
          503  +	    }
          504  +	    if (tclrl_last_line)
          505  +		free(tclrl_last_line);
          506  +	    tclrl_last_line = strdup(expansion);
   507    507   #ifdef EXECUTING_MACRO_HACK
   508         -        }
          508  +	}
   509    509   #endif
   510         -        /**
   511         -         * tell the calling routines to terminate.
   512         -         */
   513         -        TclReadlineTerminate(LINE_COMPLETE);
   514         -        FREE(ptr);
   515         -        FREE(expansion);
          510  +	/**
          511  +	 * tell the calling routines to terminate.
          512  +	 */
          513  +	TclReadlineTerminate(LINE_COMPLETE);
          514  +	FREE(ptr);
          515  +	FREE(expansion);
   516    516       }
   517    517   }
   518    518   
   519    519   int
   520    520   Tclreadline_SafeInit(Tcl_Interp *interp)
   521    521   {
   522    522       return Tclreadline_Init(interp);
................................................................................
   523    523   }
   524    524   
   525    525   int
   526    526   Tclreadline_Init(Tcl_Interp *interp)
   527    527   {
   528    528       int status;
   529    529       Tcl_CreateCommand(interp, "::tclreadline::readline", TclReadlineCmd,
   530         -	    (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
          530  +	(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
   531    531       tclrl_interp = interp;
   532    532       if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::historyLength",
   533         -                (char*) &tclrl_history_length, TCL_LINK_INT)))
   534         -        return status;
          533  +		(char*) &tclrl_history_length, TCL_LINK_INT)))
          534  +	return status;
   535    535       if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::library",
   536         -         (char*) &TCLRL_LIBRARY, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   537         -        return status;
          536  +		(char*) &TCLRL_LIBRARY, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          537  +	return status;
   538    538       if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::version",
   539         -         (char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   540         -        return status;
          539  +		(char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          540  +	return status;
   541    541       if (TCL_OK != (status = Tcl_LinkVar(interp, "::tclreadline::patchLevel",
   542         -         (char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   543         -        return status;
          542  +		(char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          543  +	return status;
   544    544       if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_library",
   545         -         (char*) &TCLRL_LIBRARY, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   546         -        return status;
          545  +		(char*) &TCLRL_LIBRARY, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          546  +	return status;
   547    547       if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_version",
   548         -         (char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   549         -        return status;
          548  +		(char*) &TCLRL_VERSION, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          549  +	return status;
   550    550       if (TCL_OK != (status = Tcl_LinkVar(interp, "tclreadline_patchLevel",
   551         -         (char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
   552         -        return status;
          551  +		(char*) &TCLRL_PATCHLEVEL, TCL_LINK_STRING | TCL_LINK_READ_ONLY)))
          552  +	return status;
   553    553       return Tcl_PkgProvide(interp, "tclreadline", TCLRL_VERSION);
   554    554   }
   555    555   
   556    556   int
   557    557   TclReadlineInitialize(Tcl_Interp* interp, char* historyfile)
   558    558   {
   559    559       rl_readline_name = "tclreadline";
................................................................................
   573    573       /* besser (11. Sept) 3. (removed }) */
   574    574       rl_basic_word_break_characters = " \t\n\\@$=;|&[]";
   575    575   #if 0
   576    576       rl_basic_quote_characters = "\"{"; /* XXX ??? XXX */
   577    577       rl_completer_quote_characters = "\"";
   578    578   #endif
   579    579       /*
   580         -    rl_filename_quote_characters
   581         -    = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
          580  +       rl_filename_quote_characters
          581  +       = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   582    582   
   583         -    rl_filename_quoting_function
   584         -        = (CPFunction*) TclReadlineFilenameQuotingFunction;
   585         -    */
          583  +       rl_filename_quoting_function
          584  +       = (CPFunction*) TclReadlineFilenameQuotingFunction;
          585  +     */
   586    586       /*
   587         -    rl_filename_quoting_desired = 1;
   588         -    */
          587  +       rl_filename_quoting_desired = 1;
          588  +     */
   589    589   
   590    590       using_history();
   591    591       if (!tclrl_eof_string)
   592         -        tclrl_eof_string = strdup("puts {}; exit");
          592  +	tclrl_eof_string = strdup("puts {}; exit");
   593    593   
   594    594       /*
   595    595        * try to read historyfile in home
   596    596        * directory. If this failes, this
   597    597        * is *not* an error.
   598    598        */
   599    599       rl_attempted_completion_function = (CPPFunction *) TclReadlineCompletion;
   600    600       if (read_history(historyfile)) {
   601         -        if (write_history(historyfile)) {
   602         -            Tcl_AppendResult (interp, "warning: `",
   603         -                historyfile, "' is not writable.", (char*) NULL);
   604         -        }
          601  +	if (write_history(historyfile)) {
          602  +	    Tcl_AppendResult (interp, "warning: `",
          603  +		historyfile, "' is not writable.", (char*) NULL);
          604  +	}
   605    605       }
   606    606       return TCL_OK;
   607    607   }
   608    608   
   609    609   int
   610    610   blank_line(char* str)
   611    611   {
   612    612       char* ptr;
   613    613       for (ptr = str; ptr && *ptr; ptr++) {
   614         -        if (!ISWHITE(*ptr))
   615         -            return 0;
          614  +	if (!ISWHITE(*ptr))
          615  +	    return 0;
   616    616       }
   617    617       return 1;
   618    618   }
   619    619   
   620    620   char**
   621    621   TclReadlineCompletion(char* text, int start, int end)
   622    622   {
   623    623       char** matches = (char**) NULL;
   624    624       int status;
   625    625       rl_completion_append_character = ' '; /* reset, just in case ... */
   626    626   
   627    627       if (text && ('!' == text[0]
   628         -            || (start && rl_line_buffer[start - 1] == '!' /* for '$' */))) {
   629         -        char* expansion = (char*) NULL;
   630         -        int oldlen = strlen(rl_line_buffer);
   631         -        status = history_expand(rl_line_buffer, &expansion);
   632         -        if (status >= 1) {
   633         -            rl_extend_line_buffer(strlen(expansion) + 1);
   634         -            strcpy(rl_line_buffer, expansion);
   635         -            rl_end = strlen(expansion);
   636         -            rl_point += strlen(expansion) - oldlen;
   637         -            FREE(expansion);
   638         -            /*
   639         -             * TODO:
   640         -             * because we return 0 == matches,
   641         -             * the filename completer will still beep.
   642         -            rl_inhibit_completion = 1;
   643         -             */
   644         -            return matches;
   645         -        }
   646         -        FREE(expansion);
          628  +	    || (start && rl_line_buffer[start - 1] == '!' /* for '$' */))) {
          629  +	char* expansion = (char*) NULL;
          630  +	int oldlen = strlen(rl_line_buffer);
          631  +	status = history_expand(rl_line_buffer, &expansion);
          632  +	if (status >= 1) {
          633  +	    rl_extend_line_buffer(strlen(expansion) + 1);
          634  +	    strcpy(rl_line_buffer, expansion);
          635  +	    rl_end = strlen(expansion);
          636  +	    rl_point += strlen(expansion) - oldlen;
          637  +	    FREE(expansion);
          638  +	    /*
          639  +	     * TODO:
          640  +	     * because we return 0 == matches,
          641  +	     * the filename completer will still beep.
          642  +	     rl_inhibit_completion = 1;
          643  +	     */
          644  +	    return matches;
          645  +	}
          646  +	FREE(expansion);
   647    647       }
   648    648   
   649    649       if (tclrl_custom_completer) {
   650         -        char start_s[BUFSIZ], end_s[BUFSIZ];
   651         -        Tcl_Obj* obj;
   652         -        Tcl_Obj** objv;
   653         -        int objc;
   654         -        int state;
   655         -        char* quoted_text = TclReadlineQuote(text, "$[]{}\"");
   656         -        char* quoted_rl_line_buffer
   657         -            = TclReadlineQuote(rl_line_buffer, "$[]{}\"");
   658         -        sprintf(start_s, "%d", start);
   659         -        sprintf(end_s, "%d", end);
   660         -        Tcl_ResetResult(tclrl_interp); /* clear result space */
   661         -        state = Tcl_VarEval(tclrl_interp, tclrl_custom_completer,
   662         -            " \"", quoted_text, "\" ", start_s, " ", end_s,
   663         -            " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
   664         -        FREE(quoted_text);
   665         -        FREE(quoted_rl_line_buffer);
   666         -        if (TCL_OK != state) {
   667         -            Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
   668         -                " \"", quoted_text, "\" ", start_s, " ", end_s,
   669         -                " \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
   670         -            TclReadlineTerminate(state);
   671         -            return matches;
   672         -        }
   673         -        obj = Tcl_GetObjResult(tclrl_interp);
   674         -        status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
   675         -        if (TCL_OK != status)
   676         -            return matches;
   677         -
   678         -        if (objc) {
   679         -            int i, length;
   680         -            matches = (char**) MALLOC(sizeof(char*) * (objc + 1));
   681         -            for (i = 0; i < objc; i++) {
   682         -                matches[i] = strdup(Tcl_GetStringFromObj(objv[i], &length));
   683         -                if (1 == objc && !strlen(matches[i])) {
   684         -                    FREE(matches[i]);
   685         -                    FREE(matches);
   686         -                    Tcl_ResetResult(tclrl_interp); /* clear result space */
   687         -                    return (char**) NULL;
   688         -                }
   689         -            }
   690         -
   691         -            /**
   692         -             * this is a special one:
   693         -             * if the script returns exactly two arguments
   694         -             * and the second argument is the empty string,
   695         -             * the rl_completion_append_character is set
   696         -             * temporaryly to NULL.
   697         -             */
   698         -            if (2 == objc && !strlen(matches[1])) {
   699         -                i--;
   700         -                FREE(matches[1]);
   701         -                rl_completion_append_character = '\0';
   702         -            }
   703         -
   704         -            matches[i] = (char*) NULL; /* terminate */
   705         -        }
   706         -        Tcl_ResetResult(tclrl_interp); /* clear result space */
          650  +	char start_s[BUFSIZ], end_s[BUFSIZ];
          651  +	Tcl_Obj* obj;
          652  +	Tcl_Obj** objv;
          653  +	int objc;
          654  +	int state;
          655  +	char* quoted_text = TclReadlineQuote(text, "$[]{}\"");
          656  +	char* quoted_rl_line_buffer
          657  +	= TclReadlineQuote(rl_line_buffer, "$[]{}\"");
          658  +	sprintf(start_s, "%d", start);
          659  +	sprintf(end_s, "%d", end);
          660  +	Tcl_ResetResult(tclrl_interp); /* clear result space */
          661  +	state = Tcl_VarEval(tclrl_interp, tclrl_custom_completer,
          662  +	    " \"", quoted_text, "\" ", start_s, " ", end_s,
          663  +	    " \"", quoted_rl_line_buffer, "\"", (char*) NULL);
          664  +	FREE(quoted_text);
          665  +	FREE(quoted_rl_line_buffer);
          666  +	if (TCL_OK != state) {
          667  +	    Tcl_AppendResult (tclrl_interp, " `", tclrl_custom_completer,
          668  +		" \"", quoted_text, "\" ", start_s, " ", end_s,
          669  +		" \"", quoted_rl_line_buffer, "\"' failed.", (char*) NULL);
          670  +	    TclReadlineTerminate(state);
          671  +	    return matches;
          672  +	}
          673  +	obj = Tcl_GetObjResult(tclrl_interp);
          674  +	status = Tcl_ListObjGetElements(tclrl_interp, obj, &objc, &objv);
          675  +	if (TCL_OK != status)
          676  +	    return matches;
          677  +
          678  +	if (objc) {
          679  +	    int i, length;
          680  +	    matches = (char**) MALLOC(sizeof(char*) * (objc + 1));
          681  +	    for (i = 0; i < objc; i++) {
          682  +		matches[i] = strdup(Tcl_GetStringFromObj(objv[i], &length));
          683  +		if (1 == objc && !strlen(matches[i])) {
          684  +		    FREE(matches[i]);
          685  +		    FREE(matches);
          686  +		    Tcl_ResetResult(tclrl_interp); /* clear result space */
          687  +		    return (char**) NULL;
          688  +		}
          689  +	    }
          690  +
          691  +	    /**
          692  +	     * this is a special one:
          693  +	     * if the script returns exactly two arguments
          694  +	     * and the second argument is the empty string,
          695  +	     * the rl_completion_append_character is set
          696  +	     * temporaryly to NULL.
          697  +	     */
          698  +	    if (2 == objc && !strlen(matches[1])) {
          699  +		i--;
          700  +		FREE(matches[1]);
          701  +		rl_completion_append_character = '\0';
          702  +	    }
          703  +
          704  +	    matches[i] = (char*) NULL; /* terminate */
          705  +	}
          706  +	Tcl_ResetResult(tclrl_interp); /* clear result space */
   707    707       }
   708    708   
   709    709       if (!matches && tclrl_use_builtin_completer) {
   710         -        matches = completion_matches(text, TclReadline0generator);
          710  +	matches = completion_matches(text, TclReadline0generator);
   711    711       }
   712         -    
          712  +
   713    713       return matches;
   714    714   }
   715    715   
   716    716   char*
   717    717   TclReadline0generator(char* text, int state)
   718    718   {
   719    719       return TclReadlineKnownCommands(text, state, _CMD_GET);
................................................................................
   728    728       char* args[256];
   729    729       int i, argc;
   730    730       char** name;
   731    731   
   732    732       char* local_line = (char*) NULL;
   733    733       int sub;
   734    734   
   735         -    
          735  +
   736    736       switch (mode) {
   737         -        
   738         -        case _CMD_SET:
   739         -
   740         -            new = (cmds_t *) MALLOC(sizeof(cmds_t));
   741         -            new->next = (cmds_t *) NULL;
   742         -
   743         -            if (!cmds) {
   744         -                cmds = new;
   745         -                cmds->prev = new;
   746         -            }
   747         -            else {
   748         -                cmds->prev->next = new;
   749         -                cmds->prev = new;
   750         -            }
          737  +
          738  +	case _CMD_SET:
          739  +
          740  +	    new = (cmds_t *) MALLOC(sizeof(cmds_t));
          741  +	    new->next = (cmds_t *) NULL;
          742  +
          743  +	    if (!cmds) {
          744  +		cmds = new;
          745  +		cmds->prev = new;
          746  +	    }
          747  +	    else {
          748  +		cmds->prev->next = new;
          749  +		cmds->prev = new;
          750  +	    }
          751  +
          752  +	    tmp = strdup(text);
          753  +	    argc = TclReadlineParse(args, sizeof(args), tmp);
          754  +
          755  +	    new->cmd = (char**) MALLOC(sizeof(char*) * (argc + 1));
          756  +
          757  +	    for (i = 0; i < argc; i++)
          758  +		new->cmd[i] = args[i];
          759  +
          760  +	    new->cmd[argc] = (char*) NULL;
          761  +
          762  +	    return (char*) NULL;
          763  +	    break;
          764  +
          765  +
          766  +	case _CMD_GET:
          767  +
          768  +	    local_line = strdup(rl_line_buffer);
          769  +	    sub = TclReadlineParse(args, sizeof(args), local_line);
          770  +
          771  +	    if (0 == sub || (1 == sub && '\0' != text[0])) {
          772  +		if (!state) {
          773  +		    new = cmds;
          774  +		    len = strlen(text);
          775  +		}
          776  +		while (new && (name = new->cmd)) {
          777  +		    new = new->next;
          778  +		    if (!strncmp(name[0], text, len))
          779  +			return strdup(name[0]);
          780  +		}
          781  +		return (char*) NULL;
          782  +	    } else {
          783  +
          784  +		if (!state) {
          785  +
          786  +		    new = cmds;
          787  +		    len = strlen(text);
          788  +
          789  +		    while (new && (name = new->cmd)) {
          790  +			if (!strcmp(name[0], args[0]))
          791  +			    break;
          792  +			new = new->next;
          793  +		    }
          794  +
          795  +		    if (!new)
          796  +			return (char*) NULL;
          797  +
          798  +		    for (i = 0; new->cmd[i]; i++) /* EMPTY */;
   751    799   
   752         -            tmp = strdup(text);
   753         -            argc = TclReadlineParse(args, sizeof(args), tmp);
   754         -
   755         -            new->cmd = (char**) MALLOC(sizeof(char*) * (argc + 1));
   756         -
   757         -            for (i = 0; i < argc; i++)
   758         -                new->cmd[i] = args[i];
   759         -
   760         -            new->cmd[argc] = (char*) NULL;
          800  +		    if (sub < i && !strncmp(new->cmd[sub], text, len))
          801  +			return strdup(new->cmd[sub]);
          802  +		    else
          803  +			return (char*) NULL;
   761    804   
   762         -            return (char*) NULL;
   763         -            break;
   764         -
   765         -
   766         -        case _CMD_GET:
   767         -
   768         -            local_line = strdup(rl_line_buffer);
   769         -            sub = TclReadlineParse(args, sizeof(args), local_line);
   770         -
   771         -            if (0 == sub || (1 == sub && '\0' != text[0])) {
   772         -                if (!state) {
   773         -                    new = cmds;
   774         -                    len = strlen(text);
   775         -                }
   776         -                while (new && (name = new->cmd)) {
   777         -                    new = new->next;
   778         -                    if (!strncmp(name[0], text, len))
   779         -                        return strdup(name[0]);
   780         -                }
   781         -                return (char*) NULL;
   782         -            } else {
          805  +		}
          806  +		else
          807  +		    return (char*) NULL;
   783    808   
   784         -                if (!state) {
   785         -
   786         -                    new = cmds;
   787         -                    len = strlen(text);
   788         -
   789         -                    while (new && (name = new->cmd)) {
   790         -                        if (!strcmp(name[0], args[0]))
   791         -                            break;
   792         -                        new = new->next;
   793         -                    }
   794         -
   795         -                    if (!new)
   796         -                        return (char*) NULL;
   797         -
   798         -                    for (i = 0; new->cmd[i]; i++) /* EMPTY */;
   799         -
   800         -                    if (sub < i && !strncmp(new->cmd[sub], text, len))
   801         -                        return strdup(new->cmd[sub]);
   802         -                    else
   803         -                        return (char*) NULL;
   804         -
   805         -                }
   806         -                else
   807         -                    return (char*) NULL;
   808         -
   809         -                /* NOTREACHED */
   810         -                break;
   811         -            }
          809  +		/* NOTREACHED */
          810  +		break;
          811  +	    }
   812    812   
   813    813   
   814         -        default:
   815         -            return (char*) NULL;
   816         -            break;
          814  +	default:
          815  +	    return (char*) NULL;
          816  +	    break;
   817    817   
   818    818       }
   819    819       /* NOTREACHED */
   820    820   }
   821    821   
   822    822   int
   823    823   TclReadlineParse(char** args, int maxargs, char* buf)
   824    824   {
   825    825       int nr = 0;
   826    826   
   827    827       while (*buf != '\0' && nr < maxargs) {
   828         -        /*
   829         -         * Strip whitespace.  Use nulls, so
   830         -         * that the previous argument is terminated
   831         -         * automatically.
   832         -         */
   833         -        while (ISWHITE(*buf))
   834         -            *buf++ = '\0';
          828  +	/*
          829  +	 * Strip whitespace.  Use nulls, so
          830  +	 * that the previous argument is terminated
          831  +	 * automatically.
          832  +	 */
          833  +	while (ISWHITE(*buf))
          834  +	    *buf++ = '\0';
          835  +
          836  +	if (!(*buf)) /* don't count the terminating NULL */
          837  +	    break;
   835    838   
   836         -        if (!(*buf)) /* don't count the terminating NULL */
   837         -            break;
          839  +	*args++ = buf;
          840  +	nr++;
   838    841   
   839         -        *args++ = buf;
   840         -        nr++;
   841         -
   842         -        while (('\0' != *buf) && !ISWHITE(*buf))
   843         -            buf++;
          842  +	while (('\0' != *buf) && !ISWHITE(*buf))
          843  +	    buf++;
   844    844       }
   845    845   
   846    846       *args = '\0';
   847    847       return nr;
   848    848   }

Modified tclreadline.h.in from [1247b0d625] to [0527d1c60d].

     1      1   
     2      2    /* ==================================================================
     3      3      
     4         -    FILE: "/diska/home/joze/src/tclreadline/tclreadline.h.in"
     5         -    LAST MODIFICATION: "Mon Sep 13 17:52:25 1999 (joze)"
     6         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            4  +    FILE: "/home/joze/src/tclreadline/tclreadline.h.in"
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 21:13:36 +0100 (joze)"
            6  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       vim:set ft=c:
     9      9       ---
    10     10   
    11     11       tclreadline -- gnu readline for tcl
    12         -    Copyright (C) 1999  Johannes Zellner
           12  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    13     13   
    14     14       This program is free software; you can redistribute it and/or
    15     15       modify it under the terms of the GNU General Public License
    16     16       as published by the Free Software Foundation; either version 2
    17     17       of the License, or (at your option) any later version.
    18     18   
    19     19       This program is distributed in the hope that it will be useful,

Modified tclreadline.n.in from [2f89485eaa] to [f0bff91a9a].

     1      1   .TH tclreadline n "@TCLREADLINE_VERSION@.@TCLREADLINE_PATCHLEVEL@" "Johannes Zellner"
     2      2   
     3         -.\" (C) 1999 by Johannes Zellner
     4      3   .\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
     5         -.\" LAST MODIFICATION: "Tue Sep 21 21:18:31 1999 (joze)"
     6         -.\" (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            4  +.\" LAST MODIFICATION: "Thu, 23 Mar 2000 21:14:10 +0100 (joze)"
            5  +.\" (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      6   .\" $Id$
     8      7   .\" ---
     9      8   .\"
    10      9   .\" tclreadline -- gnu readline for the tcl scripting language
    11         -.\" Copyright (C) 1999  Johannes Zellner
           10  +.\" Copyright (C) 1998 - 2000 by Johannes Zellner
    12     11   .\"
    13     12   .\" This program is free software; you can redistribute it and/or
    14     13   .\" modify it under the terms of the GNU General Public License
    15     14   .\" as published by the Free Software Foundation; either version 2
    16     15   .\" of the License, or (at your option) any later version.
    17     16   .\"
    18     17   .\" This program is distributed in the hope that it will be useful,

Modified tclreadlineCompleter.tcl from [9f80a18e5f] to [cba8646974].

     1      1   # -*- tclsh -*-
     2         -# FILE: "/disk01/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
     3         -# LAST MODIFICATION: "Thu Sep 30 16:43:34 1999 (joze)"
     4         -# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            2  +# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 22:38:08 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
            6  +# vim:set ts=4:
     6      7   # ---
     7      8   #
     8      9   # tclreadline -- gnu readline for tcl
     9         -# Copyright (C) 1999  Johannes Zellner
           10  +# Copyright (C) 1998 - 2000 by Johannes Zellner
    10     11   #
    11     12   # This program is free software; you can redistribute it and/or
    12     13   # modify it under the terms of the GNU General Public License
    13     14   # as published by the Free Software Foundation; either version 2
    14     15   # of the License, or (at your option) any later version.
    15     16   #
    16     17   # This program is distributed in the hope that it will be useful,

Modified tclreadlineConfig.sh.in from [59c0d36366] to [b25a7cb537].

     1      1   #!/bin/sh
     2         -# FILE: "/diska/home/joze/src/tclreadline/tclreadlineConfig.sh.in"
     3         -# LAST MODIFICATION: "Wed Aug 25 16:23:10 1999 (joze)"
     4         -# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            2  +# FILE: "/home/joze/src/tclreadline/tclreadlineConfig.sh.in"
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 21:14:52 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9         -# Copyright (C) 1999  Johannes Zellner
            9  +# Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   #
    11     11   # This program is free software; you can redistribute it and/or
    12     12   # modify it under the terms of the GNU General Public License
    13     13   # as published by the Free Software Foundation; either version 2
    14     14   # of the License, or (at your option) any later version.
    15     15   #
    16     16   # This program is distributed in the hope that it will be useful,

Modified tclreadlineInit.tcl.in from [a9533293b7] to [6693f8adfc].

     1      1   #!/usr/local/bin/tclsh
     2      2   # FILE: "/home/joze/src/tclreadline/tclreadlineInit.tcl.in"
     3         -# LAST MODIFICATION: "Thu Dec 16 21:44:31 1999 (joze)"
     4         -# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 22:36:01 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9         -# Copyright (C) 1999  Johannes Zellner
            9  +# Copyright (C) 1998 - 2000 Johannes Zellner
    10     10   #
    11     11   # This program is free software; you can redistribute it and/or
    12     12   # modify it under the terms of the GNU General Public License
    13     13   # as published by the Free Software Foundation; either version 2
    14     14   # of the License, or (at your option) any later version.
    15     15   #
    16     16   # This program is distributed in the hope that it will be useful,
................................................................................
    26     26   # http://www.zellner.org/tclreadline/
    27     27   #
    28     28   # ================================================================== 
    29     29   
    30     30   package provide tclreadline @TCLREADLINE_VERSION@
    31     31   
    32     32   namespace eval tclreadline:: {
    33         -	namespace export Init
           33  +    namespace export Init
    34     34   }
    35     35   
    36     36   proc ::tclreadline::Init {} {
    37     37       uplevel #0 {
    38     38   	if ![info exists tclreadline::library] {
    39         -	    if [catch {load /usr/lib/tclreadline1.0/libtclreadline1.0.so} msg] {
           39  +	    if [catch {load @TCLREADLINE_LIBRARY@/@TCLREADLINE_LIB_FILE@} msg] {
    40     40   		puts stderr $msg
    41     41   		exit 2
    42     42   	    }
    43     43   	}
    44     44       }
    45     45   }
    46     46   

Modified tclreadlineSetup.tcl.in from [e794a68b50] to [cb14d0e407].

     1      1   #!/usr/locanl/bin/tclsh
     2      2   # FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
     3         -# LAST MODIFICATION: "Mon Sep 20 01:34:31 1999 (joze)"
     4         -# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            3  +# LAST MODIFICATION: "Thu, 23 Mar 2000 22:45:43 +0100 (joze)"
            4  +# (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9         -# Copyright (C) 1999  Johannes Zellner
            9  +# Copyright (C) 1998 - 2000 by Johannes Zellner
    10     10   #
    11     11   # This program is free software; you can redistribute it and/or
    12     12   # modify it under the terms of the GNU General Public License
    13     13   # as published by the Free Software Foundation; either version 2
    14     14   # of the License, or (at your option) any later version.
    15     15   #
    16     16   # This program is distributed in the hope that it will be useful,
................................................................................
    28     28   # ================================================================== 
    29     29   
    30     30   
    31     31   package provide tclreadline @TCLREADLINE_VERSION@
    32     32   
    33     33   proc unknown args {
    34     34   
    35         -	global auto_noexec auto_noload env unknown_pending tcl_interactive
    36         -	global errorCode errorInfo
           35  +    global auto_noexec auto_noload env unknown_pending tcl_interactive
           36  +    global errorCode errorInfo
    37     37   
    38         -	# Save the values of errorCode and errorInfo variables, since they
    39         -	# may get modified if caught errors occur below.  The variables will
    40         -	# be restored just before re-executing the missing command.
           38  +    # Save the values of errorCode and errorInfo variables, since they
           39  +    # may get modified if caught errors occur below.  The variables will
           40  +    # be restored just before re-executing the missing command.
    41     41   
    42         -	set savedErrorCode $errorCode
    43         -	set savedErrorInfo $errorInfo
    44         -	set name [lindex $args 0]
    45         -	if ![info exists auto_noload] {
           42  +    set savedErrorCode $errorCode
           43  +    set savedErrorInfo $errorInfo
           44  +    set name [lindex $args 0]
           45  +    if ![info exists auto_noload] {
           46  +	#
           47  +	# Make sure we're not trying to load the same proc twice.
           48  +	#
           49  +	if [info exists unknown_pending($name)] {
           50  +	    return -code error "self-referential recursion in \"unknown\" for command \"$name\""
           51  +	}
           52  +	set unknown_pending($name) pending
           53  +	set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg]
           54  +	unset unknown_pending($name)
           55  +	if {$ret != 0} {
           56  +	    return -code $ret -errorcode $errorCode \
           57  +	    "error while autoloading \"$name\": $msg"
           58  +	}
           59  +	if ![array size unknown_pending] {
           60  +	    unset unknown_pending
           61  +	}
           62  +	if $msg {
           63  +	    set errorCode $savedErrorCode
           64  +	    set errorInfo $savedErrorInfo
           65  +	    set code [catch {uplevel 1 $args} msg]
           66  +	    if {$code ==  1} {
    46     67   		#
    47         -		# Make sure we're not trying to load the same proc twice.
           68  +		# Strip the last five lines off the error stack (they're
           69  +		    # from the "uplevel" command).
    48     70   		#
    49         -		if [info exists unknown_pending($name)] {
    50         -			return -code error "self-referential recursion in \"unknown\" for command \"$name\""
    51         -		}
    52         -		set unknown_pending($name) pending
    53         -		set ret [catch {auto_load $name [uplevel 1 {namespace current}]} msg]
    54         -		unset unknown_pending($name)
    55         -		if {$ret != 0} {
    56         -			return -code $ret -errorcode $errorCode \
    57         -				"error while autoloading \"$name\": $msg"
    58         -		}
    59         -		if ![array size unknown_pending] {
    60         -			unset unknown_pending
    61         -		}
    62         -		if $msg {
    63         -			set errorCode $savedErrorCode
    64         -			set errorInfo $savedErrorInfo
    65         -			set code [catch {uplevel 1 $args} msg]
    66         -			if {$code ==  1} {
    67         -				#
    68         -				# Strip the last five lines off the error stack (they're
    69         -				# from the "uplevel" command).
    70         -				#
    71         -
    72         -				set new [split $errorInfo \n]
    73         -				set new [join [lrange $new 0 [expr [llength $new] - 6]] \n]
    74         -				return -code error -errorcode $errorCode \
    75         -						-errorinfo $new $msg
    76         -			} else {
    77         -				return -code $code $msg
    78         -			}
    79         -		}
    80         -	}
    81         -
    82         -	# REMOVED THE [info script] TEST (joze, SEP 98)
    83         -	if {([info level] == 1) \
    84         -			&& [info exists tcl_interactive] && $tcl_interactive} {
    85         -		if ![info exists auto_noexec] {
    86         -			set new [auto_execok $name]
    87         -			if {$new != ""} {
    88         -				set errorCode $savedErrorCode
    89         -				set errorInfo $savedErrorInfo
    90         -				set redir ""
    91         -				if {[info commands console] == ""} {
    92         -					set redir ">&@stdout <@stdin"
    93         -				}
    94         -				# LOOK FOR GLOB STUFF IN $ARGS (joze, SEP 98)
    95         -				return [uplevel eval exec $redir $new \
    96         -					[::tclreadline::Glob [lrange $args 1 end]]]
    97         -			}
    98         -		}
           71  +
           72  +		set new [split $errorInfo \n]
           73  +		set new [join [lrange $new 0 [expr [llength $new] - 6]] \n]
           74  +		return -code error -errorcode $errorCode \
           75  +		-errorinfo $new $msg
           76  +	    } else {
           77  +		return -code $code $msg
           78  +	    }
           79  +	}
           80  +    }
           81  +
           82  +    # REMOVED THE [info script] TEST (joze, SEP 98)
           83  +    if {([info level] == 1) && [info exists tcl_interactive] && $tcl_interactive} {
           84  +	if ![info exists auto_noexec] {
           85  +	    set new [auto_execok $name]
           86  +	    if {$new != ""} {
    99     87   		set errorCode $savedErrorCode
   100     88   		set errorInfo $savedErrorInfo
   101         -		if {$name == "!!"} {
   102         -			set newcmd [history event]
   103         -		} elseif {[regexp {^!(.+)$} $name dummy event]} {
   104         -			set newcmd [history event $event]
   105         -		} elseif {[regexp {^\^([^^]*)\^([^^]*)\^?$} $name dummy old new]} {
   106         -			set newcmd [history event -1]
   107         -			catch {regsub -all -- $old $newcmd $new newcmd}
           89  +		set redir ""
           90  +		if {[info commands console] == ""} {
           91  +		    set redir ">&@stdout <@stdin"
   108     92   		}
   109         -		if [info exists newcmd] {
   110         -			tclLog $newcmd
   111         -			history change $newcmd 0
   112         -			return [uplevel $newcmd]
   113         -		}
   114         -
   115         -		set ret [catch {set cmds [info commands $name*]} msg]
   116         -		if {[string compare $name "::"] == 0} {
   117         -			set name ""
   118         -		}
   119         -		if {$ret != 0} {
   120         -			return -code $ret -errorcode $errorCode \
   121         -				"error in unknown while checking if \"$name\" is a unique command abbreviation: $msg"
   122         -		}
   123         -		if {[llength $cmds] == 1} {
   124         -			return [uplevel [lreplace $args 0 0 $cmds]]
   125         -		}
   126         -		if {[llength $cmds] != 0} {
   127         -			if {$name == ""} {
   128         -				return -code error "empty command name \"\""
   129         -			} else {
   130         -				return -code error \
   131         -						"ambiguous command name \"$name\": [lsort $cmds]"
   132         -			}
   133         -		}
           93  +		# LOOK FOR GLOB STUFF IN $ARGS (joze, SEP 98)
           94  +		return [uplevel eval exec $redir $new \
           95  +		[::tclreadline::Glob [lrange $args 1 end]]]
           96  +	    }
           97  +	}
           98  +	set errorCode $savedErrorCode
           99  +	set errorInfo $savedErrorInfo
          100  +	if {$name == "!!"} {
          101  +	    set newcmd [history event]
          102  +	} elseif {[regexp {^!(.+)$} $name dummy event]} {
          103  +	    set newcmd [history event $event]
          104  +	} elseif {[regexp {^\^([^^]*)\^([^^]*)\^?$} $name dummy old new]} {
          105  +	    set newcmd [history event -1]
          106  +	    catch {regsub -all -- $old $newcmd $new newcmd}
          107  +	}
          108  +	if [info exists newcmd] {
          109  +	    tclLog $newcmd
          110  +	    history change $newcmd 0
          111  +	    return [uplevel $newcmd]
          112  +	}
          113  +
          114  +	set ret [catch {set cmds [info commands $name*]} msg]
          115  +	if {[string compare $name "::"] == 0} {
          116  +	    set name ""
          117  +	}
          118  +	if {$ret != 0} {
          119  +	    return -code $ret -errorcode $errorCode \
          120  +	    "error in unknown while checking if \"$name\" is a unique command abbreviation: $msg"
          121  +	}
          122  +	if {[llength $cmds] == 1} {
          123  +	    return [uplevel [lreplace $args 0 0 $cmds]]
          124  +	}
          125  +	if {[llength $cmds] != 0} {
          126  +	    if {$name == ""} {
          127  +		return -code error "empty command name \"\""
          128  +	    } else {
          129  +		return -code error \
          130  +		"ambiguous command name \"$name\": [lsort $cmds]"
          131  +	    }
   134    132   	}
   135         -	return -code error "invalid command name \"$name\""
          133  +    }
          134  +    return -code error "invalid command name \"$name\""
   136    135   }
   137    136   
   138    137   namespace eval tclreadline {
   139    138   
   140    139   namespace export Setup Loop InitTclCmds InitTkCmds Print ls
   141    140   
   142    141   proc ls {args} {
................................................................................
   145    144   	} else {
   146    145   		eval exec ls -FC [Glob $args]
   147    146   	}
   148    147   }
   149    148   
   150    149   proc Setup {args} {
   151    150   
   152         -	uplevel #0 {
          151  +    uplevel #0 {
   153    152   
   154         -		if {"" == [info commands ::tclreadline::readline]} {
   155         -			::tclreadline::Init
          153  +	if {"" == [info commands ::tclreadline::readline]} {
          154  +	    ::tclreadline::Init
          155  +	}
          156  +
          157  +	if {[catch {set a [::tclreadline::prompt1]}] && [info nameofexecutable] != ""} {
          158  +
          159  +	    namespace eval ::tclreadline {
          160  +		variable prompt_string
          161  +		set base [file tail [info nameofexecutable]]
          162  +
          163  +		if {[string match tclsh* $base] && [info exists tcl_version]} {
          164  +		    set prompt_string \
          165  +		    "\[0;31mtclsh$tcl_version\[0m"
          166  +		} elseif {[string match wish* $base] \
          167  +		    && [info exists tk_version]} {
          168  +			set prompt_string "\[0;34mwish$tk_version\[0m"
          169  +		    } else {
          170  +			set prompt_string "\[0;31m$base\[0m"
          171  +		    }
          172  +
          173  +	    }
          174  +
          175  +	    if {"" == [info procs ::tclreadline::prompt1]} {
          176  +		proc ::tclreadline::prompt1 {} {
          177  +		    variable prompt_string
          178  +		    global env
          179  +		    if {[catch {set pwd [pwd]} tmp]} {
          180  +			set pwd "unable to get pwd"
          181  +		    }
          182  +
          183  +		    if [info exists env(HOME)] {
          184  +			regsub $env(HOME) $pwd "~" pwd
          185  +		    }
          186  +		    return "$prompt_string \[$pwd\]"
   156    187   		}
   157         -
   158         -		if {[catch {set a [::tclreadline::prompt1]}] \
   159         -			&& [info nameofexecutable] != ""} {
   160         -
   161         -			namespace eval ::tclreadline {
   162         -				variable prompt_string
   163         -				set base [file tail [info nameofexecutable]]
   164         -
   165         -				if {[string match tclsh* $base] && [info exists tcl_version]} {
   166         -					set prompt_string \
   167         -						"\[0;91mtclsh$tcl_version\[0m"
   168         -				} elseif {[string match wish* $base] \
   169         -					&& [info exists tk_version]} {
   170         -					set prompt_string "\[0;94mwish$tk_version\[0m"
   171         -				} else {
   172         -					set prompt_string "\[0;91m$base\[0m"
   173         -				}
   174         -
   175         -			}
   176         -
   177         -			if {"" == [info procs ::tclreadline::prompt1]} {
   178         -				proc ::tclreadline::prompt1 {} {
   179         -					variable prompt_string
   180         -					global env
   181         -					if {[catch {set pwd [pwd]} tmp]} {
   182         -						set pwd "unable to get pwd"
   183         -					}
   184         -
   185         -					if [info exists env(HOME)] {
   186         -						regsub $env(HOME) $pwd "~" pwd
   187         -					}
   188         -					return "$prompt_string \[$pwd\]"
   189         -				}
   190         -			}
   191         -			# puts body=[info body ::tclreadline::prompt1]
          188  +	    }
          189  +	    # puts body=[info body ::tclreadline::prompt1]
          190  +	}
          191  +
          192  +	if {"" == [info procs exit]} {
          193  +
          194  +	    catch {rename ::tclreadline::Exit ""}
          195  +	    rename exit ::tclreadline::Exit
          196  +
          197  +	    proc exit {args} {
          198  +
          199  +		if {[catch {
          200  +		    ::tclreadline::readline write \
          201  +		    [::tclreadline::HistoryFileGet]
          202  +		} ::tclreadline::errorMsg]} {
          203  +		    puts stderr $::tclreadline::errorMsg
   192    204   		}
   193    205   
   194         -		if {"" == [info procs exit]} {
          206  +		# this call is ignored, if tclreadline.c
          207  +		# was compiled with CLEANUP_AFER_SIGNAL
          208  +		# not defined. This is the case for
          209  +		# older versions of libreadline.
          210  +		#
          211  +		::tclreadline::readline reset-terminal
   195    212   
   196         -			catch {rename ::tclreadline::Exit ""}
   197         -			rename exit ::tclreadline::Exit
   198         -
   199         -			proc exit {args} {
   200         -
   201         -				if {[catch {
   202         -					::tclreadline::readline write \
   203         -					[::tclreadline::HistoryFileGet]
   204         -				} ::tclreadline::errorMsg]} {
   205         -					puts stderr $::tclreadline::errorMsg
   206         -				}
   207         -
   208         -				# this call is ignored, if tclreadline.c
   209         -				# was compiled with CLEANUP_AFER_SIGNAL
   210         -				# not defined. This is the case for
   211         -				# older versions of libreadline.
   212         -				#
   213         -				::tclreadline::readline reset-terminal
   214         -
   215         -				if [catch "eval ::tclreadline::Exit $args" message] {
   216         -					puts stderr "error:"
   217         -					puts stderr "$message"
   218         -				}
   219         -				# NOTREACHED
   220         -			}
          213  +		if [catch "eval ::tclreadline::Exit $args" message] {
          214  +		    puts stderr "error:"
          215  +		    puts stderr "$message"
   221    216   		}
          217  +		# NOTREACHED
          218  +	    }
          219  +	}
   222    220   
          221  +    }
          222  +
          223  +    global env
          224  +    variable historyfile
          225  +
          226  +    if {[string trim [llength ${args}]]} {
          227  +	set historyfile ""
          228  +	catch {
          229  +	    set historyfile [file nativename [lindex ${args} 0]]
          230  +	}
          231  +	if {"" == [string trim $historyfile]} {
          232  +	    set historyfile [lindex ${args} 0]
   223    233   	}
   224         -
   225         -	global env
   226         -	variable historyfile
   227         -
   228         -	if {[string trim [llength ${args}]]} {
   229         -		set historyfile ""
   230         -		catch {
   231         -			set historyfile [file nativename [lindex ${args} 0]]
   232         -		}
   233         -		if {"" == [string trim $historyfile]} {
   234         -			set historyfile [lindex ${args} 0]
   235         -		}
          234  +    } else {
          235  +	if [info exists env(HOME)] {
          236  +	    set historyfile  $env(HOME)/.tclsh-history
   236    237   	} else {
   237         -		if [info exists env(HOME)] {
   238         -			set historyfile  $env(HOME)/.tclsh-history
   239         -		} else {
   240         -			set historyfile  .tclsh-history
   241         -		}
          238  +	    set historyfile  .tclsh-history
   242    239   	}
   243         -	set ::tclreadline::errorMsg [readline initialize $historyfile]
   244         -	if {$::tclreadline::errorMsg != ""} {
   245         -		puts stderr $::tclreadline::errorMsg
   246         -	}
          240  +    }
          241  +    set ::tclreadline::errorMsg [readline initialize $historyfile]
          242  +    if {$::tclreadline::errorMsg != ""} {
          243  +	puts stderr $::tclreadline::errorMsg
          244  +    }
   247    245   
   248         -	# InitCmds
          246  +    # InitCmds
   249    247   
   250         -	rename Setup ""
          248  +    rename Setup ""
   251    249   }
   252    250   
   253    251   proc HistoryFileGet {} {
   254         -	variable historyfile
   255         -	return $historyfile
          252  +    variable historyfile
          253  +    return $historyfile
   256    254   }
   257    255   
   258    256   # obsolete
   259    257   #
   260    258   proc Glob {string} {
   261    259   
   262         -	set commandstring ""
   263         -	foreach name $string {
   264         -		set replace [glob -nocomplain -- $name]
   265         -		if {$replace == ""} {
   266         -			lappend commandstring $name
   267         -		} else {
   268         -			lappend commandstring $replace
   269         -		}
          260  +    set commandstring ""
          261  +    foreach name $string {
          262  +	set replace [glob -nocomplain -- $name]
          263  +	if {$replace == ""} {
          264  +	    lappend commandstring $name
          265  +	} else {
          266  +	    lappend commandstring $replace
   270    267   	}
   271         -	# return $commandstring
   272         -	# Christian Krone <krischan@sql.de> proposed
   273         -	return [eval concat $commandstring]
          268  +    }
          269  +    # return $commandstring
          270  +    # Christian Krone <krischan@sql.de> proposed
          271  +    return [eval concat $commandstring]
   274    272   }
   275    273   
   276    274   
   277    275   
   278    276   proc Loop {args} {
   279    277   
   280         -	eval Setup ${args}
          278  +    eval Setup ${args}
          279  +
          280  +    uplevel #0 {
          281  +
          282  +	while {1} {
   281    283   
   282         -	uplevel #0 {
          284  +	    if [info exists tcl_prompt2] {
          285  +		set prompt2 $tcl_prompt2
          286  +	    } else {
          287  +		set prompt2 ">"
          288  +	    }
   283    289   
   284         -		while {1} {
          290  +	    if {[catch {
          291  +		if {"" != [namespace eval ::tclreadline {info procs prompt1}]} {
          292  +		    set LINE [::tclreadline::readline read \
          293  +		    [::tclreadline::prompt1]]
          294  +		} else {
          295  +		    set LINE [::tclreadline::readline read %]
          296  +		}
          297  +		while {![::tclreadline::readline complete $LINE]} {
          298  +		    append LINE "\n"
          299  +		    append LINE [tclreadline::readline read ${prompt2}]
          300  +		}
          301  +	    } ::tclreadline::errorMsg]} {
          302  +		puts stderr [list tclreadline::Loop: error. \
          303  +		$::tclreadline::errorMsg]
          304  +		continue
          305  +	    }
   285    306   
   286         -			if [info exists tcl_prompt2] {
   287         -				set prompt2 $tcl_prompt2
   288         -			} else {
   289         -				set prompt2 ">"
   290         -			}
          307  +	    # Magnus Eriksson <magnus.eriksson@netinsight.se> proposed
          308  +	    # to add the line also to tclsh's history.
          309  +	    #
          310  +	    # I decided to add only lines which are different from
          311  +	    # the previous one to the history. This is different
          312  +	    # from tcsh's behaviour, but I found it quite convenient
          313  +	    # while using mshell on os9.
          314  +	    #
          315  +	    if {[string length $LINE] && [history event 0] != $LINE} {
          316  +		history add $LINE
          317  +	    }
   291    318   
   292         -			if {[catch {
   293         -				if {"" != [namespace eval ::tclreadline {info procs prompt1}]} {
   294         -					set LINE [::tclreadline::readline read \
   295         -					[::tclreadline::prompt1]]
   296         -				} else {
   297         -					set LINE [::tclreadline::readline read %]
   298         -				}
   299         -				while {![::tclreadline::readline complete $LINE]} {
   300         -					append LINE "\n"
   301         -					append LINE [tclreadline::readline read ${prompt2}]
   302         -				}
   303         -			} ::tclreadline::errorMsg]} {
   304         -				puts stderr [list tclreadline::Loop: error. \
   305         -				$::tclreadline::errorMsg]
   306         -				continue
   307         -			}
          319  +	    if [catch {
          320  +		set result [eval $LINE]
          321  +		if {$result != "" && [tclreadline::Print]} {
          322  +		    puts $result
          323  +		}
          324  +		set result ""
          325  +	    } ::tclreadline::errorMsg] {
          326  +		puts stderr $::tclreadline::errorMsg
          327  +		puts stderr [list while evaluating $LINE]
          328  +	    }
   308    329   
   309         -			# Magnus Eriksson <magnus.eriksson@netinsight.se> proposed
   310         -			# to add the line also to tclsh's history.
   311         -			#
   312         -			# I decided to add only lines which are different from
   313         -			# the previous one to the history. This is different
   314         -			# from tcsh's behaviour, but I found it quite convenient
   315         -			# while using mshell on os9.
   316         -			#
   317         -			if {[string length $LINE] && [history event 0] != $LINE} {
   318         -				history add $LINE
   319         -			}
   320         -
   321         -			if [catch {
   322         -				set result [eval $LINE]
   323         -				if {$result != "" && [tclreadline::Print]} {
   324         -					puts $result
   325         -				}
   326         -				set result ""
   327         -			} ::tclreadline::errorMsg] {
   328         -				puts stderr $::tclreadline::errorMsg
   329         -				puts stderr [list while evaluating $LINE]
   330         -			}
   331         -
   332         -		}
   333    330   	}
          331  +    }
   334    332   }
   335    333   
   336    334   proc Print {args} {
   337         -	variable PRINT
   338         -	if ![info exists PRINT] {
   339         -		set PRINT yes
   340         -	}
   341         -	if [regexp -nocase \(true\|yes\|1\) $args] {
   342         -		set PRINT yes
   343         -	} elseif [regexp -nocase \(false\|no\|0\) $args] {
   344         -		set PRINT no
   345         -	}
   346         -	return $PRINT
          335  +    variable PRINT
          336  +    if ![info exists PRINT] {
          337  +	set PRINT yes
          338  +    }
          339  +    if [regexp -nocase \(true\|yes\|1\) $args] {
          340  +	set PRINT yes
          341  +    } elseif [regexp -nocase \(false\|no\|0\) $args] {
          342  +	set PRINT no
          343  +    }
          344  +    return $PRINT
   347    345   }
   348    346   # 
   349    347   # 
   350    348   # proc InitCmds {} {
   351    349   #     # XXX
   352    350   #     return 
   353    351   #     # XXX

Modified tclshrl.c from [9cd021378e] to [3b1fc8c4f3].

     1      1   
     2      2    /* ==================================================================
     3      3   
     4      4       FILE: "/home/joze/src/tclreadline/tclshrl.c"
     5         -    LAST MODIFICATION: "Thu Dec 16 21:51:19 1999 (joze)"
     6         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 22:42:14 +0100 (joze)"
            6  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       ---
     9      9   
    10     10       tclreadline -- gnu readline for tcl
    11         -    Copyright (C) 1999  Johannes Zellner
           11  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    12     12   
    13     13       This program is free software; you can redistribute it and/or
    14     14       modify it under the terms of the GNU General Public License
    15     15       as published by the Free Software Foundation; either version 2
    16     16       of the License, or (at your option) any later version.
    17     17   
    18     18       This program is distributed in the hope that it will be useful,

Modified wishrl.c from [6d8e8d8f9e] to [de17910927].

     1      1   
     2      2    /* ==================================================================
     3      3   
     4      4       FILE: "/home/joze/src/tclreadline/wishrl.c"
     5         -    LAST MODIFICATION: "Thu Dec 16 22:05:05 1999 (joze)"
     6         -    (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
            5  +    LAST MODIFICATION: "Thu, 23 Mar 2000 22:42:23 +0100 (joze)"
            6  +    (C) 1998 - 2000 by Johannes Zellner, <johannes@zellner.org>
     7      7       $Id$
     8      8       ---
     9      9   
    10     10       tclreadline -- gnu readline for tcl
    11         -    Copyright (C) 1999  Johannes Zellner
           11  +    Copyright (C) 1998 - 2000 by Johannes Zellner
    12     12   
    13     13       This program is free software; you can redistribute it and/or
    14     14       modify it under the terms of the GNU General Public License
    15     15       as published by the Free Software Foundation; either version 2
    16     16       of the License, or (at your option) any later version.
    17     17   
    18     18       This program is distributed in the hope that it will be useful,