zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Re: Backticks and other tricks
Date: Thu, 29 Mar 2001 10:14:38 +0200 (MET DST)	[thread overview]
Message-ID: <200103290814.KAA14298@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: =?iso-8859-1?q?Oliver=20Kiddle?='s message of Wed, 28 Mar 2001 16:20:53 +0100 (BST)


Oliver Kiddle wrote:

> --- Sven Wischnowsky <wischnow@informatik.hu-berlin.de> wrote: > 
> 
> > Anyway, what I really wanted to say (and that's why it's on
> > -workers): 
> > if you try this with a `&& return 0' after the `_arguments ...'
> > you'll 
> > notice that competion after, e.g. `-ef1:' yields nothing.  That's a
> > result of the change that removed the 300-return-value -- it has
> > added 
> > the option itself and hence `_arguments' returns zero.  Ugly.  Very.
> 
> I agree that it is a pity this can't be done anymore when you have
> state ->actions but I don't think it is as ugly as using
> compstate[nmatches] would be. We just have to use `&& ret=0' or similar
> and rely on checking of $state. The only other thing I can think of is
> modifying _main_complete to use compstate[nmatches] when deciding
> whether to move on to the next completer and allowing completion
> functions for commands to not bother about their return code. I'm not
> sure I like that though.

I'm sure I don't like it.  It would be quite sensible to write a
completer that adds something but return non-zero -- effectively
offering just some extra matches.

> > So for now let's use the patch below.  It adds the options only if
> > there is no `->state' action to use or if we are not in the same word
> > after the option.
> 
> I don't really understand this but it sounds like you're not going to
> be adding options in cases where they should be - options and states
> can both add matches together.

It not only sounds like that.  But it isn't as bad as it sounds,
actually I quite like it after thinking it over again.  The patch
makes be *not* completed only if 1) a `->state' action was executed
(i.e. prepared) *and* if 2) the matches for the `->state' have to be
completed in the same word after the option.

If the option-argument comes in its own word, options are completed.
The only case where the patch would cause trouble is that there are
two (or more) options, one being a prefix of the other and the
prefixish one gets an argument that has to come directly after the
option.  A *very* seldom case I would say.  And I would guess that in
most or all occurrences of such a situation the possible completions
for the option-argument are simple enough to not require a `->state'
action in which case this should work, too.

> Once we have this finalised, I will go through checking the return
> codes of functions (and adding -A "-*" and -S options to _arguments)
> but I don't have much time over the next two weeks.

I hope the return-value behaviour of _arguments is in the final form.

Bye
 Sven

P.S.: Why does your MUA put your name into =?iso-8859-1?...?= ?

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


             reply	other threads:[~2001-03-29  8:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29  8:14 Sven Wischnowsky [this message]
2001-03-29  8:47 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2001-03-29 14:09 Sven Wischnowsky
2001-03-29 16:43 ` Bart Schaefer
2001-03-28  9:49 Sven Wischnowsky
2001-03-28 15:20 ` Oliver Kiddle

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=200103290814.KAA14298@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.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).