From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: fish: how to change the vendor_* directories Date: Sat, 6 May 2017 08:33:18 +0000 Message-ID: <20170506083318.wfqv3ffsz5br6ck5@abyayala> References: <20170506011701.s7zdfjrtid62hwfb@abyayala> <20170506083037.5mxibu74iykkwiuf@abyayala> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6v9i-0001O2-1P for guix-devel@gnu.org; Sat, 06 May 2017 04:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6v9e-0004xA-SA for guix-devel@gnu.org; Sat, 06 May 2017 04:33:34 -0400 Received: from fragranza.investici.org ([2a00:1dc0:2479::19]:28142) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d6v9e-0004wg-L0 for guix-devel@gnu.org; Sat, 06 May 2017 04:33:30 -0400 Received: from [178.175.144.26] (fragranza [178.175.144.26]) (Authenticated sender: niasterisk@grrlz.net) by localhost (Postfix) with ESMTPSA id F33FD2C012B for ; Sat, 6 May 2017 08:33:27 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20170506083037.5mxibu74iykkwiuf@abyayala> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org ng0 transcribed 3.3K bytes: > ng0 transcribed 0.7K bytes: > > Today I noticed that my fish completions don't work if you install th= em from > > within guix. > > They do work if they are in one of the scanned directories, which inc= ludes and used to be > > ~/.config/fish/completions/ where I symlinked my developer copy to. > > So I just learned about ${PREFIX}/share/fish/vendor_functions.d being= one of the directories > > which is intended for third party addons. > > We can not change fish to pick up $HOME/.guix-profile/share/fish/vend= or_functions.d, at least > > not from what I tried in 5 minutes. Vim was easier, you are able to s= et a path manually. > > Any suggestions on how we can hack this? Maybe simply extend the SEAR= CH PATH? >=20 > Okay, I tried this: >=20 > user@abyayala ~/s/g/guix> git diff > diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm > index 6f06acfa4..2b0199e12 100644 > --- a/gnu/packages/shells.scm > +++ b/gnu/packages/shells.scm > @@ -138,6 +138,10 @@ direct descendant of NetBSD's Almquist Shell (@com= mand{ash}).") > (substitute* "share/functions/__fish_print_help.fish" > (("nroff") (which "nroff"))) > #t))))) > + (native-search-paths > + (list (search-path-specification > + (variable "fish_function_path") > + (files '("share/fish/vendor_functions.d"))))) > (synopsis "The friendly interactive shell") > (description > "Fish (friendly interactive shell) is a shell focused on interact= ive use, >=20 > this leads to (at guix package -i fish): >=20 > The following environment variable definitions may be needed: > export fish_function_path=3D"/home/user/.guix-profile/share/fish/ven= dor_functions.d${fish_function_path:+:}$fish_function_path" which leads us to: user@abyayala ~> echo $fish_function_path /gnu/store/xh4nlpwwacgsj4q7llvb8ly2525kd26g-profile/share/fish/vendor_fun= ctions.d /gnu/store/3bmrbk8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fis= h/functions if fish inherits from bash which previously sourced the .guix-profile/etc= /profile file. > where it should be: >=20 > set fish_function_path foo foo foo foo ourdir >=20 > in your fish config. So we basically must output the default (see below= ) > and prepend the native-search-path we added. > Because fish has a different syntax than bash it won't work like output > at the end, but of course fish (if you don't change any defaults and yo= ur > user shell is bash) inherits variables of bash. So this might work in > this special case but not the case where fish is your system shell, whi= ch > I'd honestly not recommend with guix. Or I would recommend it, so that = we > can see what errors could be produced. I simply start fish from bash. >=20 > file: "share/config.fish" in FISH source: >=20 > if not set -q fish_function_path > set fish_function_path $configdir/fish/functions $__fish_sysconfdir/fun= ctions $__extra_functionsdir $__fish_datadir/functions >=20 > file: "configure.ac": > =E2=80=A6 > [extra_completionsdir=3D$withval], > [extra_completionsdir=3D'${datadir}/fish/vendor_completions= .d']) >=20 > AC_SUBST(extra_functionsdir) > [extra_functionsdir=3D$withval], > [extra_functionsdir=3D'${datadir}/fish/vendor_functions.d']= ) > =E2=80=A6 >=20 > at the moment this leads to: >=20 > [user@abyayala ~]$ fish > user@abyayala ~> echo $fish_function_path > /home/user/.config/fish/functions /etc/fish/functions /gnu/store/3bmrbk= 8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fish/vendor_functions.d /gnu/= store/3bmrbk8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fish/functions >=20 > We could simply tell the users of this shell to update this manually OR= hack it *somehow* > into the defaults of fish. >=20 > I'd prefer a solution with native-search-patch. > --=20 > https://pragmatique.xyz > PGP: https://people.pragmatique.xyz/ng0/ >=20 --=20 https://pragmatique.xyz PGP: https://people.pragmatique.xyz/ng0/