zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: compadd option passing (Re: Completion function for bitkeeper?)
Date: Fri, 05 Dec 2003 12:08:28 +0100	[thread overview]
Message-ID: <2687.1070622508@gmcs3.local> (raw)
In-Reply-To: <1031119171855.ZM11248@candle.brasslantern.com>

I sent this two weeks ago and just realised that it never turned up on
the mailing list.

Bart wrote:

> } I agree that it isn't ideal. The best alternative I can think of would
> } be to pass compadd options to the various tag handling functions
> } instead of the completion functions.
> 
> That makes it harder for people writing simple completion functions to
> make use of the compadd options, though.  Maybe that never comes up, but
> it seems an unnecessary limitation.

True. But it could help other issues by doing more of the hard work
with picking out suffixes and descriptions and passing on only the
right stuff. Auto-removable suffixes especially stand to benefit if we
can store them at each stage. It needs a lot more thought though. 

> I suggest instead that we choose a single option (or other syntactic
> marker) that is documented as being passed to completion functions to
> delimit the compadd options from the any options of the function itself.
> E.g. soemthing like "everything between -o and a bare '-' is a compadd
> option":

> Alternately always pass the compadd options in an array parameter, and

Either do avoid name clashes but, to be honest, with all of this I think
either of those solutions are uglier than the situation we have at the
moment.

If we really want to clear it up in such a way, How about a
single `-' argument be defined as the start of (or end of?) compadd
options.

So you have to use for example.
  _sccs_files -e - -X 'sccs file'

If there is no `-' argument, it can assume that all options are compadd
options (which will be most function calls anyway).

_all_labels already looks for `-' in deciding where to put compadd
options so it'd also be the easiest to implement.

A possibility included in this is that we only do anything special for
`-' in _arguments actions (to clear up our initial space vs. { ... }
confusion).

Oliver


      reply	other threads:[~2003-12-05 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20031106153225.GA491@lorien.emufarm.org>
     [not found] ` <1281.1068232665@athlon>
     [not found]   ` <20031110182013.GA20547@lorien.emufarm.org>
     [not found]     ` <9219.1068538977@gmcs3.local>
     [not found]       ` <20031111162338.GD23138@lorien.emufarm.org>
     [not found]         ` <901.1068577572@athlon>
     [not found]           ` <20031111212828.GA28125@lorien.emufarm.org>
     [not found]             ` <29114.1068797096@gmcs3.local>
     [not found]               ` <20031114154608.GA6959@lorien.emufarm.org>
     [not found]                 ` <15744.1069084060@gmcs3.local>
     [not found]                   ` <20031117175151.GA24060@lorien.emufarm.org>
     [not found]                     ` <29608.1069237406@gmcs3.local>
2003-11-19 17:18                       ` Bart Schaefer
2003-12-05 11:08                         ` Oliver Kiddle [this message]

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=2687.1070622508@gmcs3.local \
    --to=okiddle@yahoo.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).