Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject:cc
         :mime-version;
        bh=+D4nGL1Fpgoe8W3migDCwMqEhnGkSuhvnksz9KVsHyc=;
        b=IZ7I4bHiufS3geALqFyPg7ZR6SH0KfNxNTKWd+367uxyNlvbfAlJ5MH+ewxMw8/PuG
         bIQXVwZe1G41UafAh7h4V3+9mCyXddFQeZzf+S41eHwoXi3i+2XS9etLxsgtylETGtX0
         zPj2XjMdW9Qy0D9uQwVOVlWI6gnmH2NKw22/8dTD6KwIDGEZ5TOeY4kzLa9jeNEEQ+WE
         im4vNFPgSV+wDLA+eEzoh9pXBBC5vjx5AfI0hTlNFc+Jg4RtpNYWyrVNr4un51M1KVhr
         TbbH8Kpmo9lp5VB/HGHUmgirjrA/GCSOiRJaYrMYs8SIj07zyGAyWJpyUm5iW/IqxvLU
         1IVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:cc:mime-version;
        bh=+D4nGL1Fpgoe8W3migDCwMqEhnGkSuhvnksz9KVsHyc=;
        b=NKxFzWWEl2mReK6mdOzCuPaAayFPpcaCwaBfTAIuByMEEtTgbX2ZPrjJ6et2Tel2aO
         1VCZDX4NBTIwjUmINhJ9Kh049g/LJJkDNd67ivBteuSHqS1xpmuU2jum1S1dnSZLhnbO
         YKZNhsKkiBQP3VpbEK0xQdTU/F0bLYm+BjZSMZ0OmQrGrKwNUJCP/NkS/r7jIo66LDyS
         mWEYBuEDzTEb8n4Xg/XiHnMU8IBMTaTSvcKOwT0uTiRcMGyyYsSphTs/XF5v0fCuTZbs
         yLs7X0uAkAaLDGw2BI4fnwKZqx9vxh1gA0a6aB7l0xZqzSr8geAq9fsqxVYk5RdjWtIV
         VbrA==
X-Gm-Message-State: AOPr4FX8Ve+PpX9bdSZEX/5qVcGfxoaavOs2bDlRw0lKufoPJCVNQ+GVstHq5MVqgDQPbw==
X-Received: by 10.66.253.68 with SMTP id zy4mr34203834pac.81.1460781069741;
        Fri, 15 Apr 2016 21:31:09 -0700 (PDT)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160415213113.ZM22069@torch.brasslantern.com>
Date: Fri, 15 Apr 2016 21:31:13 -0700
In-Reply-To: <12614.1460767375@thecus.kiddle.eu>
Comments: In reply to Oliver Kiddle <okiddle@yahoo.co.uk>
        "Re: Problem after upgrade from 4.3 to 5.2" (Apr 16,  2:42am)
References: <57116948.903@mail.se>  <12614.1460767375@thecus.kiddle.eu>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: zsh-workers@zsh.org
Subject: Use of "enable" in compsys (Re: Problem after upgrade from 4.3 to 5.2)
Cc: Henrik Johansson <henrik.johansson.kank@mail.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 38289

On Apr 16,  2:42am, Oliver Kiddle wrote:
} Subject: Re: Problem after upgrade from 4.3 to 5.2
}
} Henrik Johansson wrote:
} >
} > After upgrade of zsh I got a problem with completion.
} > In this example I write 'ls -l .z<TAB>
} >
} > server.user 1045> ls -l .zenable: printer "-p" non-existent
} 
} There's a name clash for "enable" / "disable" between the shell builtins
} and external commands for enabling/disabling printers.

Seems like there ought to be a way to invoke a disabled builtin, at least
in the case of enable, but we can easily avoid Henrik's error.  Additional
changes below are to use explicit semicolons on all lines in _comp_setup,
I'm not sure why those were used on some of them but not others, but it
seems prudent to have them.

diff --git a/Completion/compinit b/Completion/compinit
index 4b9a778..6612bac 100644
--- a/Completion/compinit
+++ b/Completion/compinit
@@ -167,11 +167,11 @@ _comp_options=(
 typeset -gH _comp_setup='local -A _comp_caller_options;
              _comp_caller_options=(${(kv)options[@]});
              setopt localoptions localtraps localpatterns ${_comp_options[@]};
-             local IFS=$'\'\ \\t\\r\\n\\0\''
-             enable -p \| \~ \( \? \* \[ \< \^ \#
+             local IFS=$'\'\ \\t\\r\\n\\0\'';
+             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;
              exec </dev/null;
-             trap - ZERR
-             local -a reply
+             trap - ZERR;
+             local -a reply;
              local REPLY'
 
 # These can hold names of functions that are to be called before/after all

-- 
Barton E. Schaefer

