Let's say I want to use elisp functions in a script .
I rely in my script on some library, dash
which I require.
#!/usr/local/bin/emacs --script
(require 'dash)
(message (describe-variable 'load-path))
As is, I will get
$ ./loader.sh
Cannot open load file: No such file or directory, dash
What is the simplest way to make a set of packages accessible to an elisp environment used in a script ?
PS : The equivalent for haskell, using nix, would be
#! /usr/bin/env nix-shell
#! nix-shell -i runghc -p "haskellPackages.ghcWithPackages(p: with p; [type-level-sets])"
#! nix-shell -I nixpkgs=channel:nixos-18.03
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import Data.Type.Set (Set(..), Proxy(..))
class Get a s where
get :: Set s -> a
instance {-# OVERLAPS #-} Get a (a ': s) where
get (Ext a _) = a
instance {-# OVERLAPPABLE #-} Get a s => Get a (b ': s) where
get (Ext _ xs) = get xs
main :: IO ()
main = do
let lst = Ext "hello" $ Ext 10 $ Empty
putStrLn $ show $ get @String lst