From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27666 invoked by alias); 27 Jan 2016 16:43:21 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21190 Received: (qmail 14387 invoked from network); 27 Jan 2016 16:43:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79026d00000418a-b6-56a8f3a3663c Date: Wed, 27 Jan 2016 16:43:12 +0000 From: Peter Stephenson To: Zsh Users Subject: Re: Compinit tries a filename once Message-id: <20160127164312.029d0cd0@pwslap01u.europe.root.pri> In-reply-to: References: Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xK7qLP68IM/hymNtix8mVjA6MHqsO fmAKYIzisklJzcksSy3St0vgyvh8+gZbwT6eiq0zKhoYG7i6GDk5JARMJHb/vcgCYYtJXLi3 nq2LkYtDSGApo8TlpdeZIZxpTBKz9t2DypxjlHh3vIMRwjnLKLH33U6gMg4OFgFViWvb2EFG sQkYSkzdNJsRxBYRUJQ48+sbE4gtLKAt0TOxE2wdr4C9xMytd8HinALBErc2HgGLCwkESLy6 AxHnF9CXuPr3ExPEeUD1V84wQvQKSvyYfA+snllAS2LztiZWCFteYvOat8wQc9QlbtzdzT6B UXgWkpZZSFpmIWlZwMi8ilE0tTS5oDgpPddQrzgxt7g0L10vOT93EyMkmL/sYFx8zOoQowAH oxIP7439y8OEWBPLiitzDzFKcDArifBe+bQiTIg3JbGyKrUoP76oNCe1+BCjNAeLkjjv3F3v Q4QE0hNLUrNTUwtSi2CyTBycUg2MLT2+f5xqj9b9nFBWnBeW6VZxkz9E75zIm6efSiZw+wpo X7E4UBC15qu2Q2L7DaWaY9efxJVH68lNfDtdTsXvJb/cyWPMPXMmlEit6Z+u+eOV/qxs1sMN /FZue0KbTwkv9Zm4eeEZqwRG75h3wl9eTxAOY7/wvOXKf8lJ22b7/spcsSBz9zlFJZbijERD Leai4kQAByNWuGICAAA= On Wed, 27 Jan 2016 16:51:47 +0100 Sebastian Gniazdowski wrote: > If a fpath-added directory say ~/completions will contain empty file > "_cp", then this will block stock _cp from loading. I was removing > ~/.zcompdump. Should this work that way? If fpath is set up that like that, then autoloading the function will in any case (later on) find that first _cp, which will do nothing. So it makes perfect sense for compinit to stop once it's seen it, too. This is the standard case I'm talking about --- if your system can be smarter than that about autoloading, somehow, then in that case (but only that case) it would presumably make sense to enable compinit to be smarter, too. Then it needs to be told what logic you're applying to the autoload process to know what functions it needs to consider, e.g. by means of a predicate function. In case I've garbled that, what I mean is: - [At initialisation] compinit decides what functions to register as a completion function. - [The first time completion is started in that context] autoload decides how to load the function. The points I'm trying to make are (i) needs to be the same in both cases for consistency (ii) in normal operation, the autoload has a very simple, builtin rule for , deep down inside the shell --- grab the first file you see --- so compinit needs to do the same (iii) if you want to do better, you need to arrange for some more programmable form of to be shared by the two. Hope that's semi-clear... pws