summary refs log tree commit diff
path: root/pkgs/build-support/emacs
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-12-07 18:53:54 +0000
committerAlyssa Ross <hi@alyssa.is>2020-12-10 22:52:31 +0000
commit23d4bfb6661ca57a9e331a2cf4184232d38ac38b (patch)
tree6c67fa81d21424490e1ce3c3f748983c195ce770 /pkgs/build-support/emacs
parent0127013b0f2a27ee8eec886283948648ef66fbf0 (diff)
downloadnixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar.gz
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar.bz2
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar.lz
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar.xz
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.tar.zst
nixpkgs-23d4bfb6661ca57a9e331a2cf4184232d38ac38b.zip
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.
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r--pkgs/build-support/emacs/wrapper.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/build-support/emacs/wrapper.sh b/pkgs/build-support/emacs/wrapper.sh
index 85657ac5619..96c9a8a60ea 100644
--- a/pkgs/build-support/emacs/wrapper.sh
+++ b/pkgs/build-support/emacs/wrapper.sh
@@ -22,5 +22,6 @@ else
 fi
 
 export EMACSLOADPATH="${newLoadPath[*]}"
+export emacsWithPackages_siteLisp=@wrapperSiteLisp@
 
 exec @prog@ "$@"