From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 748 invoked from network); 2 Aug 1999 18:03:19 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 2 Aug 1999 18:03:19 -0000 Received: (qmail 11142 invoked by alias); 2 Aug 1999 18:03:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7350 Received: (qmail 11135 invoked from network); 2 Aug 1999 18:03:10 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: Completion problems. References: <199908021058.MAA12713@beta.informatik.hu-berlin.de> MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 03 Aug 1999 03:03:05 +0900 In-Reply-To: Sven Wischnowsky's message of "Mon, 2 Aug 1999 12:58:55 +0200 (MET DST)" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article <199908021058.MAA12713@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > That's wrong, too. Again, this is a problem with the recently changed > quoting behaviour. The prefix is reported in quoted form and appended > and prepended to IPREFIX/ISUFFIX -- which will be quoted again when it > is inserted. Thanks. It is fixed. But such a unquoting/re-quoting seems bit problematic with variables. Z(3):akr@is27e1u11% Src/zsh -f is27e1u11% fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst is27e1u11% _tst () { compset -P '*/'; compadd tst } is27e1u11% var=val is27e1u11% tst $var/ Then, the last line is changed to: is27e1u11% tst \$var/tst I think automatic unquoting/re-quoting is dangerous. Since the completion code works on quoted form and unquoted form is only interesting to usual completers, definitely the conversion between these forms is required. But it is sometimes very difficult or even impossible. In following examples, unquoted forms are not known until runtime. % if some-complex-command; then var=xxx; else var=yyy; fi; tst $var/ % tst $(some-complex-command)/ So, I think that it is dangerous decision to embed the quoting stuff into the completion code. I think that it is right way to separate the quoting stuff to builtin or variable expansion. Also, I don't like re-quoting such as: % tst a'#'/ -> % tst a\#/... My expectation to completion is simply inserting something into cursor position. So re-quoting surprise me. If the quoting stuff is separated, customizing these behaviours may be easier. Also, making the quoting stuff usable from completers is useful for checking the array words. For example, currentry, following does not work because contents of words are quoted form and $words[2] is "'-d'". % cvs '-d' If _cvs can unquote the word safely, _cvs can determin options more precisely. (Although we can use eval, I think eval is evil.) -- Tanaka Akira