Check-in [41d16f099d]
Not logged in
Overview
SHA1:41d16f099d370ea0b288f09dd724e12b87592f3f
Date: 2014-02-18 23:09:10
User: quentin@minster.io
Comment:Apply the Debian patchset Debian source package: tcl-tclreadline 2.1.0-12 Fully applied patches: * complete_nontcl.patch * completion_matches.patch * completion_pbug.patch * memuse.patch * tclshpath.patch * varnames.patch Partially applied patches: * manpage.patch * tinfo.patch Dropped patches: * kfreebsd.patch * link.patch * tclrldir.patch
Timelines: family | ancestors | descendants | both | trunk | origin/devel
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2014-02-19
00:07
[f61c58e424] Apply the Gentoo patchset Gentoo ebuild: dev-tcltk/tclreadline-2.1.0-r4 Fully applied patches: * direct sed patches from the ebuild * tclreadline-2.1.0-gold.patch * tclreadline-2.1.0-rl-executing-macro.patch * tclreadline-2.1.0-rl-history-expand.patch * tclreadline-2.1.0-rl-prompt.patch Partially applied patches: * tclreadline-2.1.0-alloc-free.patch (user: quentin@minster.io, tags: trunk, origin/devel)
2014-02-18
23:09
[41d16f099d] Apply the Debian patchset Debian source package: tcl-tclreadline 2.1.0-12 Fully applied patches: * complete_nontcl.patch * completion_matches.patch * completion_pbug.patch * memuse.patch * tclshpath.patch * varnames.patch Partially applied patches: * manpage.patch * tinfo.patch Dropped patches: * kfreebsd.patch * link.patch * tclrldir.patch (user: quentin@minster.io, tags: trunk, origin/devel)
22:32
[fa523361f5] Add the 'ident' attribute to all files (user: quentin@minster.io, tags: trunk, origin/devel)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified configure.in from [f10843c742] to [72c6a348ad].

   118    118   if test -z "$TCL_INCLUDE_DIR"; then
   119    119       AC_MSG_ERROR([
   120    120     Can't find tcl.h.  Use --with-tcl-includes to specify the directory
   121    121     containing tcl.h on your system.])
   122    122   else
   123    123       AC_MSG_RESULT($TCL_INCLUDE_DIR/tcl.h)
   124    124   fi
   125         -
   126         -
   127         -# ---
   128         -# check for the terminal library.
   129         -# ---
   130         -
   131         -AC_ARG_WITH(tlib-library,
   132         -    [  --with-tlib-library=DIR
   133         -		  lib spec to tlib (e.g. '-L/usr/local/lib -lncurses')],
   134         -    LIBS="$LIBS $withval",
   135         -    for tlib in ncurses termlib termcap curses; do
   136         -	brk=yes
   137         -	AC_CHECK_LIB($tlib, tputs, , brk=no)
   138         -	if test $brk = "yes"; then
   139         -	    HAVE_TLIB=yes
   140         -	    break
   141         -	fi
   142         -    done
   143         -    if test "x" = "x$HAVE_TLIB"; then
   144         -	AC_MSG_ERROR([
   145         -	    no terminal library found. Please retry with the --with-tlib argument.
   146         -	])
   147         -    fi
   148         -)
   149         -
   150         -
   151    125   #--------------------------------------------------------------------
   152    126   #   Check for readline.h
   153    127   #--------------------------------------------------------------------
   154    128   
   155    129   AC_ARG_WITH(readline-includes,
   156    130               [  --with-readline-includes=DIR readline include files in DIR],
   157    131               rl_includes=$withval, rl_includes="")

Modified pkgIndex.tcl.in from [8cc3f9dc8d] to [e32c88be89].

     1         -#!/usr/local/bin/tclsh
     2      1   # FILE: "/home/joze/src/tclreadline/pkgIndex.tcl.in"
     3      2   # LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
     4      3   # (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
     5      4   # $Id$
     6      5   # ---
     7      6   # tclreadline -- gnu readline for tcl
     8      7   # http://www.zellner.org/tclreadline/
     9      8   # Copyright (c) 1998 - 2001, Johannes Zellner <johannes@zellner.org>
    10      9   # This software is copyright under the BSD license.
    11     10   
    12     11   package ifneeded tclreadline @VERSION@ \
    13     12       [list source [file join $dir tclreadlineInit.tcl]]

Modified tclreadline.c from [5166ffcdb3] to [8df3bd02ad].

    45     45   #endif
    46     46   
    47     47   #include "tclreadline.h"
    48     48   static const char* tclrl_library = TCLRL_LIBRARY;
    49     49   static const char* tclrl_version_str = TCLRL_VERSION_STR;
    50     50   static const char* tclrl_patchlevel_str = TCLRL_PATCHLEVEL_STR;
    51     51   
    52         -#define MALLOC(size) Tcl_Alloc((int) size)
    53         -#define FREE(ptr) if (ptr) { Tcl_Free((char*) ptr); ptr = 0; }
           52  +#define MALLOC(size) malloc((int) size)
           53  +#define FREE(ptr) if (ptr) { free((char*) ptr); ptr = 0; }
    54     54   
    55     55   enum {
    56     56       _CMD_SET     = (1 << 0),
    57     57       _CMD_GET     = (1 << 1)
    58     58   };
    59     59   
    60     60   
................................................................................
   741    741   
   742    742   	    matches[i] = (char*) NULL; /* terminate */
   743    743   	}
   744    744   	Tcl_ResetResult(tclrl_interp); /* clear result space */
   745    745       }
   746    746   
   747    747       if (!matches && tclrl_use_builtin_completer) {
   748         -	matches = completion_matches(text, TclReadline0generator);
          748  +	matches = rl_completion_matches(text, (rl_compentry_func_t *)TclReadline0generator);
   749    749       }
   750    750   
   751    751       return matches;
   752    752   }
   753    753   
   754    754   static char*
   755    755   TclReadline0generator(char* text, int state)

Modified tclreadline.n.in from [d9f3f38a64] to [561d62d80a].

    69     69   to modify your .tclshrc according to the section \fBFILES\fP.
    70     70   
    71     71   For the functionality of the GNU readline you should refer to
    72     72   the readline's documentation.
    73     73   
    74     74   .PP
    75     75   The following list will give all commands, which are currently
    76         -implemented in the shared lib (e.g. libtclreadline@TCLREADLINE_VERSION@.so).
           76  +implemented in the shared lib (e.g. libtclreadline@VERSION@.so).
    77     77   Additional commands were introduced in a startup script
    78     78   \fBtclreadlineSetup.tcl\fP, which lives in the tclreadline
    79     79   installation directory.
    80     80   (typically something like /usr/local/lib/tclreadline ..)
    81     81   These commands are primarily for internal use and not documented here.
    82     82   
    83     83   Note that all commands reside in the namespace \fB::tclreadline::\fP.
................................................................................
   141    141   of the line). The default for this script is "puts {}; exit". Setting
   142    142   this to an empty value disables any action on eof.
   143    143   \fBtclreadline::readline eof\fP returns the current eof script.
   144    144   
   145    145   .TP 5
   146    146   \fB::tclreadline::readline initialize\fP \fIhistoryfile\fP
   147    147   initialize the tclreadline interface and read the history from
   148         -the \fIhistoryfile\fP. On succes an empty string is returned.
          148  +the \fIhistoryfile\fP. On success an empty string is returned.
   149    149   This command has to be called before any other tclreadline commands.
   150    150   
   151    151   .TP 5
   152    152   \fB::tclreadline::readline read\fP \fIprompt\fP
   153    153   prints the \fIprompt\fP to stdout and enters the tclreadline event
   154    154   loop. Both readline and X events are processed. Returns the
   155    155   (eventually history-expanded) input string.
................................................................................
   207    207   it is probably a good idea to start with tclreadline::Loop
   208    208   (see the file tclreadlineSetup.tcl).
   209    209   
   210    210   .TP 5
   211    211   \fB::tclreadline::prompt1\fP
   212    212   a proc which is called by ::tclreadline::Loop and returns a string
   213    213   which will be displayed as the primary prompt. This prompt will be
   214         -something like "[info nameofexecutable] \[[pwd]\]" possibly fancy colored.
          214  +something like "[info nameofexecutable] \\[[pwd]\\]" possibly fancy colored.
   215    215   The default proc is defined on entering the ::tclreadline::Loop,
   216    216   if it is not already defined. So: If you define your own proc
   217    217   ::tclreadline::prompt1 before entering ::tclreadline::Loop, this
   218    218   proc is called each time the prompt is to be displayed.
   219    219   Example:
   220    220   .CS
   221    221       package require tclreadline
................................................................................
   228    228   .CE
   229    229   
   230    230   Note that non-printable control characters as color control characters
   231    231   must be enclosed in literal ctrl-a / ctrl-b to tell readline the length
   232    232   of the printable prompt. See for example the variable `prompt_string'
   233    233   in the file tclreadlineSetup.tcl in your tclreadline installation directory.
   234    234   
          235  +.TP 5
          236  +\fB::tclreadline::prompt2\fP
          237  +a proc which is called by ::tclreadline::Loop and returns a string
          238  +which will be displayed as the secondary prompt when interactively
          239  +prompting  for  continuation  of  an incomplete command.
   235    240   
   236    241   .\" .SH "EXAMPLES"
   237    242   
   238    243   
   239    244   .\" .SH "ENVIRONMENT VARIABLES"
   240    245   
   241    246   .SH "VARIABLES"
   242    247   
   243    248   \fItclreadline\fP defines the following variables in the
   244    249   namespace \fI::tclreadline\fP:
   245         -(for backwards compatiblity the global variables tclreadline_version,
          250  +(for backwards compatibility the global variables tclreadline_version,
   246    251    tclreadline_patchLevel and tclreadline_library are still present).
   247    252   
   248    253   .TP 5
   249    254   \fBtclreadline::version\fP (read-only)
   250         -holds the version string "@TCLREADLINE_VERSION@".
          255  +holds the version string "@VERSION@".
   251    256   
   252    257   .TP 5
   253    258   \fBtclreadline::patchLevel\fP (read-only)
   254    259   holds the patch level string "@PATCHLEVEL_STR@".
   255    260   
   256    261   .TP 5
   257    262   \fBtclreadline::library\fP (read-only)
   258         -holds the library string "@TCLREADLINE_LIBRARY@".
          263  +holds the library string "@TCLRL_DIR@".
   259    264   
   260    265   .TP 5
   261    266   \fBtclreadline::license\fP (read-only)
   262    267   holds a BSD license statement.
   263    268   
   264    269   .TP 5
   265    270   \fBtclreadline::historyLength\fP

Modified tclreadlineCompleter.tcl from [d56a0206cd] to [cf379af2f8].

   621    621   					return 0
   622    622   				}
   623    623   			} else {
   624    624   				return 0
   625    625   			}
   626    626   		}
   627    627   	}
   628         -	if {![catch [list set type [image type ${cmd}]]]} {
          628  +	if {![catch {set type [image type $cmd]}]} {
   629    629   		switch -- ${type} {
   630    630   			photo {
   631    631   				set result [PhotoObj ${text} ${start} ${end} ${line} ${pos}]
   632    632   				return 1
   633    633   			}
   634    634   			default {
   635    635   				# let the fallback completers do the job.
................................................................................
  1456   1456   			set alias [uplevel [info level] \
  1457   1457   			subst [lindex [lindex [QuoteQuotes ${line}] 0] 0]]
  1458   1458   
  1459   1459   			# make `alias' a fully qualified name.
  1460   1460   			# this can raise an error, if alias is
  1461   1461   			# no valid command.
  1462   1462   			#
  1463         -			if {[catch [list set alias [namespace origin $alias]]]} {
         1463  +			if {[catch {set alias [namespace origin $alias]}]} {
  1464   1464   				return ""
  1465   1465   			}
  1466   1466   
  1467   1467   			# strip leading ::'s.
  1468   1468   			#
  1469   1469   			regsub -all {^::} $alias {} alias
  1470   1470   			set namespc [namespace qualifiers $alias]
................................................................................
  3038   3038   # proc complete(regexp) {text start end line pos mod} {
  3039   3039   #     We're not on windoze here ...
  3040   3040   # }
  3041   3041   
  3042   3042   proc complete(regsub) {text start end line pos mod} {
  3043   3043   	set prev [PreviousWord ${start} ${line}]
  3044   3044   	if {[llength ${prev}] && "--" != $prev && \
  3045         -		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
         3045  +		("-" == [string index ${prev} 0] || 1 == ${pos})} {
  3046   3046   		set cmds [RemoveUsedOptions ${line} {
  3047   3047   			-all -nocase --} {--}]
  3048   3048   		if {[llength ${cmds}]} {
  3049   3049   			return [string trim [CompleteFromList ${text} ${cmds}]]
  3050   3050   		}
  3051   3051   	} else {
  3052   3052   		set virtual_pos [expr ${pos} - [FirstNonOption ${line}]]
................................................................................
  3445   3445   	return [CompleteFromList ${text} [RemoveUsedOptions ${line} {
  3446   3446   		-nobackslashes -nocommands -novariables <string>}]]
  3447   3447   }
  3448   3448   
  3449   3449   proc complete(switch) {text start end line pos mod} {
  3450   3450   	set prev [PreviousWord ${start} ${line}]
  3451   3451   	if {[llength ${prev}] && "--" != ${prev} && \
  3452         -		("-" == [string index ${prev} 0] || 1 == ${pos)}} {
         3452  +		("-" == [string index ${prev} 0] || 1 == ${pos})} {
  3453   3453   		set cmds [RemoveUsedOptions ${line} {
  3454   3454   			-exact -glob -regexp --} {--}]
  3455   3455   		if {[llength ${cmds}]} {
  3456   3456   			return [string trim [CompleteFromList ${text} ${cmds}]]
  3457   3457   		}
  3458   3458   	} else {
  3459   3459   		set virtual_pos [expr ${pos} - [FirstNonOption ${line}]]

Modified tclreadlineInit.tcl.in from [9814e2f545] to [56eefa1686].

     1         -#!/usr/local/bin/tclsh
     2      1   # FILE: "/home/joze/src/tclreadline/tclreadlineInit.tcl.in"
     3      2   # LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:33 +0100 (joze)"
     4      3   # (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
     5      4   # $Id$
     6      5   # ---
     7      6   # tclreadline -- gnu readline for tcl
     8      7   # http://www.zellner.org/tclreadline/

Modified tclreadlineSetup.tcl.in from [b96052aeac] to [91dcec21a3].

     1         -#!/usr/locanl/bin/tclsh
     2      1   # FILE: "/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
     3      2   # LAST MODIFICATION: "Mit, 10 Jan 2001 06:29:34 +0100 (joze)"
     4      3   # (C) 1998 - 2001 by Johannes Zellner, <johannes@zellner.org>
     5      4   # $Id$
     6      5   # ---
     7      6   # tclreadline -- gnu readline for tcl
     8      7   # http://www.zellner.org/tclreadline/
................................................................................
   132    131   
   133    132       uplevel #0 {
   134    133   
   135    134   	if {"" == [info commands ::tclreadline::readline]} {
   136    135   	    ::tclreadline::Init
   137    136   	}
   138    137   
   139         -	if {[catch {set a [::tclreadline::prompt1]}] && [info nameofexecutable] != ""} {
          138  +	if {"" == [info procs ::tclreadline::prompt1] && [info nameofexecutable] != ""} {
   140    139   
   141    140   	    namespace eval ::tclreadline {
   142    141   		variable prompt_string
   143    142   		set base [file tail [info nameofexecutable]]
   144    143   
   145    144   		if {[string match tclsh* $base] && [info exists tcl_version]} {
   146    145   		    set prompt_string \
................................................................................
   166    165   			regsub $env(HOME) $pwd "~" pwd
   167    166   		    }
   168    167   		    return "$prompt_string \[$pwd\]"
   169    168   		}
   170    169   	    }
   171    170   	    # puts body=[info body ::tclreadline::prompt1]
   172    171   	}
          172  +
          173  +	if {"" == [info procs ::tclreadline::prompt2] && [info nameofexecutable] != ""} {
          174  +
          175  +	    if {"" == [info procs ::tclreadline::prompt2]} {
          176  +		proc ::tclreadline::prompt2 {} {
          177  +		    return ">"
          178  +		}
          179  +	    }
          180  +	    # puts body=[info body ::tclreadline::prompt2]
          181  +	}
   173    182   
   174    183   	if {"" == [info procs exit]} {
   175    184   
   176    185   	    catch {rename ::tclreadline::Exit ""}
   177    186   	    rename exit ::tclreadline::Exit
   178    187   
   179    188   	    proc exit {args} {
................................................................................
   259    268   
   260    269       eval Setup ${args}
   261    270   
   262    271       uplevel #0 {
   263    272   
   264    273   	while {1} {
   265    274   
   266         -	    if [info exists tcl_prompt2] {
   267         -		set prompt2 $tcl_prompt2
   268         -	    } else {
   269         -		set prompt2 ">"
   270         -	    }
   271         -
   272    275   	    if {[catch {
   273    276   		if {"" != [namespace eval ::tclreadline {info procs prompt1}]} {
   274         -		    set LINE [::tclreadline::readline read \
          277  +		    set ::tclreadline::LINE [::tclreadline::readline read \
   275    278   		    [::tclreadline::prompt1]]
   276    279   		} else {
   277         -		    set LINE [::tclreadline::readline read %]
          280  +		    set ::tclreadline::LINE [::tclreadline::readline read %]
   278    281   		}
   279         -		while {![::tclreadline::readline complete $LINE]} {
   280         -		    append LINE "\n"
   281         -		    append LINE [tclreadline::readline read ${prompt2}]
          282  +		while {![::tclreadline::readline complete $::tclreadline::LINE]} {
          283  +		    append ::tclreadline::LINE "\n"
          284  +		    if {"" != [namespace eval ::tclreadline {info procs prompt2}]} {
          285  +			append ::tclreadline::LINE \
          286  +			    [tclreadline::readline read [::tclreadline::prompt2]]
          287  +		    } else {
          288  +			append ::tclreadline::LINE [tclreadline::readline read >]
          289  +		    }
   282    290   		}
   283    291   	    } ::tclreadline::errorMsg]} {
   284    292   		puts stderr [list tclreadline::Loop: error. \
   285    293   		$::tclreadline::errorMsg]
   286    294   		continue
   287    295   	    }
   288    296   
................................................................................
   290    298   	    # to add the line also to tclsh's history.
   291    299   	    #
   292    300   	    # I decided to add only lines which are different from
   293    301   	    # the previous one to the history. This is different
   294    302   	    # from tcsh's behaviour, but I found it quite convenient
   295    303   	    # while using mshell on os9.
   296    304   	    #
   297         -	    if {[string length $LINE] && [history event 0] != $LINE} {
   298         -		history add $LINE
          305  +	    if {[string length $::tclreadline::LINE] && \
          306  +		    [history event 0] != $::tclreadline::LINE} {
          307  +		history add $::tclreadline::LINE
   299    308   	    }
   300    309   
   301    310   	    if [catch {
   302         -		set result [eval $LINE]
   303         -		if {$result != "" && [tclreadline::Print]} {
   304         -		    puts $result
          311  +		set ::tclreadline::result [eval $::tclreadline::LINE]
          312  +		if {$::tclreadline::result != "" && [tclreadline::Print]} {
          313  +		    puts $::tclreadline::result
   305    314   		}
   306         -		set result ""
          315  +		set ::tclreadline::result ""
   307    316   	    } ::tclreadline::errorMsg] {
   308    317   		puts stderr $::tclreadline::errorMsg
   309         -		puts stderr [list while evaluating $LINE]
          318  +		puts stderr [list while evaluating $::tclreadline::LINE]
   310    319   	    }
   311    320   
   312    321   	}
   313    322       }
   314    323   }
   315    324   
   316    325   proc Print {args} {