unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fish: how to change the vendor_* directories
@ 2017-05-06  1:17 ng0
  2017-05-06  8:30 ` ng0
  0 siblings, 1 reply; 3+ messages in thread
From: ng0 @ 2017-05-06  1:17 UTC (permalink / raw)
  To: guix-devel

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?
-- 
https://pragmatique.xyz
PGP: https://people.pragmatique.xyz/ng0/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: fish: how to change the vendor_* directories
  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
  0 siblings, 1 reply; 3+ messages in thread
From: ng0 @ 2017-05-06  8:30 UTC (permalink / raw)
  To: guix-devel

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"

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/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: fish: how to change the vendor_* directories
  2017-05-06  8:30 ` ng0
@ 2017-05-06  8:33   ` ng0
  0 siblings, 0 replies; 3+ messages in thread
From: ng0 @ 2017-05-06  8:33 UTC (permalink / raw)
  To: guix-devel

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-06  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).