zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <borsenkow.msk@sni.de>
To: "Sven Wischnowsky" <wischnow@informatik.hu-berlin.de>,
	<zsh-workers@sunsite.auc.dk>
Subject: RE: change to __path_files and clean up of Functions/Completion needed
Date: Thu, 25 Feb 1999 16:32:26 +0300	[thread overview]
Message-ID: <001301be60c3$48911730$21c9ca95@mowp.siemens.ru> (raw)
In-Reply-To: <199902231026.LAA24103@beta.informatik.hu-berlin.de>


> >
> > I think, it is unacceptable. It is the same, as if users had to modify C
> > sources to change compctl behaviour.
>
> I don't think so. This is shell code after all.

O.K. I hope it is not too late.

The good old completion has some nice features:

1. It works out-of-the-box. Not setup is needed; immediately after
installing zsh users can start with compctl.

2. it is easy to modify completion on-the-fly. What is important, it is the
same command with the same syntax as used in startup files. It is
invariant - 'compctl $(compctl -L cd) cd' is noop as it should be.

3. it is easy to use. It is not a joke. Using compctl amounts simply to
listing what is considered a match - no shell programming is needed. It can
be used immediately after reading manual. (Please, I know about -K. But most
cases are actually quite simple). What's more important, no shell
porgramming is needed for extended/conditional completion. All is limited to
a single command.

4. (this is of more personal nature) It does not pollute namespace (why
don't we have anonymous functions :) It does not suddenly defines
variables/functions/aliases that a completion user is not interested in at
all (and probably, should not know of as well)

I think, it is time to decide, if we want new style completion be for
wizards only or intended for general user community. If it should be of
general use, it should be at least as easy to use, as compctl. Exactly for
these reasons my first reaction was to stay with compctl as a single entry
point and use new style completion to extend it's ability.

What I suggest, is some framework that IMHO makes new completion almost as
easy to use as compctl.

1. use separate array (cpath?) for a completion stuff. Mixing it with fpath
is probably a bad idea (at least, I suddenly get a bunch of autoloaded
functions that actually dont exist :)

2. automatically install at least run-time for new completion (and probably
the completion for zsh builtins) in standard system-wide location and
initialize cpath to point to this location

3. provide a single command to make life easier (compctl is taken, sigh)
This command would need at least

  init - initialize completion. Traverse cpath loading
         definitions. This would allow users to
         override system-wide completion by adding own
         directories to cpath after system location

  load - load a (single) definition. With options to read
         from stdio, single file or a directory. And may be
         directly as argument. Great for testing :)

  dump - printout of current definition(s) for selected command(s)
         (--default-- etc). This should be directly usable as input
         to load.

4. The run-time for completion stuff should _not_ require modification. Even
more so, because these functions are very close to winners of Obfuscated Zsh
Programming Contest :-)

This command should behave as function (or be implemented as such). This
allows to start with emulate -RL zsh, set all needed options (extendedglob
problem :), define any needed local variables without fear to stomp on
user's environment. Anything, that this function exports, should 'course be
documented.

In this case, all pluses of compctl are retained. Users can start with 'xxx
init' (with additional advantage, that they immediately get standard
completions for builtins), modify a simgle completion with 'xxx load' and
look at what's going on with 'xxx dump'.

I really admire the job, Sven, Peter and others have done to improve this
stuff. Let's give it a final touch ...

regards

/andrej


  reply	other threads:[~1999-02-25 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-25 15:02 Sven Wischnowsky
1999-02-25 16:42 ` completion cleanup discussion + patch Peter Stephenson
1999-02-23 10:26   ` change to __path_files and clean up of Functions/Completion needed Sven Wischnowsky
1999-02-25 13:32     ` Andrej Borsenkow [this message]
1999-02-26  6:39       ` completion cleanup discussion 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='001301be60c3$48911730$21c9ca95@mowp.siemens.ru' \
    --to=borsenkow.msk@sni.de \
    --cc=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).