1#!@bash@
2
3IFS=:
4
5newLoadPath=()
6newNativeLoadPath=()
7addedNewLoadPath=
8addedNewNativeLoadPath=
9
10if [[ -n $EMACSLOADPATH ]]
11then
12 while read -rd: entry
13 do
14 if [[ -z $entry && -z $addedNewLoadPath ]]
15 then
16 newLoadPath+=(@wrapperSiteLisp@)
17 addedNewLoadPath=1
18 fi
19 newLoadPath+=("$entry")
20 done <<< "$EMACSLOADPATH:"
21else
22 newLoadPath+=(@wrapperSiteLisp@)
23 newLoadPath+=("")
24fi
25
26# NOTE: Even though we treat EMACSNATIVELOADPATH like EMACSLOADPATH in
27# this wrapper, empty elements in EMACSNATIVELOADPATH have no special
28# meaning for Emacs. Only non-empty elements in EMACSNATIVELOADPATH
29# will be prepended to native-comp-eln-load-path.
30# https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el?id=3685387e609753293c4518be75e77c659c3b2d8d#n599
31if [[ -n $EMACSNATIVELOADPATH ]]
32then
33 while read -rd: entry
34 do
35 if [[ -z $entry && -z $addedNewNativeLoadPath ]]
36 then
37 newNativeLoadPath+=(@wrapperSiteLispNative@)
38 addedNewNativeLoadPath=1
39 fi
40 newNativeLoadPath+=("$entry")
41 done <<< "$EMACSNATIVELOADPATH:"
42else
43 newNativeLoadPath+=(@wrapperSiteLispNative@)
44 newNativeLoadPath+=("")
45fi
46
47export EMACSLOADPATH="${newLoadPath[*]}"
48export emacsWithPackages_siteLisp=@wrapperSiteLisp@
49
50export EMACSNATIVELOADPATH="${newNativeLoadPath[*]}"
51export emacsWithPackages_siteLispNative=@wrapperSiteLispNative@
52
53export emacsWithPackages_invocationDirectory=@wrapperInvocationDirectory@
54export emacsWithPackages_invocationName=@wrapperInvocationName@
55
56exec @prog@ "$@"