Subject: Re: bug#79246: 31.0.50; cond* bind* variable scope - documentation

From: Eli Zaretskii <[email-masked]>
Date: Sat, 16 Aug 2025 12:49:17 +0300

> Date: Fri, 15 Aug 2025 14:14:02 -0400
> From:  Lester Longley via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> Please see the following excerpt from lisp/emacs-lisp/cond-star.el:
> 
>      `(bind* BINDINGS...)' means to bind BINDINGS (as if they were in `let*')
>      for the body of the clause, and all subsequent clauses, since the `bind*'
>      clause is always a non-exit clause.  As a condition, it counts as true
>      and runs the body of the clause if the first binding's value is non-nil.
> 
> However, the above qualifier "and all subsequent clauses" is missing from (info "(elisp) cond* Macro") /
> doc/lispref/control.texi:
> 
>      ‘(bind* BINDINGS...)’ means to bind BINDINGS (like the bindings
>      list in ‘let*’, *note Local Variables::) for the body of the
>      clause.  As a condition, it counts as true if the first binding’s
>      value is non-‘nil’.
> 
> I believe that it would be helpful for doc/lispref/control.texi to be updated with that additional information (i.e.,
> from lisp/emacs-lisp/cond-star.el), since it's useful in understanding how & why bind* works.
> 
> This aspect was explained in https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00429.html:
> 
> > That is the purpose of bind*: to bind variables that reach over subsequent clauses.
> 
> ... which is where I first noticed it, since (I think) it's not in the manual.

Richard, it looks like you haven't updated the ELisp manual due to the
change mentioned in
https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00429.html,
where you wrote:

  All bind* clauses are now defined to be non-exit clauses.

AFAICT, this is not in the ELisp manual yet.