all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ng0 <contact.ng0@cryptolab.net>
To: guix-devel@gnu.org
Subject: Re: fish: how to change the vendor_* directories
Date: Sat, 6 May 2017 08:33:18 +0000	[thread overview]
Message-ID: <20170506083318.wfqv3ffsz5br6ck5@abyayala> (raw)
In-Reply-To: <20170506083037.5mxibu74iykkwiuf@abyayala>

ng0 transcribed 3.3K bytes:
> ng0 transcribed 0.7K bytes:
> > Today I noticed that my fish completions don't work if you install them from
> > within guix.
> > They do work if they are in one of the scanned directories, which includes 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/vendor_functions.d, at least
> > not from what I tried in 5 minutes. Vim was easier, you are able to set a path manually.
> > Any suggestions on how we can hack this? Maybe simply extend the SEARCH PATH?
> 
> Okay, I tried this:
> 
> 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 (@command{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 interactive use,
> 
> this leads to (at guix package -i fish):
> 
> The following environment variable definitions may be needed:
>    export fish_function_path="/home/user/.guix-profile/share/fish/vendor_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_functions.d /gnu/store/3bmrbk8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fish/functions

if fish inherits from bash which previously sourced the .guix-profile/etc/profile file.

> where it should be:
> 
> set fish_function_path foo foo foo foo ourdir
> 
> 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 your
> 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, which
> 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.
> 
> file: "share/config.fish" in FISH source:
> 
> if not set -q fish_function_path
> set fish_function_path $configdir/fish/functions $__fish_sysconfdir/functions $__extra_functionsdir $__fish_datadir/functions
> 
> file: "configure.ac":
> …
> [extra_completionsdir=$withval],
>             [extra_completionsdir='${datadir}/fish/vendor_completions.d'])
> 
> AC_SUBST(extra_functionsdir)
>             [extra_functionsdir=$withval],
>             [extra_functionsdir='${datadir}/fish/vendor_functions.d'])
> …
> 
> at the moment this leads to:
> 
> [user@abyayala ~]$ fish
> user@abyayala ~> echo $fish_function_path
> /home/user/.config/fish/functions /etc/fish/functions /gnu/store/3bmrbk8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fish/vendor_functions.d /gnu/store/3bmrbk8c2a03y2b31gcv67n0bh3div7z-fish-2.5.0/share/fish/functions
> 
> We could simply tell the users of this shell to update this manually OR hack it *somehow*
> into the defaults of fish.
> 
> I'd prefer a solution with native-search-patch.
> -- 
> https://pragmatique.xyz
> PGP: https://people.pragmatique.xyz/ng0/
> 

-- 
https://pragmatique.xyz
PGP: https://people.pragmatique.xyz/ng0/

      reply	other threads:[~2017-05-06  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-06  1:17 fish: how to change the vendor_* directories ng0
2017-05-06  8:30 ` ng0
2017-05-06  8:33   ` ng0 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170506083318.wfqv3ffsz5br6ck5@abyayala \
    --to=contact.ng0@cryptolab.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.