aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/variables.texi12
1 files changed, 11 insertions, 1 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 02e156396db..89dac4f7a4d 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -273,7 +273,17 @@ before any of the local values are computed. The values are then
273assigned to the locally bound variables. This is only useful when 273assigned to the locally bound variables. This is only useful when
274lexical binding is in effect, and you want to create closures that 274lexical binding is in effect, and you want to create closures that
275refer to bindings that would otherwise not yet be in effect when using 275refer to bindings that would otherwise not yet be in effect when using
276@code{let}. 276@code{let*}.
277
278For instance, here's a closure that removes itself from a hook after
279being run once:
280
281@lisp
282(letrec ((hookfun (lambda ()
283 (message "Run once")
284 (remove-hook 'post-command-hook hookfun))))
285 (add-hook 'post-command-hook hookfun))
286@end lisp
277@end defspec 287@end defspec
278 288
279 Here is a complete list of the other facilities that create local 289 Here is a complete list of the other facilities that create local