'(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
(mdw-define-face eshell-ls-readonly (t nil))
(mdw-define-face eshell-ls-symlink (t :foreground "cyan"))
+(defun mdw-eshell-hack () (setenv "LD_PRELOAD" nil))
+(add-hook 'eshell-mode-hook 'mdw-eshell-hack)
+
;;;--------------------------------------------------------------------------
;;; Messages-file mode.
(and mdw-auto-indent
(indent-for-tab-command)))
+(defadvice comint-line-beginning-position
+ (around mdw-calculate-it-properly () activate compile)
+ "Calculate the actual line start for multi-line input."
+ (if (or comint-use-prompt-regexp
+ (eq (field-at-pos (point)) 'output))
+ ad-do-it
+ (setq ad-return-value
+ (constrain-to-field (line-beginning-position) (point)))))
+
(defun mdw-setup-m4 ()
;; Inexplicably, Emacs doesn't match braces in m4 mode. This is very
(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: ")