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

Re: How to complete backquote, etc. using compsys?



[Redirected to -workers]

On Aug 28, 10:36am, Oliver Kiddle wrote:
} Subject: Re: How to complete backquote, etc. using compsys?
}
} Bart Schaefer wrote:
} > 
} > On Aug 23, 10:49am, Oliver Kiddle wrote:
} > }
} > } No, you didn't miss an option. The new completion system just doesn't
} > } complete the backquote.  [...]  At the moment, I don't think the shell
} > } code can tell if it is in $( .. )
} > 
} > Yes, it can tell that it's in $(...) or `...`.
} 
} compstate[quote] and compstate[quoting] indicate if it is in `...` but
} how can it tell it's in $(...)?

Hmm, at the moment perhaps it doesn't, but it could look at $LBUFFER to
find out.

} The level of nesting would also be useful.

It should be easy to add a special parameter that gives the same info
as the %_ prompt expansion.  I tried ${(%):-%_} but (not surprisingly)
the parser stack isn't "live" during the execution of the completion
function.

} [...] it would be useful to have the backquote as a removable
} suffix because it is quicker to press space than backquote.

The problem is that you end up with too many layers of autoremovable
suffixes.  When completing a path name within backticks, you can't
get both the trailing / on a directory name and the trailing backtick.

} Also, without multios the closing
} bracket of $(<...) should always be completed.

It would have to be an autoremovable suffix, too; `echo $(<file wc)' is
a silly example of why.

-- 
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