Diff
Not logged in

Differences From Artifact [8724f1bf99]:

To Artifact [eb1ce940bb]:


1
2
3
4
5
6
7
8
9
10
#!/usr/locanl/bin/tclsh
# FILE: "/diska/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Mon Sep  6 08:50:52 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#


|







1
2
3
4
5
6
7
8
9
10
#!/usr/locanl/bin/tclsh
# FILE: "/diska/home/joze/src/tclreadline/tclreadlineSetup.tcl.in"
# LAST MODIFICATION: "Mon Sep  6 11:21:53 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
proc InitTclCmds {} {
    variable known_cmds
    foreach line {
        "after option ?arg arg ...?"
        "append varName ?value value ...?"
        "array option arrayName ?arg ...?"
        "bgerror"
        "binary option ?arg arg ...?"
        "break"
        "catch command ?varName?"
        "cd"
        "clock"
        "close <channelId>"
        "concat"
        "continue"







<







1019
1020
1021
1022
1023
1024
1025

1026
1027
1028
1029
1030
1031
1032
proc InitTclCmds {} {
    variable known_cmds
    foreach line {
        "after option ?arg arg ...?"
        "append varName ?value value ...?"
        "array option arrayName ?arg ...?"
        "bgerror"

        "break"
        "catch command ?varName?"
        "cd"
        "clock"
        "close <channelId>"
        "concat"
        "continue"
1133
1134
1135
1136
1137
1138
1139
1140
1141

1142
1143
1144
1145
1146
1147
1148
1149
1150
#

# -------------------------------------
#                 TCL
# -------------------------------------

proc complete(append) {text start end line pos mod} {
    if {1 == $pos} {
        return [VarCompletion ${text}]

    }
    return ""
}

proc complete(if) {text start end line pos mod} {
    # TODO: this is not good yet.
    if {2 == $pos} {
        return [AttemptFromList $text {then}]
    } elseif {$pos > 2} {







|
|
>

<







1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142

1143
1144
1145
1146
1147
1148
1149
#

# -------------------------------------
#                 TCL
# -------------------------------------

proc complete(append) {text start end line pos mod} {
    switch -- $pos {
        1 { return [VarCompletion ${text}] }
        default { return [Menu ?value?] }
    }

}

proc complete(if) {text start end line pos mod} {
    # TODO: this is not good yet.
    if {2 == $pos} {
        return [AttemptFromList $text {then}]
    } elseif {$pos > 2} {
1225
1226
1227
1228
1229
1230
1231
1232
1233


1234
1235
1236
1237
1238
1239





1240
1241
1242
1243
1244
1245



1246




1247
1248
1249
1250
1251
1252
1253
            }
        }
    }
    return ""
}

proc complete(binary) {text start end line pos mod} {
    if {1 == $pos} {
        set cmds {


            format scan
        }
        return [AttemptFromList $text $cmds]
# 
#     } elseif {2 == $pos} {
#         set cmd [lindex $line 1]





#         switch -- $cmd {
#             format -
#             scan -
#         }
# 
    }



    return ""




}

proc complete(clock) {text start end line pos mod} {
    if {1 == $pos} {
        set cmds {clicks format scan seconds}
        return [AttemptFromList $text $cmds]
    } elseif {2 == $pos} {







<
|
>
>
|

<
<
|
|
>
>
>
>
>
|
|
|
<
<
|
>
>
>
|
>
>
>
>







1224
1225
1226
1227
1228
1229
1230

1231
1232
1233
1234
1235


1236
1237
1238
1239
1240
1241
1242
1243
1244
1245


1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
            }
        }
    }
    return ""
}

proc complete(binary) {text start end line pos mod} {

    set cmd [lindex $line 1]
    switch -- $pos {
        1 {
            return [AttemptFromList $text {format scan}]
        }


        2 {
            switch -- $cmd {
                format - { return [Menu formatString] }
                scan - { return [Menu string] }
            }
        }
        3 {
            switch -- $cmd {
                format - { return [Menu ?arg?] }
                scan - { return [Menu formatString] }


            }
        }
        default {
            switch -- $cmd {
                format - { return [Menu ?arg?] }
                scan - { return [Menu ?varName?] }
            }
        }
    }
}

proc complete(clock) {text start end line pos mod} {
    if {1 == $pos} {
        set cmds {clicks format scan seconds}
        return [AttemptFromList $text $cmds]
    } elseif {2 == $pos} {