zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: problem with _arguments
Date: Thu, 27 Jul 2000 09:17:03 +0200 (MET DST)	[thread overview]
Message-ID: <200007270717.JAA15601@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Adam Spiers's message of Wed, 26 Jul 2000 21:24:48 +0100


Adam Spiers wrote:

> I'm trying to write a very simple completion for a function, with the
> following requirements:
> 
>  - the function has one optional option '-l' with no parameter
>  - the first parameter can't be completed
>  - subsequent parameters are files
> 
> AFAICS from the docs, the completion function should be something
> like:
> 
> _foo () {
>   _arguments \
>     '-l[message for option]' \
>     ':description for first param: ' \
>     '*:description for files:_files'
> }
> 
> But with the latest CVS:
> 
> $ foo -<TAB>
> $ foo -
> ---- description for first param
> 
> What am I doing wrong, or is it a bug?

Au, verflucht. _main_complete forced listing when a _message was added 
and there were less than two matches. Unfortunately, it forced
message-only listing, so the option just wasn't shown.

The patch will make it show the message and the option, which is what
should have been done before. If this is good or if it should only
complete the option is a different question. Hm. Hm?

Bye
 Sven

Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.37
diff -u -r1.37 _main_complete
--- Completion/Core/_main_complete	2000/07/13 11:04:00	1.37
+++ Completion/Core/_main_complete	2000/07/27 07:16:39
@@ -266,7 +266,7 @@
   fi
 elif [[ nm -le 1 && -n "$_comp_mesg" ]]; then
   compstate[insert]=''
-  compstate[list]='list force messages'
+  compstate[list]='list force'
 elif [[ nm -eq 0 && -z "$_comp_mesg" &&
         $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] &&
      zstyle -s ":completion:${curcontext}:warnings" format format; then

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-07-27  7:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-27  7:17 Sven Wischnowsky [this message]
2000-07-27  8:10 ` Bart Schaefer

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=200007270717.JAA15601@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).