zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: completion
Date: 19 Aug 1999 23:38:50 +0900	[thread overview]
Message-ID: <rsqyaf7bzt1.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Thu, 19 Aug 1999 12:44:34 +0200 (MET DST)"

In article <199908191044.MAA17903@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> 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<TAB>

->

is27e1u11% tst -l+ 
is27e1u11% pnmpad -l<TAB>

->

is27e1u11% pnmpad -l- 


`+' and `-' should not be completed, I think.

is27e1u11% pnmscale -height <TAB>

->

is27e1u11% pnmscale -height  

In this case, " " is completed. Is this intended behaviour?

is27e1u11% compconfig[message_format]='%d'
is27e1u11% compconfig[description_format]='%d'
is27e1u11% pnmcomp <TAB>

->

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


  reply	other threads:[~1999-08-19 14:39 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-19 10:44 Sven Wischnowsky
1999-08-19 14:38 ` Tanaka Akira [this message]
1999-08-24 13:46 ` Peter Stephenson
1999-08-19 13:59 Sven Wischnowsky
1999-08-20  7:42 Sven Wischnowsky
1999-08-20 12:59 Sven Wischnowsky
1999-08-20 23:22 ` Tanaka Akira
1999-08-21  8:39   ` Tanaka Akira
1999-08-21 17:47     ` Tanaka Akira
1999-08-23  9:32 Sven Wischnowsky
1999-08-23 10:54 ` Tanaka Akira
1999-08-23 12:00 Sven Wischnowsky
1999-08-23 13:46 Sven Wischnowsky
1999-08-23 16:16 ` Tanaka Akira
1999-08-24 15:56 ` Tanaka Akira
1999-08-24  9:12 Sven Wischnowsky
1999-08-24 10:04 ` Tanaka Akira
1999-08-24 10:43 Sven Wischnowsky
1999-08-25  1:56 ` Tanaka Akira
1999-08-25  8:24 Sven Wischnowsky
1999-08-26 10:54 ` Tanaka Akira
1999-08-25 12:54 Sven Wischnowsky
1999-08-25 12:57 Sven Wischnowsky
1999-08-26 12:20 Sven Wischnowsky
1999-08-26 13:17 ` Tanaka Akira
1999-08-26 17:56 ` Tanaka Akira
1999-08-26 13:52 Sven Wischnowsky
1999-08-27  7:03 Sven Wischnowsky
1999-08-27  8:29 ` Tanaka Akira
1999-08-28  6:01   ` Tanaka Akira
1999-08-30  9:30 Sven Wischnowsky
1999-10-26 11:03 Sven Wischnowsky
1999-10-26 17:17 ` Bart Schaefer
1999-10-26 17:22 ` Tanaka Akira
1999-10-26 17:32   ` Tanaka Akira
1999-10-26 13:01 Oliver Kiddle
1999-10-26 13:35 ` Zefram
1999-10-26 13:17 Sven Wischnowsky
1999-10-27  7:14 Sven Wischnowsky
1999-10-27 21:26 ` Tanaka Akira
1999-10-27  8:42 Sven Wischnowsky
1999-10-27 16:39 ` Bart Schaefer
1999-10-28  6:58 Sven Wischnowsky
1999-10-28  8:12 Sven Wischnowsky
2000-02-21  9:50 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rsqyaf7bzt1.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).