GNU bug report logs -
#79246
31.0.50; cond* bind* variable scope - documentation
Previous Next
Full log
View this message in rfc822 format
> 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" <bug-gnu-emacs <at> gnu.org>
>
> 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.
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.