zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: Moving completion functions
Date: Thu, 15 Mar 2001 20:50:37 +0000	[thread overview]
Message-ID: <3AB12B1D.7D48636A@u.genie.co.uk> (raw)

Bart Schaefer wrote:

> The question to ask is, what's our primary purpose in splitting them up?
> Is it to allow selective installation?  (The original reason for BSD/ and
> AIX/, I think.)  Is it to help us as developers decide where to put new
> ones?  To help users decide what should be in $fpath?  To help users 
> and developers understand how the system works?

>From the perspective of an installation as opposed to the distribution,
I think the selectively filled $fpath is the key useful purpose of
splitting them up. From the perspective of the distribution the logical
separation of commands into types, utilities and completers etc is
useful.

For this reason, I favour the approach of leaf directories being used
for the logical separation and non-leaf directories being used for
useful installation-specific separations. Then on installation, the
logical separations (leaf directories) are ditched.

> me important for understanding to subdivide Base/ as you did.  On the
> other hand, the only reason I can see for splitting Unix/Command into
> more specific directories would be for selective installation, and I'm
> not sure that's important enough.

My main reasons for considering splitting Unix/Command would be for
selective choice of functions but other than our current divisions (X,
Bsd etc), I wouldn't bother unless Unix/Commands contains a lot of
files. It is certainly worth thinking about now while we are doing a
rename though.

> I think I'd also rename _set_options and _unset_options as _options_on
> and _options_off respectively.  In a similar vein, consider _labels_all
> and _labels_next, _matches_all, _parts_multi, _parts_sep, _cache_store,
> _cache_retrieve, _jobs_bg, _jobs_fg, ...  (I have a tendency to want
> related files to group together in a sorted listing, but in some cases
> [like _all_matches and _dir_list] I waffle because the readability of
> the calling scripts will suffer.  I also wouldn't use _options_diff
> because the relationship to _diff is the more important one.  Etc.)

This seems like a good idea to me. _combination could possibly have a name that
groups it with _parts_{sep,multi}. I'd not change _all_matches and _dir_list
though because of the readability.

> The script looks good.

Yes, it does. Cheers Sven.

> On a slightly related note, I was wondering whether it's worthwhile to
> create Cygwin/Type/_path_files that includes Andrej's suggestions about
> calling cygdrive, etc.  Then we'd have to make sure that Cygwin
> appeared
> first in $fpath with --enable-function-subdirs, but was installed
> *after*
> Unix without it ... it's also possible that netscape has different
> options
> when executed under cygwin, so we'd need Cygwin/Command/_netscape, etc.

We're going to get many more problems of this sort once we have more
platform specific completions. Linux has it's own lsdev for example
which fortunately doesn't take arguments so the AIX one doesn't get in
its way too much. I wouldn't be suprised if this becomes messy once
IBM finishes it's lvm for Linux if it get's widely adopted for Linux
because my AIX completions will probably half work but have the same
names. I could come up with numerous other examples and have no doubt
that separate directories for the purpose of overloading our namespace
is going to be essential.

This is why my preference remains having no option on installation
(i.e. no options like --enable-function-subdirs) and with functions all
installed into the (non-leaf) directories.

Why have most other people not used --enable-function-subdirs? If it is
because it is quicker to get at the functions with less, vi or whatever
then maybe we should extend equals expansion to expand for autoloaded
functions to their full location in $fpath?

I'm fairly sure that I've said it before but I don't like it that
running zsh, even with -f sets my $fpath to a whole load of things. The
completion functions should be *added* by compinit. To see why I
emphasise added, try the following:
fpath=/whatever zsh
and watch as your .zshrc can't find compinit and has lots of other
errors.

To further explain my reasoning; we install the functions in
/usr/local/share, not /usr/local/lib. This means that we should be
prepared for the functions to be *shared* between different computers,
each of which may run a different operating system. For this reason,
the installation should/could include AIX, Linux, etc directories. But,
supposing we add something like a cgywin _path_files or a Linux _lsdev,
we would want to be sure that we are using the correct one. If the
installation can include Aix, Cygwin etc then we can't rely on
performing this separation during a make install. compinit could check
$OSTYPE and use some intelligence about what it adds to $fpath. In
addition, we could maybe pass compinit options, for example, -x X -i
RedHat if we want to exclude X and include redhat because maybe we used
rpm but didn't use X. promptinit and zfinit would also be responsbile
for their fpath additions.

When I last moaned about $fpath being set, it was probably together
with the why is compinit autoloaded and not sourced question. The most
compelling answer was because of the need for autoload -U to avoid
aliases. We now have the noalias option so compinit could be sourced.
As for the how do we find compinit question, we'd have a variable named
something like $fundir which zsh would automatically set to point to
its location.

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre. For further information visit
http://www.messagelabs.com/stats.asp


             reply	other threads:[~2001-03-15 20:51 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-15 20:50 Oliver Kiddle [this message]
2001-03-16 12:09 ` Peter Stephenson
2001-03-17 23:16 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2001-03-30 14:00 Sven Wischnowsky
2001-03-30 15:12 ` Bart Schaefer
2001-03-29  9:33 Sven Wischnowsky
2001-03-29 16:49 ` Bart Schaefer
2001-03-28 14:12 Sven Wischnowsky
2001-03-28 16:14 ` Bart Schaefer
2001-03-28 16:20   ` Peter Stephenson
2001-03-26 14:16 Sven Wischnowsky
2001-03-26  8:53 Sven Wischnowsky
2001-03-22 21:46 Oliver Kiddle
2001-03-22 21:50 ` Oliver Kiddle
2001-03-23  0:29 ` Bart Schaefer
2001-03-25 15:26   ` Oliver Kiddle
2001-03-25 20:39     ` Peter Stephenson
2001-03-26  4:33     ` Bart Schaefer
2001-03-22 10:40 Sven Wischnowsky
2001-03-22 11:03 ` Peter Stephenson
2001-03-22 17:04 ` Bart Schaefer
2001-03-21 11:42 Sven Wischnowsky
2001-03-20 21:32 Oliver Kiddle
2001-03-21  9:58 ` Bart Schaefer
2001-03-19  9:46 Sven Wischnowsky
2001-03-22  7:21 ` Bart Schaefer
2001-03-18 22:20 Oliver Kiddle
2001-03-19  4:36 ` Bart Schaefer
2001-03-16 17:27 Oliver Kiddle
2001-03-16 10:20 Sven Wischnowsky
2001-03-18  2:39 ` Bart Schaefer
2001-03-15 15:46 Oliver Kiddle
2001-03-15 18:14 ` Bart Schaefer
2001-03-15 10:43 Sven Wischnowsky
2001-03-15  9:30 Sven Wischnowsky
2001-03-15 10:33 ` Peter Stephenson
2001-03-15 17:04 ` 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=3AB12B1D.7D48636A@u.genie.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.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).