chiark / gitweb /
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 9800b0dfaa0fb052798b06d6dd35c2d13ba04259..c0d2fe2b5f9e05438735ca3858a4c2ab3e4e068f 100644 (file)
@@ -578,7 +578,7 @@      (define-key compilation-shell-minor-mode-map "\C-c\M-g" 'recompile)))
 
 (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 @@ (defadvice term-exec (before program-args-list compile activate)
 
 (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))