2020-12-09 16:53:10 +01:00
|
|
|
#!@bash@
|
|
|
|
|
|
|
|
IFS=:
|
|
|
|
|
|
|
|
newLoadPath=()
|
2020-11-16 20:24:29 +01:00
|
|
|
newNativeLoadPath=()
|
2020-12-09 16:53:10 +01:00
|
|
|
added=
|
|
|
|
|
|
|
|
if [[ -n $EMACSLOADPATH ]]
|
|
|
|
then
|
|
|
|
while read -rd: entry
|
|
|
|
do
|
|
|
|
if [[ -z $entry && -z $added ]]
|
|
|
|
then
|
|
|
|
newLoadPath+=(@wrapperSiteLisp@)
|
|
|
|
added=1
|
|
|
|
fi
|
|
|
|
newLoadPath+=("$entry")
|
|
|
|
done <<< "$EMACSLOADPATH:"
|
|
|
|
else
|
|
|
|
newLoadPath+=(@wrapperSiteLisp@)
|
|
|
|
newLoadPath+=("")
|
|
|
|
fi
|
|
|
|
|
2020-11-16 20:24:29 +01:00
|
|
|
if [[ -n $EMACSNATIVELOADPATH ]]
|
|
|
|
then
|
|
|
|
while read -rd: entry
|
|
|
|
do
|
|
|
|
if [[ -z $entry && -z $added ]]
|
|
|
|
then
|
|
|
|
newNativeLoadPath+=(@wrapperSiteLispNative@)
|
|
|
|
added=1
|
|
|
|
fi
|
|
|
|
newNativeLoadPath+=("$entry")
|
|
|
|
done <<< "$EMACSNATIVELOADPATH:"
|
|
|
|
else
|
|
|
|
newNativeLoadPath+=(@wrapperSiteLispNative@)
|
|
|
|
newNativeLoadPath+=("")
|
|
|
|
fi
|
|
|
|
|
2020-12-09 16:53:10 +01:00
|
|
|
export EMACSLOADPATH="${newLoadPath[*]}"
|
emacsWithPackages: don't tell sub-Emacs about pkgs
If I'm running an Emacs executable from emacsWithPackages as my main
programming environment, and I'm hacking on Emacs, or the Emacs
packaging in Nixpkgs, or whatever, I don't want the Emacs packages
from the wrapper to show up in the load path of that child Emacs. It
results in differing behaviour depending on whether the child Emacs is
run from Emacs or from, for example, an external terminal emulator,
which is very surprising.
To avoid this, pass another environment variable containing the
wrapper site-lisp path, and use that value to remove the corresponding
entry in EMACSLOADPATH, so it won't be propagated to child Emacsen.
2020-12-07 19:53:54 +01:00
|
|
|
export emacsWithPackages_siteLisp=@wrapperSiteLisp@
|
2020-12-09 16:53:10 +01:00
|
|
|
|
2020-11-16 20:24:29 +01:00
|
|
|
export EMACSNATIVELOADPATH="${newNativeLoadPath[*]}"
|
|
|
|
export emacsWithPackages_siteLispNative=@wrapperSiteLispNative@
|
|
|
|
|
2022-04-03 19:28:23 +02:00
|
|
|
exec @prog@ -l cl-loaddefs -l nix-generated-autoload "$@"
|