Index: openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 11 Sep 2024 06:15:56 -0000 1.24 +++ openacs-4/packages/xotcl-core/tcl/03-doc-procs.tcl 22 Oct 2024 09:03:42 -0000 1.25 @@ -213,16 +213,31 @@ return $scope } - :public object method script_name {scope} { + :public object method script_name {-obj scope} { + # + # Determine name of the current "script" as displayed by "Defined + # in" in the API browser. Define different sources available in + # different situatons. + # + # @param obj class name for identifying the source file name + # @param scope either empty or thread name + # @return path starting with the "packages" directory + # set script [info script] - if {$script eq "" && [info exists ::xotcl::currentScript]} { - set script $::xotcl::currentScript + if {$script eq "" || [file tail $script] eq "procdoc-init.tcl"} { + set script "" + if {$script eq "" && [info exists obj] && [nsv_get proc_source_file " Class $obj" script]} { + #ns_log notice "INIT script_name from proc_source_file => <$script>" + } + if {$script eq "" && [info exists ::xotcl::currentScript]} { + set script $::xotcl::currentScript + } + set root_dir $::acs::rootdir + set root_length [string length $root_dir] + if { $root_dir eq [string range $script 0 $root_length-1]} { + set script [string range $script $root_length+1 end] + } } - set root_dir $::acs::rootdir - set root_length [string length $root_dir] - if { $root_dir eq [string range $script 0 $root_length-1]} { - set script [string range $script $root_length+1 end] - } return $script } @@ -340,7 +355,7 @@ varargs_p false \ deprecated_p false \ warn_p false \ - script [::xo::api script_name $scope] \ + script [::xo::api script_name -obj $obj $scope] \ ] set doc [dict replace $doc {*}[array get doc_elements]] @@ -443,7 +458,7 @@ varargs_p $varargs_p \ deprecated_p $deprecated \ warn_p false \ - script [::xo::api script_name $scope] \ + script [::xo::api script_name -obj $obj $scope] \ main "" \ flags "" \ switches0 "" \ @@ -479,11 +494,13 @@ } if {$isFlag} { dict lappend doc switches0 $name - dict lappend doc flags $name $flags + dict lappend doc flags $name [split $flags ,] #:log "default_value $proc_name: $sw -> '[lindex $f 1]' <$pair/$f>" if {$flags eq "switch" && $default eq ""} { set default "false" } + } else { + dict lappend doc flags $name [split $flags ,] } #:log "default_value $proc_name: $sw -> 'default' <$pair/$f>" if {[llength $def] > 1} { @@ -595,28 +612,13 @@ # The following extensions of the base classes are defined here: # ::Serializer exportMethods { - ::nx::Class method init ::xotcl::Object instproc ad_proc ::xotcl::Object instproc ad_forward ::xotcl::Class instproc ad_instproc ::xotcl::Class instproc ad_instforward ::xotcl::Object instproc ad_doc } -::nx::Class method init {} { - set r [next] - # - # When loading the blueprint, ::xo::api might not be available yet. - # - if {[info commands ::xo::api] ne ""} { - ::xo::api update_object_doc "" [self] "" - #ns_log notice "METHODS [self] <[:info methods]>" - } else { - #ns_log notice "[self] init: no <::xo::api> available" - } - return $r -} - ::xotcl::Object instproc ad_proc { {-private:switch false} {-deprecated:switch false}