aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorNoam Postavsky2018-06-12 18:41:46 -0400
committerNoam Postavsky2018-06-19 20:02:16 -0400
commite292c0973cf7a92819d312ea8a828b67e6adf1ab (patch)
tree5ae59aef028cd644b87d6d4d8909972515a2a3b4 /doc/misc
parent36737705b451ad4c765baa5789e3ceb752ee07a3 (diff)
downloademacs-e292c0973cf7a92819d312ea8a828b67e6adf1ab.tar.gz
emacs-e292c0973cf7a92819d312ea8a828b67e6adf1ab.zip
Fix #'fun handling inside `labels' (Bug#31792)
* lisp/emacs-lisp/cl.el (labels): Apply the equivalent of the cl-labels change from 2015-01-16 "* lisp/emacs-lisp/cl-macs.el: Fix last change". * test/lisp/emacs-lisp/cl-tests.el (labels-function-quoting): New test. * lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Improve docstring, link to relevant manual page. * doc/misc/cl.texi (Function Bindings): Don't imply that function cells of symbols are modified by cl-flet. Don't claim that cl-flet or cl-labels affect references of the form (quote FUNC).
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/cl.texi23
1 files changed, 10 insertions, 13 deletions
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index bf85b00e937..553b935b1ef 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -1299,17 +1299,18 @@ These forms make @code{let}-like bindings to functions instead
1299of variables. 1299of variables.
1300 1300
1301@defmac cl-flet (bindings@dots{}) forms@dots{} 1301@defmac cl-flet (bindings@dots{}) forms@dots{}
1302This form establishes @code{let}-style bindings on the function 1302This form establishes @code{let}-style bindings for functions rather
1303cells of symbols rather than on the value cells. Each @var{binding} 1303than values. Each @var{binding} must be a list of the form
1304must be a list of the form @samp{(@var{name} @var{arglist} 1304@samp{(@var{name} @var{arglist} @var{body}@dots{})}. Within
1305@var{forms}@dots{})}, which defines a function exactly as if 1305@var{forms}, any reference to the function @var{name} uses the local
1306it were a @code{cl-defun} form. The function @var{name} is defined 1306definition instead of the global one.
1307accordingly but only within the body of the @code{cl-flet}, hiding any external 1307
1308definition if applicable. 1308A ``reference'' to a function name is either a call to that function,
1309or a use of its name quoted by @code{function} to be passed on to,
1310say, @code{mapcar}.
1309 1311
1310The bindings are lexical in scope. This means that all references to 1312The bindings are lexical in scope. This means that all references to
1311the named functions must appear physically within the body of the 1313the named functions must appear physically within @var{forms}.
1312@code{cl-flet} form.
1313 1314
1314Functions defined by @code{cl-flet} may use the full Common Lisp 1315Functions defined by @code{cl-flet} may use the full Common Lisp
1315argument notation supported by @code{cl-defun}; also, the function 1316argument notation supported by @code{cl-defun}; also, the function
@@ -1336,10 +1337,6 @@ functions must appear physically within the body of the
1336the functions themselves. Thus, @code{cl-labels} can define 1337the functions themselves. Thus, @code{cl-labels} can define
1337local recursive functions, or mutually-recursive sets of functions. 1338local recursive functions, or mutually-recursive sets of functions.
1338 1339
1339A ``reference'' to a function name is either a call to that
1340function, or a use of its name quoted by @code{quote} or
1341@code{function} to be passed on to, say, @code{mapcar}.
1342
1343Note that the @file{cl.el} version of this macro behaves slightly 1340Note that the @file{cl.el} version of this macro behaves slightly
1344differently. @xref{Obsolete Macros}. 1341differently. @xref{Obsolete Macros}.
1345@end defmac 1342@end defmac