]> git.eshelyaron.com Git - emacs.git/commitdiff
Document `dlet'
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 23 Aug 2021 00:13:40 +0000 (02:13 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 23 Aug 2021 00:13:40 +0000 (02:13 +0200)
* doc/lispref/variables.texi (Local Variables): Document `dlet'.

doc/lispref/variables.texi
etc/NEWS

index 9356fb9f699a1cbfe76104906257cc6eb13c83dd..8a11154b730813d263bf43aa4fc32e0828b0a3a9 100644 (file)
@@ -284,6 +284,20 @@ being run once:
                     (remove-hook 'post-command-hook hookfun))))
   (add-hook 'post-command-hook hookfun))
 @end lisp
+@end defspec
+
+@defspec dlet (bindings@dots{}) forms@dots{}
+This special form is like @code{let}, but it binds all variables
+dynamically.  This is rarely useful---you usually want to bind normal
+variables lexically, and special variables (i.e., variables that are
+defined with @code{defvar}) dynamically, and this is what @code{let}
+does.
+
+@code{dlet} can be useful when interfacing with old code that assumes
+that certain variables are dynamically bound, but it's impractical to
+@code{defvar} these variables.  @code{dlet} will temporarily make the
+bound variables special, execute the forms, and then make the
+variables non-special again.
 @end defspec
 
   Here is a complete list of the other facilities that create local
index 1866ed0d6d01561c4fcef175ccc618a19931f1be..80185a5d719759faad33a5ef3206a5e3defe173d 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3594,8 +3594,10 @@ supporting Lisp files when 'require' is unsuitable.
 ** New function 'file-modes-number-to-symbolic' to convert a numeric
 file mode specification into symbolic form.
 
++++
 ** New macro 'dlet' to dynamically bind variables.
 
+---
 ** The variable 'force-new-style-backquotes' has been removed.
 This removes the final remaining trace of old-style backquotes.