Check-in [12f1ef0408]
Not logged in
Overview
Comment: Modified Files: README sample.tclshrc tclreadline.n.in tclreadlineSetup.tcl.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 12f1ef04084e8a17ce0e9bb65d5e76c62c10d4f8
User & Date: johannes@zellner.org on 1999-08-22 22:28:30
Other Links: manifest | tags
Context
1999-08-22
22:34
tclreadlineSetup.tcl.in check-in: 66eb0d332d user: johannes@zellner.org tags: trunk
22:28
Modified Files: README sample.tclshrc tclreadline.n.in tclreadlineSetup.tcl.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in check-in: 12f1ef0408 user: johannes@zellner.org tags: trunk
21:31
Modified Files: README tclreadline.n.in tclreadlineSetup.tcl.in Added Files: Makefile.in tclreadline.c tclreadlineConfig.sh.in tclreadlineInit.tcl.in check-in: 32efe7b8fe user: johannes@zellner.org tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified README from [b445706663] to [109aca9237].

     1      1   
     2      2       FILE: "/home/joze/src/tclreadline/README"
     3         -    LAST MODIFICATION: "Sun Aug 22 23:24:34 1999 (joze)"
            3  +    LAST MODIFICATION: "Mon Aug 23 00:21:24 1999 (joze)"
     4      4       (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
     5      5       $Id$
     6      6       ---
     7      7   
     8      8       tclreadline -- gnu readline for tcl
     9      9       Copyright (C) 1999  Johannes Zellner
    10     10   
................................................................................
    79     79   
    80     80   tclreadline-0.9: (Aug 1999)
    81     81   
    82     82       changes:
    83     83           - tclreadline::readline customcompleter
    84     84           - tclreadline::readline builtincompleter
    85     85           - tclreadline::readline eofchar
    86         -        - variable, array and '[' command completion.
           86  +        - variable, array and '[' command completion by the script
           87  +          tclreadline::ScriptCompleter. See the man page or try
           88  +          typing "puts $env<TAB>" ... Command completion currently only
           89  +          works, if a '[' preceeds immediately a non-white character.
           90  +        - the redefinition of the command `cd' was removed due to 
           91  +          multiple requests. This redefinition can be found in the
           92  +          file `sample.tclshrc' and can be uncommented, if desired. 
           93  +        - the definition of the command `ls' was moved outside the
           94  +          proc tclreadline::Setup and can be used with the command
           95  +          namespace import tclreadline::ls (see sample.tclshrc).
    87     96   
    88     97       bug fixes:
    89         -        - history entries.
    90         -        - macro mappings didn't work. (only on hitting
           98  +        - lines added to tcl's history. (were only in readline's hist.)
           99  +        - macro mappings didn't work. (only when hitting
    91    100             mapped characters more than once.)
    92    101           - minor fixes in configure.in
    93    102   
    94         -tclreadline-0.8:
    95         -    minor bug fixes.
          103  +tclreadline-0.8: (May 1999)
          104  +    - adapted for tcl8.1.
          105  +    - minor bug fixes.
    96    106   
    97         -tclreadline-0.7:
          107  +tclreadline-0.7: (Mar 1999)
    98    108       first `public release'.

Modified sample.tclshrc from [79de25f768] to [7e7f1c5e92].

     1      1   #!/bin/sh
     2         -# FILE: "/diska/home/joze/src/tclreadline/sample.tclshrc"
     3         -# LAST MODIFICATION: "Fri Aug 20 15:39:58 1999 (joze)"
            2  +# FILE: "/home/joze/src/tclreadline/sample.tclshrc"
            3  +# LAST MODIFICATION: "Mon Aug 23 00:00:23 1999 (joze)"
     4      4   # (C) 1999 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     12       package require tclreadline
    12         -    namespace import ::tclreadline::Print
    13         -#    ::tclreadline::Print no
           13  +
           14  +    # uncomment the following if block, if you
           15  +    # want `ls' executed after every `cd'. (This was
           16  +    # the default up to 0.8 == tclreadline_version.)
           17  +    #
           18  +    # if {"" == [info procs cd]} {
           19  +    #     catch {rename ::tclreadline::Cd ""}
           20  +    #     rename cd ::tclreadline::Cd
           21  +    #     proc cd {args} {
           22  +    #         if {[catch {eval ::tclreadline::Cd $args} message]} {
           23  +    #             puts stderr "$message"
           24  +    #         }
           25  +    #         ls
           26  +    #     }
           27  +    # }
           28  +
           29  +    # uncomment the following line to use
           30  +    # tclreadline's fancy ls proc.
           31  +    #
           32  +    # namespace import ::tclreadline::ls
           33  +
           34  +    # tclreadline::Print is on (`yes') by default.
           35  +    # This mimics the command echoing like in the
           36  +    # non-readline interactive tclsh.
           37  +    # If you don't like this, uncomment the following
           38  +    # line.
           39  +    #
           40  +    # ::tclreadline::Print no
           41  +
           42  +    # uncomment the folling line, if you want
           43  +    # to change tclreadline's print behaviour
           44  +    # frequently with less typing.
           45  +    #
           46  +    # namespace import ::tclreadline::Print
           47  +
           48  +    # go to tclrealdine's main loop.
    14     49       ::tclreadline::Loop
    15     50   }
    16     51   

Modified tclreadline.n.in from [401a33cf08] to [d7922e5c29].

     1      1   .TH tclreadline n "@TCLREADLINE_VERSION@" "Johannes Zellner"
     2      2   
     3      3   .\" (C) 1999 by Johannes Zellner
     4      4   .\" FILE: "/home/joze/src/tclreadline/tclreadline.n.in"
     5         -.\" LAST MODIFICATION: "Sun Aug 22 23:24:34 1999 (joze)"
            5  +.\" LAST MODIFICATION: "Mon Aug 23 00:15:10 1999 (joze)"
     6      6   .\" (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
     7      7   .\" $Id$
     8      8   .\" ---
     9      9   .\"
    10     10   .\" tclreadline -- gnu readline for the tcl scripting language
    11     11   .\" Copyright (C) 1999  Johannes Zellner
    12     12   .\"
................................................................................
   119    119   
   120    120   Example: \fB% puts $b<TAB>\fP will call the custom completer
   121    121   with the four arguments \fI"$b"\fP, \fI"5"\fP, \fI"8"\fP and \fI"puts $b"\fP.
   122    122   The custom completer could return a string like "$bl $black $blue", which
   123    123   will complete "$b" to "$bl" (the longest match) and offer a list of two
   124    124   further matches "$black" and "$blue".
   125    125   
   126         -For further reference, see the proc tclreadline::script_completer in
          126  +For further reference, see the proc tclreadline::ScriptCompleter in
   127    127   the file tclreadlineSetup.tcl.
   128    128   
   129    129   .TP 5
   130    130   \fB::tclreadline::readline builtincompleter\fP [\fIbool\fP]
   131    131   enable or disable the builtin completer. If the builtin completer
   132    132   is enabled, it will be invoked either if there is no custom completer,
   133    133   or the custom completer returned an empty  string. The builtin
................................................................................
   164    164   
   165    165   .TP 5
   166    166   \fB::tclreadline::Print\fP [\fIyes / no\fP]
   167    167   turns on or off the default behavior of tclsh to print the result of
   168    168   every command. This is turned on by default, so it will just behave
   169    169   as the tclsh w/o tclreadline. Turning off might be useful, when reading
   170    170   binary data for example. If \fB::tclreadline::Print\fP is called w/o
   171         -arguments, it just returns the current setting.
          171  +arguments, it returns the current setting.
   172    172   
   173    173   .TP 5
   174    174   \fB::tclreadline::Loop\fP
   175    175   enter the tclreadline main loop. This command is typically called from
   176    176   the startup resource file (something .tclshrc, depending on the interpreter
   177         -you use). \fB::tclreadline::Loop\fP will normally not return.
          177  +you use, see the file `sample.tclshrc'). The main loop sets up some
          178  +completion characteristics as variable -- try something like "puts $b<TAB>" -- 
          179  +and command completion -- try "puts [in<TAB>".
          180  +\fB::tclreadline::Loop\fP will normally not return. 
          181  +If you want to write your own main loop and/or own custom completers,
          182  +it is probably a good idea to start with tclreadline::Loop
          183  +(see the file tclreadlineSetup.tcl).
   178    184   
   179    185   .TP 5
   180    186   \fB::tclreadline::prompt1\fP
   181    187   a proc which is called by ::tclreadline::Loop and returns a string
   182    188   which will be displayed as the primary prompt. This prompt will be
   183    189   something like "[info nameofexecutable] \[[pwd]\]" possibly fancy colored.
   184    190   The default proc is defined on entering the ::tclreadline::Loop,
................................................................................
   276    282   Christian Krone <krischan@sql.de>,
   277    283   Larry W. Virden <lvirden@cas.org>,
   278    284   David Engel <dlengel@home.com>, <david@debian.org>
   279    285   
   280    286   .SH DEBIAN PACKAGE
   281    287   David Engel <dlengel@home.com>, <david@debian.org>
   282    288   
   283         -.SH HISTORY
          289  +.SH DISCLAIMER
          290  +
   284    291   This version of \fBtclreadline\fP is still a development version.
   285    292   Pretty a lot of features and ideas are not implemented yet. The
   286    293   reason for this is the lack of time and manpower.
   287    294   So you are welcome to modify and contribute to the code.
   288    295   If you have suggestions, please let me know.
          296  +
          297  +\fBtclreadline\fP comes with the GPL (GNU General Public License).
          298  +You should have received a copy of the GNU General Public License
          299  +along with this program; if not, write to the Free Software
          300  +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Modified tclreadlineSetup.tcl.in from [92fdf6b439] to [65d3fcdc8e].

     1      1   #!/usr/local/bin/tclsh
     2      2   # FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
     3         -# LAST MODIFICATION: "Sun Aug 22 22:30:43 1999 (joze)"
            3  +# LAST MODIFICATION: "Sun Aug 22 23:54:09 1999 (joze)"
     4      4   # (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
     5      5   # $Id$
     6      6   # ---
     7      7   #
     8      8   # tclreadline -- gnu readline for tcl
     9      9   # Copyright (C) 1999  Johannes Zellner
    10     10   #
................................................................................
   159    159           } else {
   160    160               append part $char
   161    161           }
   162    162       }
   163    163       return ${part}
   164    164   }
   165    165   
   166         -proc tclreadline::vars_cmds_completer {part start end line} {
          166  +proc tclreadline::ScriptCompleter {part start end line} {
   167    167       if {{$} == [string index $part 0]} {
   168    168           # variable completion. Check first, if the
   169    169           # variable starts with a plain `$' or should
   170    170           # be enclosed in braces.
   171    171           #
   172    172           if {"\{" == [string index $part 1]} {
   173    173               set var [string range $part 2 end]
................................................................................
   226    226   proc ::tclreadline::Setup {} {
   227    227   
   228    228       uplevel #0 {
   229    229   
   230    230           if {[info commands ::tclreadline::readline] == ""} {
   231    231               ::tclreadline::Init
   232    232           }
   233         -        tclreadline::readline customcompleter tclreadline::vars_cmds_completer
          233  +        tclreadline::readline customcompleter tclreadline::ScriptCompleter
   234    234   
   235    235           if {[catch {set a [::tclreadline::prompt1]}] \
   236    236               && [info nameofexecutable] != ""} {
   237    237   
   238    238               namespace eval ::tclreadline {
   239    239                   variable prompt_string
   240    240                   set base [file tail [info nameofexecutable]]