From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21525 invoked by alias); 19 Sep 2015 00:14:48 -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: 20594 Received: (qmail 24429 invoked from network); 19 Sep 2015 00:14:47 -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-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:mime-version:content-type; bh=eduKaTDDlJlcdumtwOe6Vf1xP7y/7DYjonIw/NRhdJc=; b=AZ/eq8fVJyxvrt1275YfVaTJazgappHAmDy1LhjnbJzkToLAR9rzu+CmymrnKbrgIH cdgrhvk5CX8IH6qJlYpo49QdmWkYj/jQ9sNsga5KhXOzHOJ6j+8hr1RwrhC2clsGbZDp tGpcnPdhCJ5SNt4clWPPoKT7l2t0fyPpTIwkThWFt7YGjpx5wA+IdRkpegNDqddDIFdM dmnmvC5iYpI26e7MBQkb6gi7e1dK03uTEzQFORgw2rLmB6HkrU6qEd62xzLQ1nCdzWvu dcetjuSbiAyfK8rLgBicQ7MRVNy7/zlxeCQ+vp8X4qKyHtiv2JqW0Oj9m/oOI+8zUqTI 4oWg== X-Gm-Message-State: ALoCoQnxLELJxAeISydcip3RR55As9PIxArhUVRnj+DE13MF8iddIv2i2tTAanDNtqj7jH3yOzAJ X-Received: by 10.60.36.202 with SMTP id s10mr5703953oej.0.1442621684699; Fri, 18 Sep 2015 17:14:44 -0700 (PDT) From: Bart Schaefer Message-Id: <150918171441.ZM27212@torch.brasslantern.com> Date: Fri, 18 Sep 2015 17:14:41 -0700 In-Reply-To: <150917103419.ZM10067@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: autoload" (Sep 17, 10:34am) References: <55FAE223.2080502@eastlink.ca> <150917103419.ZM10067@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: autoload MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii I decided I should clarify something: On Sep 17, 10:34am, Bart Schaefer wrote: } } I think the problem here is that you've put a .zwc file IN a directory } that is itself listed in $fpath. This is typically a no-no. You want } a .zwc file to be treated as if it WERE a directory, NOT as if it were } one of the function definition files IN the directory. This is not quite correct. I thought the situation was that we were talking about was fpath=(/path/to/Directory ...) /path/to/Directory/Directory.zwc # contains multiple functions This would be wrong. Instead it should be one of fpath=(/path/to/Directory ...) /path/to/Directory.zwc # contains multiple functions or fpath=(/path/to/Directory ...) /path/to/Directory/function.zwc # contains one function only In fact what Debian has done is the first of those two (correct) options, so my "typically a no-no" was off base. A third correct option would be fpath=(/path/to/Directory.zwc ...) which I prefer, but which skips comparing the modification time of that file to the files in /path/to/Directory/. The advantage is that the Directory itself need not exist, you can put the .zwc file anywhere. Now, here's the interesting twist to what Debian has done. They have fpath=(... /usr/share/zsh/functions/Completion ... /usr/share/zsh/functions/Completion/Base ...) with file /usr/share/zsh/functions/Completion/Base.zwc (among others). For autoload, this is ambiguous -- if someone tries to run a command named "Base", zsh searches /usr/share/zsh/functions/Completion/Base.zwc for that function, because it might be the "one function only" option described above. It won't find the function there, of course, so it will go on and look elsewhere and no one the wiser, and probably no one ever runs "Base" anyway. I don't want to claim there is anything wrong with Debian's choice, I merly point it out as a probably-unintended side effect.