zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: Re: PATCH: Re: expansion
Date: Thu, 15 Jun 2000 15:54:23 +0100	[thread overview]
Message-ID: <3948EE1F.E4451C61@u.genie.co.uk> (raw)
In-Reply-To: <200006150826.KAA05864@beta.informatik.hu-berlin.de>

Sven Wischnowsky wrote:
> 
> Yes, I think I said that the patterns could do with a little improvement.

Yes, and there is still scope for more improvements. Does anyone know
which characters terminate a parameter reference which doesn't use
braces?

> 2) Not using `recexact' as the style name was, of course, intentional,
>    because it really isn't about `recognising', is it? It's about
>    accepting the exact match (it will always take an exact match as
>    one of the possible matches[1]).
>    And accept-exact has the same meaning as recexact, we don't need to
>    reverse it.

Functionally, I can't see that there is a difference between recexact
and accept-exact. Are you basically saying that acceptexact would have
been a better name for the option as well?

> [1] Has anyone else wished he had a style to say `complete anything
>     *but* an exact match'?
>     We already have ignore-line... we could extend that.

It took me a little while to work out what you mean by that but I can
see that it might be useful because someone might feel that they are
only going to press tab if they want to complete something.

It seems to me that the choices are that if the current line is an exact
but ambiguous match, there are three choices: match only the current
exact match, match all matches or match all but the current exact match
so maybe a style with three possible values would be better.

I actually got quite confused while trying to work out what happens in
different situations because of the line in _expand which prevents
substitutions expanding if they expand to an empty string and I was
using an empty variable. Maybe _expand should display a message in this
case.

> I didn't change that even now because I've regretted these
> `mathematically conditional' styles for quite some time now. They
> should be turned into boolean styles and the condition should come
> from somewhere else, e.g. the -e option to zstyle I suggested (see
> 11691).

I meant to reply to that at the time because it seems like a good idea.
It would certainly be a lot cleaner if any sort of evaluations are built
in to zstyle and don't have to be repeated in completion functions.

What exactly do you mean by the word evaluated when you say that 'the
resulting string will be evaluated' in the documentation in the patch:
is the idea that you would use a function. How would this affect the
functions which can be used for tag-order (which, if you remember I use
to avoid completing commands with an empty word). For styles whose
values are arrays, it would be useful to be able to return $value/$reply
as an array.

On the subject of the _expand not doing brace expansion, Sven wrote:

> Change (e)? Use `eval echo ...'? Urgh?

I think it would be a bad idea to change (e) and the eval is going to be
slow. I think I said it before a while ago but it would be nice if there
was clearly defined ways to do the various types of expansion,
individually or together. A (b) to do brace expansion might solve the
brace problem but we would maybe have fewer problems in _expand if there
was syntax like (e:pab:) to do parameter, arithmetic and brace expansion
with other letters for things like ~, =, history, command and whatever
other expansions we have.

This would have some problems though: expansions which expand to things
which can be further expanded for example but I'd have thought these
have all be addressed in the code before. The other trouble with
expansion as a part of completion is that completion by definition deals
with things which are incomplete so we have the problem of what to do
with things which aren't syntactically correct yet. For example, try:
a(<tab> and you will get '_expand:78: bad pattern: a(' because of the
lack of a closing bracket.

Oliver


  parent reply	other threads:[~2000-06-15 14:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-15  8:26 Sven Wischnowsky
2000-06-15  9:13 ` Bart Schaefer
2000-06-15  9:22   ` Peter Stephenson
2000-06-15 14:54 ` Oliver Kiddle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-06-16 11:22 Sven Wischnowsky
2000-06-16 12:20 ` Peter Stephenson
2000-06-16  7:30 Sven Wischnowsky
2000-06-15 15:15 Sven Wischnowsky
2000-06-15 15:32 ` Bart Schaefer
2000-06-15  9:40 Sven Wischnowsky
2000-06-15  9:09 Sven Wischnowsky
2000-06-14 16:07 Oliver Kiddle
2000-06-14 18:34 ` Peter Stephenson
2000-06-08  8:37 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=3948EE1F.E4451C61@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --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).