[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master cd0817a: ; Improve documentation of 'with-environment-variables'
From: |
Eli Zaretskii |
Subject: |
master cd0817a: ; Improve documentation of 'with-environment-variables' |
Date: |
Sun, 26 Sep 2021 05:12:54 -0400 (EDT) |
branch: master
commit cd0817a0f7ea17ad7d1771224b5036b13b9f3815
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
; Improve documentation of 'with-environment-variables'
* lisp/env.el (with-environment-variables):
* doc/lispref/os.texi (System Environment): Improve the
documentation of 'with-environment-variables'.
---
doc/lispref/os.texi | 7 +++++--
lisp/env.el | 6 +++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index a34c01c..e3297b1 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -1043,9 +1043,12 @@ if it removed @var{variable} from the environment.
@end deffn
@defmac with-environment-variables variables body@dots{}
-This macro sets the environment variables in @var{variables}
+This macro sets the environment variables according to @var{variables}
temporarily when executing @var{body}. The previous values are
-restored when the form finishes.
+restored when the form finishes. The argument @var{variables} should
+be a list of pairs of strings of the form
+@w{@code{(@var{var} @var{value})}}, where @var{var} is the name of the
+environment variable and @var{value} is that variable's value.
@lisp
(with-environment-variables (("LANG" "C")
diff --git a/lisp/env.el b/lisp/env.el
index 31a728c..2f7cd9d 100644
--- a/lisp/env.el
+++ b/lisp/env.el
@@ -221,9 +221,9 @@ in the environment list of the selected frame."
;;;###autoload
(defmacro with-environment-variables (variables &rest body)
"Set VARIABLES in the environent and execute BODY.
-VARIABLES is a list of variable settings where first element
-should be the name of the variable and the second element should
-be the value.
+VARIABLES is a list of variable settings of the form (VAR VALUE),
+where VAR is the name of the variable (a string) and VALUE
+is its value (also a string).
The previous values will be be restored upon exit."
(declare (indent 1) (debug (sexp body)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master cd0817a: ; Improve documentation of 'with-environment-variables',
Eli Zaretskii <=