From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20663 invoked by alias); 8 Sep 2014 11:16:23 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33129 Received: (qmail 2924 invoked from network); 8 Sep 2014 11:16:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Frank Terbeck To: Zsh Hackers' List Subject: Re: The default $fpath In-Reply-To: <20140908112328.24371de3@pwslap01u.europe.root.pri> (Peter Stephenson's message of "Mon, 08 Sep 2014 11:23:28 +0100") References: <540AF773.5080407@linux.intel.com> <20140906194513.5b19931c@pws-pc.ntlworld.com> <8761h05zvt.fsf@ft.bewatermyfriend.org> <20140907000454.74cda356@pws-pc.ntlworld.com> <140906204405.ZM18404@torch.brasslantern.com> <20140907193139.3bf3d3dc@pws-pc.ntlworld.com> <1410119582.2513.51.camel@tkkaskin-mobl3.ger.corp.intel.com.tanuk.dy.fi> <20140907214005.3190037b@pws-pc.ntlworld.com> <140907140122.ZM12385@torch.brasslantern.com> <20140908112328.24371de3@pwslap01u.europe.root.pri> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.93 (gnu/linux) Date: Mon, 08 Sep 2014 13:16:37 +0200 Message-ID: <87r3zm2wh6.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: NDMwNDQ0 Peter Stephenson wrote: > Bart Schaefer wrote: >> I can't think of any; presumably the configure-time (?) code for this >> would resemble >>=20 >> if [ X$ac_default_prefix !=3D X/usr/local ] >> then fixed_sitefndir=3D/usr/local/zsh/site-functions >> elif [ X$tzsh_name !=3D Xzsh ] >> then fixed_sitefndir=3D/usr/local/zsh/site-functions >> else fixed_sitefndir=3D'' >> fi >>=20 >> and then zsh.mdd would use something like >>=20 >> echo '#define FIXED_FPATH_DIR "'$(fixed_sitefndir)'"' >> zshpaths.h.= tmp; >>=20 >> and finally somewhere in Src/init.c the fpath would be prefixed with the >> value of FIXED_FPATH_DIR if it is non-empty. > > OK, so that's an answer to my other open question: you're suggesting (i) > if the prefix is /usr/local and this is a standard zsh installation > we keep things the way they are (ii) otherwise the new component is > the first thing to be tried in the default fpath. It should probably also check if --enable-site-fndir points to the location in =E2=80=98/usr/local=E2=80=99, not just =E2=80=98prefix=E2=80=99= . What would the order of these entries be? 1. Fixed site-functions (the new entry) 2. Prefix-based/--enable-site-fndir site-functions 3. Entries added by --enable-additional-fpath 4. All the rest of it, like it is now. I think that would make sense. That's basically the way it is right now, plus the fixed directory at the very front (unless it's the same as the old =E2=80=98site-functions=E2=80=99 location). >> The worst that happens is that /usr/local is a remote file system (which >> would seem rather unlikely) and zsh gets slowed down every time fpath is >> searched for a directory there that doesn't exist. > > Does seem a bit perverse... we could add a --disable-fixed-sitenfndir > for the paranoid. In other words, this is a simple boolean; either you > want the shell to be compatible with this pseudostandard, or you don't. That does sound like a plan, but I'd say that sysadmins for systems like that could also do: % zsh -fc 'print -l $fpath' ...filter out entries that would cause problems like that and set an amended $fpath in the global =E2=80=98zshenv=E2=80=99 file. I don't know wh= ich solution would be preferable... Regards, Frank