@@ -1,8 +1,8 @@ # -*- tclsh -*- -# FILE: "/disk01/home/joze/src/tclreadline/tclreadlineCompleter.tcl" -# LAST MODIFICATION: "Thu Sep 16 16:24:46 1999 (joze)" +# FILE: "/home/joze/src/tclreadline/tclreadlineCompleter.tcl" +# LAST MODIFICATION: "Thu Sep 16 22:17:38 1999 (joze)" # (C) 1998, 1999 by Johannes Zellner, # $Id$ # --- # # tclreadline -- gnu readline for tcl @@ -1007,10 +1007,13 @@ regsub -all {^::} $alias {} alias set namespc [namespace qualifiers $alias] set alias [namespace tail $alias] } + # try first a specific completer, then, and only then + # the tclreadline_complete_unknown. + # foreach cmd [list ${alias} tclreadline_complete_unknown] { # puts stderr ${namespc}complete(${cmd}) if {"" != [namespace eval ::tclreadline::${namespc} \ [list info procs complete(${cmd})]] } { @@ -1037,13 +1040,21 @@ ::tclreadline::errorMsg] } { error [list error during evaluation of `complete(${cmd})'] } # puts stderr \nscript_result=|${script_result}| - if {[string length ${script_result}] || \ + if {![string length ${script_result}] && \ "tclreadline_complete_unknown" == ${cmd} } { + # as we're here, the tclreadline_complete_unknown + # returned an empty string. Fall thru and try + # further fallback completers. + # + } else { + # return also empty strings, if + # they're from a specific completer. + # return ${script_result} } } # set namespc ""; # no qualifiers for tclreadline_complete_unknown } @@ -3014,11 +3025,11 @@ return "" } proc complete(time) {text start end line pos mod} { switch -- $pos { - 1 { return [DisplayHints