aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-09-04 15:49:51 +0000
committerGerd Moellmann2001-09-04 15:49:51 +0000
commit2a5becfb51236b09579de6cde203f47c489f2b0e (patch)
tree1b3e4b397c343b1fc74a3aa7fce7ad115206f2da
parent8d1fcd004ff6582e87b658da8e1d0d637e46fc0e (diff)
downloademacs-2a5becfb51236b09579de6cde203f47c489f2b0e.tar.gz
emacs-2a5becfb51236b09579de6cde203f47c489f2b0e.zip
(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 07e1404eff4..e063015ef82 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12001-09-04 Gerd Moellmann <gerd@gnu.org> 12001-09-04 Gerd Moellmann <gerd@gnu.org>
2 2
3 * env.el (setenv): Interactively, if VARIABLE has a current value,
4 add that to the front of the history, as the doc string says.
5
3 * comint.el (comint-send-input): Change help-echo. 6 * comint.el (comint-send-input): Change help-echo.
4 From "Dr Francis J. Wright" <F.J.Wright@qmw.ac.uk>. 7 From "Dr Francis J. Wright" <F.J.Wright@qmw.ac.uk>.
5 8
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 @@
1;;; env.el --- functions to manipulate environment variables 1;;; env.el --- functions to manipulate environment variables
2 2
3;; Copyright (C) 1991, 1994 Free Software Foundation, Inc. 3;; Copyright (C) 1991, 1994, 2000, 2001 Free Software Foundation, Inc.
4 4
5;; Maintainer: FSF 5;; Maintainer: FSF
6;; Keywords: processes, unix 6;; Keywords: processes, unix
@@ -62,11 +62,14 @@ This function works by modifying `process-environment'."
62 (interactive 62 (interactive
63 (if current-prefix-arg 63 (if current-prefix-arg
64 (list (read-envvar-name "Clear environment variable: " 'exact) nil t) 64 (list (read-envvar-name "Clear environment variable: " 'exact) nil t)
65 (let ((var (read-envvar-name "Set environment variable: " nil))) 65 (let* ((var (read-envvar-name "Set environment variable: " nil))
66 (value (getenv var)))
67 (when value
68 (push value setenv-history))
66 ;; Here finally we specify the args to give call setenv with. 69 ;; Here finally we specify the args to give call setenv with.
67 (list var (read-from-minibuffer (format "Set %s to value: " var) 70 (list var (read-from-minibuffer (format "Set %s to value: " var)
68 nil nil nil 'setenv-history 71 nil nil nil 'setenv-history
69 (getenv var)))))) 72 value)))))
70 (if unset (setq value nil)) 73 (if unset (setq value nil))
71 (if (string-match "=" variable) 74 (if (string-match "=" variable)
72 (error "Environment variable name `%s' contains `='" variable) 75 (error "Environment variable name `%s' contains `='" variable)