zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: return value for comp{add,gen}
Date: Thu, 4 Mar 1999 10:33:53 +0100 (MET)	[thread overview]
Message-ID: <199903040933.KAA02235@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Thu, 4 Mar 1999 10:21:15 +0100 (MET)


( I just accidentally typed C-c C-c too early... )

I wrote:

> The patch below makes `compadd' and `compgen' return zero if matches
> were added and non-zero otherwise. With that Andrej's proposed
> 
>   compgen -g '*.c' || compgen -f
> 
> works.

I have not changed the return value since I think the `compctl was
found' is the most important think to know about when using it. And
since this will be called in a rather top-levellish way in most cases, 
the simple test `(( compstate[nmatches] ))' should be enough.

Also, I'm not too sure about the `compstate[last_nmatches]' Andrej
suggested. The exact number is seldom of interest and if it is, the
shell code is simple enough, I think.

As for the convention of using `matches were added' as the condition
to set the return values of the example functions: yes, I like
this. After a somwhat cursory glance at some of the function I even
think that this wouldn't required too many changes (since most
functions call `comp{add,gen}' or helper functions like `_files' at
the end).

Bye
 Sven


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


             reply	other threads:[~1999-03-04  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-04  9:33 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-03-05  7:59 Sven Wischnowsky
1999-03-04  9:21 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=199903040933.KAA02235@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).