diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-09-04 15:49:51 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-09-04 15:49:51 +0000 |
commit | 2a5becfb51236b09579de6cde203f47c489f2b0e (patch) | |
tree | 1b3e4b397c343b1fc74a3aa7fce7ad115206f2da /lisp/env.el | |
parent | 8d1fcd004ff6582e87b658da8e1d0d637e46fc0e (diff) | |
download | emacs-2a5becfb51236b09579de6cde203f47c489f2b0e.tar.gz |
(setenv): Interactively, if VARIABLE has a current value,
add that to the front of the history, as the doc string says.
Diffstat (limited to 'lisp/env.el')
-rw-r--r-- | lisp/env.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/env.el b/lisp/env.el index 1824bd378ce..58e830beaa1 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) |