]> code.delx.au - gnu-emacs/blobdiff - lisp/comint.el
(comint-exec-1): Force a local copy of the environment.
[gnu-emacs] / lisp / comint.el
index b76aacfc57e8a140e8735e36fb9914e14ba16ba5..0bb6116c31ad15bd4f17ea03d780cea1f05e628b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; comint.el --- general command interpreter in a window stuff
 
-;; Copyright (C) 1988, 1990, 1992, 1993 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1990, 1992, 1993, 1994 Free Software Foundation, Inc.
 
 ;; Author: Olin Shivers <shivers@cs.cmu.edu>
 ;; Adapted-by: Simon Marshall <s.marshall@dcs.hull.ac.uk>
@@ -159,7 +159,7 @@ Good choices:
 
 This is a good thing to set in mode hooks.")
 
-(defvar comint-input-autoexpand 'history
+(defvar comint-input-autoexpand nil
   "*If non-nil, expand input command history references on completion.
 This mirrors the optional behavior of tcsh (its autoexpand and histlit).
 
@@ -574,7 +574,7 @@ buffer.  The hook `comint-exec-hook' is run after each exec."
 ;;; the appropriate environment.
 
 (defun comint-exec-1 (name buffer command switches)
-  (let ((process-environment process-environment))
+  (let ((process-environment (copy-sequence process-environment)))
     (setenv "TERMCAP" (format "emacs:co#%d:tc=unknown" (frame-width)))
     (setenv "TERM" "emacs")
     (setenv "EMACS" "t")
@@ -1418,13 +1418,12 @@ Does not delete the prompt."
   "Display start of this batch of interpreter output at top of window.
 Also put cursor there if the current position is not visible."
   (interactive)
+  (push-mark)
   (let ((pos (point)))
-    (goto-char comint-last-input-end)
+    (goto-char (or (marker-position comint-last-input-end) (point-max)))
     (beginning-of-line 0)
     (set-window-start (selected-window) (point))
-    (if (pos-visible-in-window-p pos)
-       (goto-char pos)
-      (comint-skip-prompt))))
+    (comint-skip-prompt)))
 
 (defun comint-interrupt-subjob ()
   "Interrupt the current subjob."