nixpkgs/pkgs/build-support/emacs
Alyssa Ross 0127013b0f
emacsWithPackages: mutate EMACSLOADPATH correctly
An empty entry in EMACSLOADPATH gets filled with the default value.
This is presumably why the wrapper inserted a colon after the entry it
added for the dependencies.  But this naive approach wasn't always
correct.

For example, if the user ran emacs with EMACSLOADPATH=foo, the wrapper
would insert the default value (by adding the trailing `:') even
though the user was trying to expressly opt out of it.

To do this correctly, here I've replaced makeWrapper with a bespoke
script that will actually parse the EMACSLOADPATH provided in the
environment (if given), and insert the wrapper's load path just before
the default value.  If EMACSLOADPATH is given but contains no default
value, we respect that and don't add the wrapped dependencies at all.
If no EMACSLOADPATH is given, we insert the wrapped dependencies
before the default value, just like before.  In this way, the wrapped
Emacs should now behave as if the wrapped dependencies were part of
Emacs's default load-path value.
2020-12-10 22:35:57 +00:00
..
buffer.nix
elpa2nix.el
elpa.nix
generic.nix emacs: Add native builds for nativeComp enabled emacsen 2020-07-24 03:16:17 +02:00
melpa2nix.el
melpa.nix treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
setup-hook.sh emacs: fix setup-hook 2020-04-02 23:04:08 +02:00
trivial.nix emacsPackagesNg.trivialBuild: cleanup and standardize function 2018-11-27 00:23:04 -05:00
wrapper.nix emacsWithPackages: mutate EMACSLOADPATH correctly 2020-12-10 22:35:57 +00:00
wrapper.sh emacsWithPackages: mutate EMACSLOADPATH correctly 2020-12-10 22:35:57 +00:00