zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: coleman@math.gatech.edu (Richard Coleman)
Cc: zsh-workers@math.gatech.edu
Subject: Re: what should compctl's look like?
Date: Sun, 1 Dec 1996 18:54:59 +0000 (GMT)	[thread overview]
Message-ID: <19984.199612011855@stone.dcs.warwick.ac.uk> (raw)
In-Reply-To: <199612011808.NAA28822@redwood.skiles.gatech.edu> from "Richard Coleman" at Dec 1, 96 01:08:47 pm

>I agree with this.  Essentially compctl is a 'language within a language'.
>It would be nice to see this 'language' developed to be something less
>cryptic.  What what should it look like?

Aha, Richard once again hits the nail right on the head.  That is
exactly the question that I have been considering with respect to
compctls.

>Maybe someone could do some experiments with flex/lex and
>yacc/bison to see what might work.

I think we should avoid having a completely separate language.  We
already have an expressive general-purpose language -- the shell
command language itself.  I envisage an interface along these lines:

zcompctl '
  : some commands
  # (much like trap really)
  if [[ $WORD[2] == *z* ]]; then
    zcompctl -R *.(tgz|taz|tar.(gz|z|Z))
  else
    zcompctl -R *.tar
  fi
' tar

That is, the commands given in that first argument are executed as zsh
commands, and can register possible completions with an option to the
zcompctl command.  (Can anyone think of a better name for the
command?)  Access to the command line can be through an interface
intended for ZLE extension (another project I have some plans for).

The only problem with using the shell language is that, due to $IFS and
so on, it would be difficult to optimise the simplest cases, as we must
do for efficiency.  And interpreting shell commands for even moderately
complex compctls, currently done with the -x option to compctl, would
be inefficient.  Does anyone have any better ideas?

-zefram


  reply	other threads:[~1996-12-01 19:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-30 13:31 Autoloading of compctl from dbm database file Fung-Chai Lim
1996-11-30 16:40 ` Zefram
1996-11-30 23:16   ` Bart Schaefer
1996-12-01 12:55     ` Fung-Chai Lim
1996-12-01 14:02     ` Zefram
1996-12-01 17:41       ` Bart Schaefer
1996-12-01 18:08         ` what should compctl's look like? Richard Coleman
1996-12-01 18:54           ` Zefram [this message]
1996-12-01 18:38         ` Autoloading of compctl from dbm database file Zefram
1996-12-02 13:23         ` Fung-Chai Lim
1996-12-01 13:22   ` Fung-Chai Lim
1996-12-01 14:17     ` Zefram
1996-12-01 15:38       ` Fung-Chai Lim

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=19984.199612011855@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --cc=coleman@math.gatech.edu \
    --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).