Index: openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl,v diff -u -r1.6.8.4 -r1.6.8.5 --- openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl 5 Sep 2014 10:31:16 -0000 1.6.8.4 +++ openacs-4/packages/acs-api-browser/www/tcl-proc-view.tcl 5 Sep 2014 18:47:14 -0000 1.6.8.5 @@ -12,11 +12,20 @@ set ns_api_index_result [util_memoize [list ::util::http::get -url $::apidoc::ns_api_html_index]] set ns_api_index_page [dict get $ns_api_index_result page] -set url [apidoc::search_on_webindex \ - -page $ns_api_index_page \ - -root $::apidoc::ns_api_root \ - -host $::apidoc::ns_api_host \ - -proc $tcl_proc] +# +# Since man pages contain often a summary of multiple commands, try +# abbreviation in case the full name is not found (e.g. man page "nsv" +# contains "nsv_array", "nsv_set" etc.) +# +for {set i [string length $tcl_proc]} {$i > 1} {incr i -1} { + set proc [string range $tcl_proc 0 $i] + set url [apidoc::search_on_webindex \ + -page $ns_api_index_page \ + -root $::apidoc::ns_api_root \ + -host $::apidoc::ns_api_host \ + -proc $proc] + if {$url ne ""} break +} if {$url ne ""} { ad_returnredirect -allow_complete_url $url