Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: (backward-)kill-argument (1/2 thanks 1/2 problem re-statement)

On Mar 15,  4:49pm, Michal Marus<ka wrote:
} I immagine Zsh keeps a database (roughly) like:

No, zsh keeps no database.  The syntax of every command is described by
a "completion function" which is written for that specific command.
There are a few other functions that describe generic types of syntax
that can be shared by many commands, but ultimately the only "database"
that zsh uses is a hash mapping a context (either a command name, or
something like -redirect- for what follows a redirection operator) to
a function that computes the completions for that context.

There is nothing that describes the syntax to the editor for purposes of
reversing this mapping, so the editor can't use the "knowledge" that the
completion system has of individual command contexts to perform syntactic
analysis of the edited text.  It only has access to the generic parsing
rules of the (extended) Bourne shell scripting language used by the shell

Something like what you describe could be created in the same way that
the completion system itself was created -- built up one function at a time
for all the possible contexts that you want to recognize and operate on --
but it does not currently exist.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   

Messages sorted by: Reverse Date, Date, Thread, Author