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.
(defadvice compile (around hack-environment compile activate)
"Hack the environment inherited by inferiors in the compilation."
(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))
(setenv "LD_PRELOAD" nil)
ad-do-it))
(defadvice term-exec-1 (around hack-environment compile activate)
"Hack the environment inherited by inferiors in the terminal."
(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."
(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))
(setenv "LD_PRELOAD" nil)
ad-do-it))