zsh-users
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-users@sunsite.auc.dk
Subject: Re: how can one let completion work *inside* zsh scripts?
Date: Thu, 27 Jul 2000 15:21:07 +0200 (MET DST)	[thread overview]
Message-ID: <200007271321.PAA21840@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Matthias Kopfermann's message of Thu, 27 Jul 2000 14:42:05 +0200


Matthias Kopfermann wrote:

> > To zsh-workers (and everyone else interested): hm, is this becoming
> > FAQish enough to make is simplify it? For example we could allow
> > compcontext to be set to `foo()' to make it just call function
> > `foo'. And we could allow it to be set to an array and then make
> > completion offer its elements as possible completions.
> I am for it ! The easier the better. At least normally I
> tend to think that way.

I'll add something like this (mostly because it doesn't cost us
anything if compcontext isn't set).

But first some questions: _arguments and friends allow `(( 1\:foo 2\:bar ))'
to generate the matches `1' and `2' and make them be shown with
descriptions `foo' and `bar', respectively. That might be nice to have 
here, too, think.

But stuffing them all in one string isn't needed here. Hm. Maybe if
all string contain an (non-backslash-quoted) colon, take everything
before them as the matches and the stuff after them as the
descriptions. People would then have to remember to quote colons when
setting compcontext from something automatically generated such as
filenames (using globbing).

And then we should allow the calling function to register a
description string for the whole set of matches (the things one gets
by setting the format style).

But that almost suggest (at least to me, striving for consistency) to
put everything into a string of the form `<descr>:<action>', where
<action> is as in _arguments, i.e.:

  {...}               = evaluate `...'
  (1 2)               = complete `1' and `2'
  (( 1\:foo 2\:bar )) = complete `1' and `2' and describe them as
                        `foo' and `bar' in the list

Hm, is this going too far? Or should we use the array-based solution
and allow to give the description with another parameter?

Or should we just support compcontext-as-array without (a)
description(s) (and the `func()' form) and let user's use functions if 
they need descriptions?


Bye
 Sven


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


             reply	other threads:[~2000-07-27 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-27 13:21 Sven Wischnowsky [this message]
     [not found] <no.id>
2000-07-26 16:24 ` Matthias Kopfermann
2000-07-27 12:42 ` Matthias Kopfermann
2000-08-01 15:34 ` Matthias Kopfermann
  -- strict thread matches above, loose matches on Subject: below --
2000-07-26 12:00 Sven Wischnowsky
2000-07-26 10:57 Matthias Kopfermann

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=200007271321.PAA21840@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-users@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).