Check-in [702e7f3410]
Not logged in
Overview
Comment:Thu Sep 30 03:25:19 CEST 1999
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 702e7f3410aed542add89d8971dfee5f75b5489a
User & Date: johannes@zellner.org on 1999-09-30 01:26:16
Other Links: manifest | tags
Context
1999-09-30
16:03
Thu Sep 30 18:03:05 MEST 1999 check-in: 5df4b8fab3 user: johannes@zellner.org tags: trunk
01:26
Thu Sep 30 03:25:19 CEST 1999 check-in: 702e7f3410 user: johannes@zellner.org tags: trunk
1999-09-29
18:24
Wed Sep 29 20:24:01 MEST 1999 check-in: 79656128ef user: johannes@zellner.org tags: trunk
Changes

Modified tclreadlineCompleter.tcl from [dc01fb3b61] to [909728e96f].

1
2
3
4
5
6
7
8
9
10
# -*- tclsh -*-
# FILE: "/disk01/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Wed Sep 29 18:00:58 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
# -*- tclsh -*-
# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl"
# LAST MODIFICATION: "Wed Sep 29 21:25:15 1999 (joze)"
# (C) 1998, 1999 by Johannes Zellner, <johannes@zellner.org>
# $Id$
# ---
#
# tclreadline -- gnu readline for tcl
# Copyright (C) 1999  Johannes Zellner
#
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# CompleteFromList will never return an empty string.
# completes, if a completion can be done, or ring
# the bell if not. If inhibit is non-zero, the result
# will be formatted such that readline will not insert
# a space after a complete (single) match.
#
proc CompleteFromList {text lst {allow ""} {inhibit 0}} {
	set result [TryFromList ${text} ${lst} ${allow} $inhibit]
	if {![llength ${result}]} {
		Alert
		# return [string trim [list ${text}] ${lst}"]
		if {[llength ${lst}]} {
			return [string trim "${text} ${lst}"]
		} else {
			return [string trim [list ${text} {}]]







|







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# CompleteFromList will never return an empty string.
# completes, if a completion can be done, or ring
# the bell if not. If inhibit is non-zero, the result
# will be formatted such that readline will not insert
# a space after a complete (single) match.
#
proc CompleteFromList {text lst {allow ""} {inhibit 0}} {
	set result [TryFromList ${text} ${lst} ${allow} ${inhibit}]
	if {![llength ${result}]} {
		Alert
		# return [string trim [list ${text}] ${lst}"]
		if {[llength ${lst}]} {
			return [string trim "${text} ${lst}"]
		} else {
			return [string trim [list ${text} {}]]
3587
3588
3589
3590
3591
3592
3593
3594








3595
3596
3597
3598
3599
3600
3601
3602
3603











3604
3605
3606
3607
3608
3609
3610
		2 {
			return [CompleteFromList ${text} \
			[uplevel [info level] info vars "${mod}*"]]
		}
		3 {
			switch -- ${cmd} {
				variable -
				vdelete { return [CompleteFromList ${text} {r w u}] }








			}
		}
		4 {
			switch -- ${cmd} {
				variable -
				vdelete {
					return [CompleteFromList ${text} \
					[CommandCompletion ${text}]]
				}











			}
		}
	}
	return ""
}

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







|
>
>
>
>
>
>
>
>




|
<



>
>
>
>
>
>
>
>
>
>
>







3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607

3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
		2 {
			return [CompleteFromList ${text} \
			[uplevel [info level] info vars "${mod}*"]]
		}
		3 {
			switch -- ${cmd} {
				variable -
				variable { return [CompleteFromList ${text} {r w u}] }
				vdelete {
					set var [PreviousWord ${start} ${line}]
					set modes ""
					foreach info [uplevel [info level] trace vinfo ${var}] {
						lappend modes [lindex ${info} 0]
					}
					return [CompleteFromList ${text} ${modes}]
				}
			}
		}
		4 {
			switch -- ${cmd} {
				variable {

					return [CompleteFromList ${text} \
					[CommandCompletion ${text}]]
				}
				vdelete {
					set var [Lindex ${line} 2]
					set mode [PreviousWord ${start} ${line}]
					set scripts ""
					foreach info [uplevel [info level] trace vinfo ${var}] {
						if {${mode} == [lindex ${info} 0]} {
							lappend scripts [list [lindex ${info} 1]]
						}
					}
					return [DisplayHints ${scripts}]
				}
			}
		}
	}
	return ""
}

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