From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22179 invoked from network); 19 Aug 1999 14:39:35 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Aug 1999 14:39:35 -0000 Received: (qmail 20863 invoked by alias); 19 Aug 1999 14:39:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7451 Received: (qmail 20855 invoked from network); 19 Aug 1999 14:39:07 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: completion References: <199908191044.MAA17903@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: 19 Aug 1999 23:38:50 +0900 In-Reply-To: Sven Wischnowsky's message of "Thu, 19 Aug 1999 12:44:34 +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 <199908191044.MAA17903@beta.informatik.hu-berlin.de>, Sven Wischnowsky writes: > - I didn't change `_complete_opts' and `_cvs'. But I think the first > one should 1) be renamed (to `_short_options'?) because the > `complete' is implicit in all other function names and 2) it > should be changed to get its descriptions in the same format as > `_arguments' and `_long_options' (and should use `_message' and > `_description'). I agree that `complete_opts' is bad name. But many commands accept both short and long options, there should be a completer that handle both. I feel `_arguments' is very good as basis of that. Is it easy to extend `_arguments' to handle short options? # If it is available, I'll throw `complete_opts' away. > Ok. I don't know if you like this grouping/description stuff, all > comments are welcome. Is there a way to disable options completion until a user insert `-' explicitly? I like the behaviour since some commands have many options and they may bury completions for non-option arguments. And, I found some problems. Z(2):akr@is27e1u11% Src/zsh -f is27e1u11% fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst is27e1u11% _tst () { _arguments '-l+:left border:' '-format:paper size:(letter A4)' '*-copy:output file:_files::resolution:(300 600)' ':postscript file:_files -g *.(ps|eps)' '*:page number:' } is27e1u11% tst -l -> is27e1u11% tst -l+ is27e1u11% pnmpad -l -> is27e1u11% pnmpad -l- `+' and `-' should not be completed, I think. is27e1u11% pnmscale -height -> is27e1u11% pnmscale -height In this case, " " is completed. Is this intended behaviour? is27e1u11% compconfig[message_format]='%d' is27e1u11% compconfig[description_format]='%d' is27e1u11% pnmcomp -> is27e1u11% pnmcomp option overlay file -alpha Config/ Misc/ config.cache configure.in -invert Doc/ README config.guess* install-sh* -xoff Etc/ Src/ config.h mkinstalldirs* -yoff Functions/ StartupFiles/ config.h.in stamp-h CVS/ INSTALL Util/ config.log stamp-h.in ChangeLog META-FAQ acconfig.h config.status* ChangeLog.3.0 Makefile aclocal.m4 config.sub* Completion/ Makefile.in aczsh.m4 configure* Although I don't know completion group behaviour well, I feel this very strange because options and files are mixed. Also, I found some typos. Index: Completion/Core/_message =================================================================== RCS file: /projects/zsh/zsh/Completion/Core/_message,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _message --- _message 1999/08/19 11:18:29 1.1.1.1 +++ _message 1999/08/19 13:49:30 @@ -3,7 +3,7 @@ local format format="$compconfig[message_format]" -[[ -z "$format" ]] && "$compconfig[description_format]" +[[ -z "$format" ]] && format="$compconfig[description_format]" if [[ -n "$format" ]]; then if [[ $compstate[nmatches] -eq 0 ]]; then Index: Completion/Pbmplus/_pbmtoepsi =================================================================== RCS file: /projects/zsh/zsh/Completion/Pbmplus/_pbmtoepsi,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _pbmtoepsi --- _pbmtoepsi 1999/08/19 11:18:45 1.1.1.1 +++ _pbmtoepsi 1999/08/19 13:49:30 @@ -1,3 +1,3 @@ #compdef pbmtoepsi -_arguments '--bbonly' ':file: _pbmfile' +_arguments '-bbonly' ':file: _pbm_file' Index: Completion/Pbmplus/_pktopbm =================================================================== RCS file: /projects/zsh/zsh/Completion/Pbmplus/_pktopbm,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _pktopbm --- _pktopbm 1999/08/19 11:18:46 1.1.1.1 +++ _pktopbm 1999/08/19 13:49:30 @@ -1,4 +1,4 @@ #compdef pktopbm -_arguments ':pk file:_file -g *.(#i)pk' '-c:character number:' \ +_arguments ':pk file:_files -g *.(#i)pk' '-c:character number:' \ '*:file: _pbm_file' Index: Completion/Pbmplus/_yuvtoppm =================================================================== RCS file: /projects/zsh/zsh/Completion/Pbmplus/_yuvtoppm,v retrieving revision 1.1.1.1 diff -u -F^( -r1.1.1.1 _yuvtoppm --- _yuvtoppm 1999/08/19 11:18:47 1.1.1.1 +++ _yuvtoppm 1999/08/19 13:49:30 @@ -1,3 +1,3 @@ #compdef yuvtoppm -_arguments ':width:' ':height:' 'image bytes:' +_arguments ':width:' ':height:' ':image bytes:' Index: Doc/Zsh/compsys.yo =================================================================== RCS file: /projects/zsh/zsh/Doc/Zsh/compsys.yo,v retrieving revision 1.1.1.16 diff -u -F^( -r1.1.1.16 compsys.yo --- compsys.yo 1999/08/19 11:18:51 1.1.1.16 +++ compsys.yo 1999/08/19 13:49:30 @@ -924,6 +924,7 @@ (with the `tt(-J)' option), but if the o separate argument after the option, a plus sign should be used instead. Finally, if the option may be given more than once, a star (`tt(*)') should be added in front of the var(opt-spec). +) enditem() In each of the cases above, the var(action) says how the possible # I made a patch for patch-2.5.3 that add options to make it cvs-diff aware. # http://www.ldl.jaist.ac.jp/~akr/junk/patch-2.5.3-cvsaware-19990815.patch -- Tanaka Akira