Yuri | 25 Jun 21:52

Why TCL interactive interpreter tries to auto-complete commands that were bound by the application to C functions?

I defined my own command 'g'.
When this command is in a script file it's executed fine in a batch.
But when I try to type it in interactive mode I get this:

% g
ambiguous command name "g": get gets glob global glut

Why it does this and how do I disable this auto-completion?

Yuri

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Neil Madden | 25 Jun 23:55

Re: Why TCL interactive interpreter tries to auto-complete commands that were bound by the application to C functions?

Hi Yuri,

This list is for discussion of the development of Tcl itself. For  
general usage questions, try the comp.lang.tcl newsgroup. But see  
below for an answer to your question.

On 25 Jun 2008, at 20:53, Yuri wrote:
> I defined my own command 'g'.
> When this command is in a script file it's executed fine in a batch.
> But when I try to type it in interactive mode I get this:
>
> % g
> ambiguous command name "g": get gets glob global glut
>
>
> Why it does this and how do I disable this auto-completion?

The auto-completion is done by the unknown command mechanism in  
interactive mode. This is usually handled by a proc called ::unknown,  
so you can either redefine that or (in 8.5+) use [namespace unknown]  
to set it to a different command, e.g.

  proc HandleUnknown {name args} { error "invalid command name \"$name 
\"" }
  namespace unknown HandleUnknown

Be aware, though, that the default unknown handler does more than  
just auto-completion.

However, the unknown command handler is only called if a command with  
(Continue reading)

Jeff Hobbs | 26 Jun 01:31

Re: Why TCL interactive interpreter tries to auto-complete commands that were bound by the application to C functions?

Yuri wrote:
> I defined my own command 'g'.
> When this command is in a script file it's executed fine in a batch.
> But when I try to type it in interactive mode I get this:
> 
> % g
> ambiguous command name "g": get gets glob global glut
> 
> 
> Why it does this and how do I disable this auto-completion?

set ::tcl_interactive 0

Jeff

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

Gmane