zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Matthew Martin <phy1729@gmail.com>, zsh-workers@zsh.org
Subject: Re: [PATCH] _compdef: Use zsh/param instead of a glob.
Date: Mon, 27 Aug 2018 18:47:35 +0000	[thread overview]
Message-ID: <1535395655.2206121.1487805120.6BC5EE06@webmail.messagingengine.com> (raw)
In-Reply-To: <CAH+w=7aMtnnkAYhs-JHC+W=GrSqwgbUPvSAAZ_HzWzz14o6AGA@mail.gmail.com>

Bart Schaefer wrote on Mon, 27 Aug 2018 11:22 -0700:
> On Mon, Aug 27, 2018 at 3:07 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > That said, if there is some way to generate a set of names that is less
> > complete but has fewer false positives, we could offer that set under
> > one tag and the ${(k)functions[(I)_*]} set under another tag, to allow
> > users to get their preferred way by setting the tag-order style.
> 
> The ${(k)functions[(I)_*]} set will only differ from the
> ${^fpath:/.}/_(|*[^~])(:t) set in two ways:
> (1) The fpath search will find functions that have not yet been marked autoload.
> (2) After autoload functions have been invoked for the first time
> ${(k)functions[(I)_*]} will have the additional functions from the
> base files.
> 
> Skipping (1) for only (2) might be considered just as much a loss as
> not including (2).

I suppose we could do both.

An fpath search could be expensive (it does I/O) but no one has
complained so let's assume the cost is acceptable.

> Also, ${(V)_comps} might be a more reasonable
> source of the extra functions.
> 

I like this.  That will filter out things in fpath that aren't completion
functions, and will filter in things like «compdef 'compadd -a foo' bar».

> > (Incidentally, I never understood why completion functions didn't use a
> > proper namespace, zshfoo_* or some such, like virtually everyone else —
> > but that ship has sailed.)
> 
> Can't say anybody was really thinking about needing function
> namespaces back then.  Miinimize length of identifiers and maximize
> similarity to the command for which the completion was being defined
> were pretty much the only things in mind.  Remember, this was pretty
> close to the era when commands like "ls", "rm", "mv", "ld", etc. were
> named.

Would that also be why all the variables in the C code are named as the
acronyms of whatever their names _should_ be? :-)


  reply	other threads:[~2018-08-27 18:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26 10:54 Daniel Shahaf
2018-08-27  1:09 ` Matthew Martin
2018-08-27 10:07   ` Daniel Shahaf
2018-08-27 18:22     ` Bart Schaefer
2018-08-27 18:47       ` Daniel Shahaf [this message]
2018-08-27 19:07         ` Bart Schaefer
2018-09-03 13:44 ` [PATCH v2] _compdef: Change and add sources for completed completion function names Daniel Shahaf

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=1535395655.2206121.1487805120.6BC5EE06@webmail.messagingengine.com \
    --to=d.s@daniel.shahaf.name \
    --cc=phy1729@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).