|
2013-03-21
| ||
| 21:29 | • Closed ticket [2102614fff]: auto_mkindex don't detect ensembles plus 7 o... artifact: ae49c22755 user: dgp | |
|
2013-03-20
| ||
| 01:23 | • Ticket [2102614fff]: 4 changes artifact: fb7da38ed2 user: bgriffin | |
|
2013-03-19
| ||
| 20:46 | • Ticket [2102614fff]: 4 changes artifact: 497d7be091 user: dgp | |
|
2013-01-04
| ||
| 04:29 | • Ticket [2102614fff]: 4 changes artifact: 32f03834ba user: bgriffin | |
|
2008-09-30
| ||
| 01:30 | • Ticket [2102614fff]: 1 change artifact: 50aa7eb989 user: dgp | |
|
2008-09-10
| ||
| 22:15 | • Ticket [2102614fff]: 2 changes artifact: d710760a0e user: dgp | |
|
2008-09-09
| ||
| 20:35 | • New ticket [2102614fff]. artifact: 9082ee123b user: nobody | |
auto_mkindex don't detect ensembles
Closed / Fixed2102614fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 14 years ago
Descriptionplain2008-09-09 20:35:02
Linux debsam 2.6.18-6-k7 #1 SMP Mon Aug 18 09:20:26 UTC 2008 i686 GNU/Linux
Tcl: 8.6a3
auto_mkindex don't detect ensembles.
a patch perhaps:
diff auto.tcl auto.tcl.BAK
586,602d585
< ensemble {
< variable parser
< variable index
< variable scriptFile
<
< set subcommand [lindex $args 0]
< if {$subcommand eq "create"} {
< set script [list _%@namespace ensemble {*}$args]
< if {[catch {$parser eval $script} command] == 0} {
< append index [list set auto_index($command)] \
< [format { [list source [file join $dir %s]]} \
< [file split $scriptFile]] "\n"
< }
< } else {
< $parser eval [list _%@namespace ensemble {*}$args]
< }
< }
dgp Ticket [2102614fff]: 2 changes
[History diff]2008-09-10 22:15:52
dgp Ticket [2102614fff]: 1 change
[History diff]2008-09-30 01:30:20
bgriffinplain2013-01-04 04:29:15
The proposed patch does not work for me. This patch does work for me:
$ p4 diff -dc auto.tcl
==== //dvt/mti/prod/src/tcltk/8.5.8/tcl/tcl/library/auto.tcl#1 - /home/bgriffin/dev/devm2_backup/prod/src/tcltk/8.5.8/tcl/tcl/library/auto.tcl ====
***************
*** 604,609 ****
--- 604,618 ----
}
catch {$parser eval "_%@namespace import $args"}
}
+ ensemble {
+ variable parser
+ variable contextStack
+ if {[lindex $args 0] eq "create"} {
+ set name ::[join [lreverse $contextStack] ::]
+ # create artifical proc to force a command entry in the tclIndex
+ $parser eval [list proc $name {} {}]
+ }
+ }
}
}
dgpplain2013-03-19 20:46:38
Anything we can put in the test suite for this one?
bgriffinplain2013-03-20 01:23:28
How's this:
$ .x/tcl/tcl/tests/autoMkindex.test <
==== //dvt/mti/prod/src/tcltk/8.5.x/tcl/tcl/tests/autoMkindex.test#1 - /home/bgriffin/dev/devm2_backup/prod/src/tcltk/8.5.x/tcl/tcl/tests/autoMkindex.test ====
***************
*** 251,256 ****
--- 251,289 ----
list [lvalue $::result *mycmd4*] [lvalue $::result *mycmd5*] [lvalue $::result *mycmd6*]
} "{::buried::mycmd4 $element} {::buried::mycmd5 $element} {mycmd6 $element}"
+ makeFile {
+
+ namespace eval wok {
+ namespace ensemble create -subcommands {commands vars}
+
+ proc commands {{pattern *}} {
+ puts [join [lsort -dictionary [info commands $pattern]] \n]
+ }
+
+ proc vars {{pattern *}} {
+ puts [join [lsort -dictionary [info vars $pattern]] \n]
+ }
+
+ }
+
+ } ensemblecommands.tcl
+
+ test autoMkindex-3.3 {ensemble commands in tclIndex} {
+ file delete tclIndex
+ auto_mkindex . ensemblecommands.tcl
+ set f [open tclIndex r]
+ set dat [list]
+ foreach r [split [string trim [read $f]] "\n"] {
+ if {[string match {set auto_index*} $r]} {
+ lappend dat $r
+ }
+ }
+ set result [lsort $dat]
+ close $f
+ set result
+ } {{set auto_index(::wok::commands) [list source [file join $dir ensemblecommands.tcl]]} {set auto_index(::wok::vars) [list source [file join $dir ensemblecommands.tcl]]} {set auto_index(wok) [list source [file join $dir ensemblecommands.tcl]]}}
+
+ removeFile ensemblecommands.tcl
makeDirectory pkg
makeFile {
dgpplain2013-03-21 21:29:59
allow_comments - 1 patches accepted.
Log in (anonymous is fine) to add a comment.