zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: expl not always local
Date: Thu, 02 Jun 2005 18:44:11 +0200	[thread overview]
Message-ID: <2817.1117730651@trentino.groupinfra.com> (raw)
In-Reply-To: <1050602152831.ZM12324@candle.brasslantern.com>

Bart wrote:
> Careful with these.  They may be expecting to be called in a context
> where the caller has declared expl as a local.
>
> In general, if a function file starts with #autload then it's a
> utility and should NOT declare completion system variables as locals,
> but if it starts with #compdef then it should declare them local.
> There are probably some exceptions, of course.

I disagree. The only way we should be passing stuff to #autoload (Type/)
functions is with the positional parameters.

These various type functions should do stuff like the following:

  local expl
  _wanted things expl 'thing' compadd -a "$@" - things

Note the single `-' after the "$@". That ensures that any passed
explanation takes precendence over the one defined here ("thing"). Many
of the functions don't do that however. In part because the single dash
feature wasn't there originally.

If the function is using compset to chop stuff into separate words then
it's own descriptions should be taking precendence.

The only variable I can think of where care needs to be taken is
curcontext, hence the use of:
	local curcontext="$curcontext"

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


  reply	other threads:[~2005-06-02 16:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-02 13:25 Doug Kearns
2005-06-02 15:28 ` Bart Schaefer
2005-06-02 16:44   ` Oliver Kiddle [this message]
2005-06-02 17:02     ` Bart Schaefer
2005-06-06 13:33       ` Doug Kearns
2005-06-06 16:24         ` Bart Schaefer
2005-06-06 17:26       ` Oliver Kiddle
2005-06-07 14:38     ` Oliver Kiddle
2005-06-06 13:33   ` Doug Kearns

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=2817.1117730651@trentino.groupinfra.com \
    --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).