zsh-workers
 help / color / mirror / code / Atom feed
From: "Zefram" <zefram@tao.co.uk>
To: wischnow@informatik.hu-berlin.de (Sven Wischnowsky)
Cc: zsh-workers@math.gatech.edu
Subject: Re: completion behaviour (was: zsh-workers: zsh-3.1.5 released)
Date: Mon, 2 Nov 1998 11:29:15 +0000 (GMT)	[thread overview]
Message-ID: <199811021129.LAA11861@diamond.tao.co.uk> (raw)
In-Reply-To: <199811021036.LAA22116@beta.informatik.hu-berlin.de> from "Sven Wischnowsky" at Nov 2, 98 11:36:33 am

Sven Wischnowsky wrote:
>We had some discusssion about a new way to define completion behaviour 
>which (seemingly) settled on: let's use shell functions and offer a
>few new builtins. So, if I implement this, do we really want the
>changes to compctl (note: I mean compctl, most of the changes in the
>completion code itself would be used anyway) or should we leave
>compctl alone and offer the new possibilities through the new way to
>define completion behaviour, thereby giving some incentive to switch
>to the new way?

I wondered about this myself, but came to the conclusion that new
completion features should be made available via compctl until the new
interface has been implemented.  After the new interface is in place we
can freeze compctl.

>We use zle widgets, probably a new kind of widgets that uses some more 
>special variables, like:

We can have a single widget that acts as the main interface to completion,
creating these variables and calling user-defined widgets to do the
real work.

>To make the definition and calling of completion functions for certain
>commands easier there could be a new builtin, say `compfunc':

I'm not convinced by this.  I'd rather get associative arrays working,
and use a non-special array to store this information.  I'd like the user
to be able to totally redefine the way that completions are associated
with command names.

>For producing the actual matches there is another builtin, say
>`compadd'. For simplicity we could make it use the same flags
>`compctl' uses now, but without `-x', `+', and the like, i.e. only the 
>simple match-producing flags. This would allow us to re-use most of
>the code for compctl and since only the simple flags would be
>supported, the irritating part of compctl would not be inherited.

Yes, this is good.  I was wondering how to make the match structures
user accessible.  Using the compctl-style interface to build up a
specially-handled list of matches solves this, and gives the user access
to the full power of the completion system.

OTOH, I think this perhaps should be split into two builtins.  One to
add sets of matches in a manner based on the compctl syntax (this could
even be part of the compctl module, and use the compctl code to handle
*all* the compctl options).  Another, more basic builtin would merely
provide an interface for adding a single match (or a set of matches),
with options to separately control each part of the match structure.

>is a problem with this: with compctl the `-x' - tests not only test
>for a certain condition, but also report some information back,
>namely: the length of an prefix that should be ignored in the
>completion string

This should be part of the match structure, and the user should be able
to control it explicitly.

-zefram


  parent reply	other threads:[~1998-11-02 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-02 10:36 Sven Wischnowsky
1998-11-02 10:39 ` Peter Stephenson
1998-11-02 11:29 ` Zefram [this message]
1998-11-02 12:00   ` Sven Wischnowsky
1998-11-02 12:31     ` Zefram
1998-11-02 13:48       ` Sven Wischnowsky
1998-11-03 15:58         ` new completion behaviour version 2 Sven Wischnowsky
1998-11-03 17:15           ` Bart Schaefer
1998-11-06 19:02           ` 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=199811021129.LAA11861@diamond.tao.co.uk \
    --to=zefram@tao.co.uk \
    --cc=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).