zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-users@zsh.org
Subject: Re: PATCH: funcstack[-1]  (formerly Suppress tracing of "set +x")
Date: Fri, 05 Feb 2016 17:32:39 +0000	[thread overview]
Message-ID: <20160205173239.249fc48f@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <160205092038.ZM29758@torch.brasslantern.com>

On Fri, 05 Feb 2016 09:20:38 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> My concern is that $_tags_level is initialized to 0 in _main_complete
> and then compared to $#funcstack later.  If $#funcstack is now always no
> less than 1, that will be wrong.

Hmmm... I'm not convinced this *particular* example is a killer.  As I
said, the completion system doesn't care what functions are on top of
it. So 0 is just "a safe value that can't be as much as what we're
going to get to to when we start running completion functions".  So
actually it's fine as it is.  (Any completion function will always see
at least 1 with the current code because of the way the system works
and we never guarantee at what level you're going to reach the
nitty gritty.)

> Of course we can fix _main_complete to initialize to 1, but this does
> imply that comparisons to $#funcstack are not an unknown programming
> technique.

Indeed, that was basically my question, although actually it should have
been the slightly more subtle "are *absolute* comparisons to
${#funcstack}, as opposed to differences, used", which is still
plausible.

pws


  reply	other threads:[~2016-02-05 17:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30 10:45 Suppress tracing of "set +x" Dominik Vogt
2015-12-30 15:30 ` Martijn Dekker
2015-12-30 15:55   ` Dominik Vogt
2016-02-05 10:09   ` Dominik Vogt
2016-02-05 10:16     ` Dominik Vogt
2016-02-05 10:27     ` Peter Stephenson
2016-02-05 10:44       ` Peter Stephenson
2016-02-05 16:02         ` PATCH: funcstack[-1] (formerly Suppress tracing of "set +x") Peter Stephenson
2016-02-05 16:14           ` Bart Schaefer
2016-02-05 16:46             ` Peter Stephenson
2016-02-05 17:20               ` Bart Schaefer
2016-02-05 17:32                 ` Peter Stephenson [this message]
2016-02-05 10:37     ` Suppress tracing of "set +x" Martijn Dekker
2016-02-05 18:48     ` Bart Schaefer
     [not found] ` <5683F898.7010907__5021.31003090671$1451490149$gmane$org@inlv.org>
2016-01-01 18:36   ` Stephane Chazelas

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=20160205173239.249fc48f@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-users@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).