From: Gerd Moellmann Date: Tue, 4 Sep 2001 15:49:51 +0000 (+0000) Subject: (setenv): Interactively, if VARIABLE has a current value, X-Git-Tag: emacs-pretest-21.0.106~245 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2a5becfb51236b09579de6cde203f47c489f2b0e;p=emacs.git (setenv): Interactively, if VARIABLE has a current value, add that to the front of the history, as the doc string says. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 07e1404eff4..e063015ef82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-09-04 Gerd Moellmann + * 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" . 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)