Commit 8b740009 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(read-envvar-name): Special meaning for MUSTMATCH

neither t nor nil.
(setenv): Use that new case, when clearing a var.
parent 37248de2
......@@ -35,7 +35,8 @@
(defun read-envvar-name (prompt &optional mustmatch)
"Read environment variable name, prompting with PROMPT.
Optional second arg MUSTMATCH, if non-nil, means require existing envvar name."
Optional second arg MUSTMATCH, if non-nil, means require existing envvar name.
If it is also not t, RET does not exit if it does non-null completion."
(completing-read prompt
(mapcar (function
(lambda (enventry)
......@@ -60,7 +61,7 @@ appears at the front of the history list when you type in the new value.
This function works by modifying `process-environment'."
(interactive
(if current-prefix-arg
(list (read-envvar-name "Clear environment variable: " t) nil t)
(list (read-envvar-name "Clear environment variable: " 'exact) nil t)
(let* ((var (read-envvar-name "Set environment variable: " nil))
(oldval (getenv var))
newval
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment