el/dot-emacs.el: Preserve environment properly when clearing `LD_PRELOAD'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 2 Aug 2019 14:49:10 +0000 (15:49 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 2 Aug 2019 17:18:57 +0000 (18:18 +0100)
Just binding `process-environment' isn't enough, because `setenv'
mutates the list-structure in place.  Take a complete copy, just to be
sure.

Otherwise, compiling something prevents SLIME from starting up properly.

el/dot-emacs.el

index 9800b0d..c0d2fe2 100644 (file)
@@ -578,7 +578,7 @@ Pretend they don't exist.  They might be on other display devices."
 
 (defadvice compile (around hack-environment compile activate)
   "Hack the environment inherited by inferiors in the compilation."
-  (let ((process-environment process-environment))
+  (let ((process-environment (copy-tree process-environment)))
     (setenv "LD_PRELOAD" nil)
     ad-do-it))
 
@@ -4033,13 +4033,13 @@ This allows you to pass a list of arguments through `ansi-term'."
 
 (defadvice term-exec-1 (around hack-environment compile activate)
   "Hack the environment inherited by inferiors in the terminal."
-  (let ((process-environment process-environment))
+  (let ((process-environment (copy-tree process-environment)))
     (setenv "LD_PRELOAD" nil)
     ad-do-it))
 
 (defadvice shell (around hack-environment compile activate)
   "Hack the environment inherited by inferiors in the shell."
-  (let ((process-environment process-environment))
+  (let ((process-environment (copy-tree process-environment)))
     (setenv "LD_PRELOAD" nil)
     ad-do-it))