]> git.eshelyaron.com Git - emacs.git/commitdiff
cl-macs.el: Fix minor merge snafu (bug#77348)
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Apr 2025 19:05:02 +0000 (15:05 -0400)
committerEshel Yaron <me@eshelyaron.com>
Thu, 3 Apr 2025 16:51:17 +0000 (18:51 +0200)
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Recover the changes
made in commit 476426168106 and accidentally undone by a later merge of
commit 63adf9dcf53a.

(cherry picked from commit 7cffcbb5137666f1c544e7b0c1a544e2bc660ddd)

lisp/emacs-lisp/cl-macs.el

index e83dd2fe828865f64bf58cdf4f9c3c35a38ea919..6655cd8b17858fb69be8c74f80c918a5e2320c94 100644 (file)
@@ -2022,7 +2022,8 @@ a `let' form, except that the list of symbols can be computed at run-time."
 Each definition can take the form (FUNC EXP) where FUNC is the function
 name, and EXP is an expression that returns the function value to which
 it should be bound, or it can take the more common form (FUNC ARGLIST
-BODY...) which is a shorthand for (FUNC (lambda ARGLIST BODY)).
+BODY...) which is a shorthand for (FUNC (lambda ARGLIST BODY))
+where BODY is wrapped in a `cl-block' named FUNC.
 
 FUNC is defined only within FORM, not BODY, so you can't write recursive
 function definitions.  Use `cl-labels' for that.  See Info node
@@ -2229,11 +2230,14 @@ Like `cl-flet' but the definitions can refer to previous ones.
 Each definition can take the form (FUNC EXP) where FUNC is the function
 name, and EXP is an expression that returns the function value to which
 it should be bound, or it can take the more common form (FUNC ARGLIST
-BODY...) which is a shorthand for (FUNC (lambda ARGLIST BODY)).
-
-FUNC is defined in any BODY, as well as FORM, so you can write recursive
-and mutually recursive function definitions.  See Info node
-`(cl) Function Bindings' for details.
+BODY...) which is a shorthand for (FUNC (lambda ARGLIST BODY))
+where BODY is wrapped in a `cl-block' named FUNC.
+
+FUNC is in scope in any BODY or EXP, as well as in FORM, so you can write
+recursive and mutually recursive function definitions, with the caveat
+that EXPs are evaluated in sequence and you cannot call a FUNC before its
+EXP has been evaluated.
+See Info node `(cl) Function Bindings' for details.
 
 \(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
   (declare (indent 1) (debug cl-flet))