Currently, compile, term, shell, eshell, but there may be more.
Basically, places where Emacs runs user commands rather than its own
made-up stuff.
'(progn
(define-key compilation-shell-minor-mode-map "\C-c\M-g" 'recompile)))
'(progn
(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))
+ (setenv "LD_PRELOAD" nil)
+ ad-do-it))
+
(defun mdw-compile (command &optional directory comint)
"Initiate a compilation COMMAND, maybe in a different DIRECTORY.
The DIRECTORY may be nil to not change. If COMINT is t, then
(defun mdw-compile (command &optional directory comint)
"Initiate a compilation COMMAND, maybe in a different DIRECTORY.
The DIRECTORY may be nil to not change. If COMINT is t, then
(mdw-define-face eshell-ls-readonly (t nil))
(mdw-define-face eshell-ls-symlink (t :foreground "cyan"))
(mdw-define-face eshell-ls-readonly (t nil))
(mdw-define-face eshell-ls-symlink (t :foreground "cyan"))
+(defun mdw-eshell-hack ()
+ (when mdw-preload-hacks
+ (setenv "LD_PRELOAD" nil)))
+(add-hook 'eshell-mode-hook 'mdw-eshell-hack)
+
;;;--------------------------------------------------------------------------
;;; Messages-file mode.
;;;--------------------------------------------------------------------------
;;; Messages-file mode.
(ad-set-arg 2 (car program))
(ad-set-arg 4 (cdr program))))))
(ad-set-arg 2 (car program))
(ad-set-arg 4 (cdr program))))))
+(defadvice term-exec-1 (around hack-environment compile activate)
+ "Hack the environment inherited by inferiors in the terminal."
+ (let ((process-environment 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))
+ (setenv "LD_PRELOAD" nil)
+ ad-do-it))
+
(defun ssh (host)
"Open a terminal containing an ssh session to the HOST."
(interactive "sHost: ")
(defun ssh (host)
"Open a terminal containing an ssh session to the HOST."
(interactive "sHost: ")