aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2001-09-04 15:49:51 +0000
committerGerd Moellmann <[email protected]>2001-09-04 15:49:51 +0000
commit2a5becfb51236b09579de6cde203f47c489f2b0e (patch)
tree1b3e4b397c343b1fc74a3aa7fce7ad115206f2da
parent8d1fcd004ff6582e87b658da8e1d0d637e46fc0e (diff)
(setenv): Interactively, if VARIABLE has a current value,
add that to the front of the history, as the doc string says.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/env.el9
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 07e1404eff..e063015ef8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2001-09-04 Gerd Moellmann <[email protected]>
+ * env.el (setenv): Interactively, if VARIABLE has a current value,
+ add that to the front of the history, as the doc string says.
+
* comint.el (comint-send-input): Change help-echo.
From "Dr Francis J. Wright" <[email protected]>.
diff --git a/lisp/env.el b/lisp/env.el
index 1824bd378c..58e830beaa 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -1,6 +1,6 @@
;;; env.el --- functions to manipulate environment variables
-;; Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2000, 2001 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: processes, unix
@@ -62,11 +62,14 @@ This function works by modifying `process-environment'."
(interactive
(if current-prefix-arg
(list (read-envvar-name "Clear environment variable: " 'exact) nil t)
- (let ((var (read-envvar-name "Set environment variable: " nil)))
+ (let* ((var (read-envvar-name "Set environment variable: " nil))
+ (value (getenv var)))
+ (when value
+ (push value setenv-history))
;; Here finally we specify the args to give call setenv with.
(list var (read-from-minibuffer (format "Set %s to value: " var)
nil nil nil 'setenv-history
- (getenv var))))))
+ value)))))
(if unset (setq value nil))
(if (string-match "=" variable)
(error "Environment variable name `%s' contains `='" variable)