From unknown Mon Aug 18 11:27:47 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79246: 31.0.50; cond* bind* variable scope - documentation Resent-From: Lester Longley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Aug 2025 18:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 79246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 79246@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.175528167725433 (code B ref -1); Fri, 15 Aug 2025 18:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 Aug 2025 18:14:37 +0000 Received: from localhost ([127.0.0.1]:39622 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1umywm-0006c8-Qf for submit@debbugs.gnu.org; Fri, 15 Aug 2025 14:14:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48196) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1umywj-0006bm-Rb for submit@debbugs.gnu.org; Fri, 15 Aug 2025 14:14:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1umywe-0006fc-CG for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 14:14:28 -0400 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1umywZ-00043e-1Q for bug-gnu-emacs@gnu.org; Fri, 15 Aug 2025 14:14:28 -0400 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-55ce508d4d6so1747837e87.0 for ; Fri, 15 Aug 2025 11:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; t=1755281655; x=1755886455; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=URPz2o4bCqdoNCkJaXGqxmzyVYX/CLdkjyYYz1NGblI=; b=eB1cGUGq6guGBUnxqkCJKSmf+IsNptSGO5TUJbltNj6in/DnZP0ojPvTneYA6VMyQ0 MkWdim4AFV5hjHCL962yTVOqpSUNQTJcthKhAawSlf0F/IFqVcK/qQ2bIkBQzR+Cq3nY +zrrVnOyH1gQAAWw9UepnENRtZDRm0WXSl8es= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755281655; x=1755886455; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=URPz2o4bCqdoNCkJaXGqxmzyVYX/CLdkjyYYz1NGblI=; b=bwnMGmptY2Hx+AdMOStOhAptln4hlDjFckUwhzLPCOJbO5Q4SVdeDH6WG3Mhf8klua uFU8axqZw8euQUid0XM62kRLo2T4u5SUNoNbKlGQedjM8gdgwn5hpIungAmFbJxP8Aq/ bN2Q0FtJg1IVZQgOByd0w4RKyTUZMCxzg/rP1Y+PDQljwhjyIb5tEu2dTSwsIfb15LSP 2U3BFaldWiWTvFxRG2+jKXEH/VyJnTWGfNQJo5Zck4c2r4v00LDl3yTU4xQrrPhEg4gZ c2ewv0ICkxih6yk3Qryjbqr6sdK7FYgYzhopvNB5jShn3rQOPDJ/hwybpb2HFhanl5E2 amhg== X-Gm-Message-State: AOJu0YxWLMmzhRLqqINH3CfMmzXYVg+rIgX2zaOoArTazJwnzNdcrX9Q yrtfUiBfHCscpHlZZKsDqljEfQcEvZeUPSTnYkUA4hjTgU4LqlYPeCV5mF44h662NmcHcERfKAp FzsirnEiqy2rmI4iS2GZ/CZIORcTLoPSrVnRIHXtaPDXnXAWj6f6E2w== X-Gm-Gg: ASbGncvtA94jMDccAXUDcPT5zJttcsiRbhyLI4nckUv5SGFXo5L6iAoFydsFXkOm+o2 FLyFYBqNqtqjg5iBJ8eW0tNuVsyEijIeJQuu0pIeYSOlyMSBCRdo2VXXSqtQZXnyI0hjzqx5BNh SblBRGTmWe3xye+WBVGshP+llbmmpfgBSVkly5Mi91sMO5I+c0uGYnzvLypJGSCP5dxCVu7bU6P r46 X-Google-Smtp-Source: AGHT+IG9p9X3TZVfapJoOsS9kc1fmtMm1tP+NDOxRcwuUaUeRGjNnQhn5945tyhA4VVVOGworvTvKTZkXsViU7+ZzhI= X-Received: by 2002:a05:6512:6804:b0:552:2257:93dd with SMTP id 2adb3069b0e04-55cf2c9050emr12650e87.25.1755281655232; Fri, 15 Aug 2025 11:14:15 -0700 (PDT) MIME-Version: 1.0 From: Lester Longley Date: Fri, 15 Aug 2025 14:14:02 -0400 X-Gm-Features: Ac12FXxB5T5BFQTQYT0zdcvWYqYIBTzO-5pX3_qCO9YRspXLjy2SYvXmRQbMg6A Message-ID: Content-Type: multipart/alternative; boundary="0000000000008a9970063c6b5bf7" Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=lester@ieee.org; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --0000000000008a9970063c6b5bf7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: =E2=80=98(bind* BINDINGS...)=E2=80=99 means to bind BINDINGS (like the= bindings list in =E2=80=98let*=E2=80=99, *note Local Variables::) for the body = of the clause. As a condition, it counts as true if the first binding=E2=80= =99s value is non-=E2=80=98nil=E2=80=99. 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. Thanks, Lester In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2025-08-11 built on penguin Repository revision: 66eead6fd06d40b919ee6d1de86099592729d671 Repository branch: master System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --with-pgtk 'CFLAGS=3D-g -O2 -ffile-prefix-map=3D/tmp/emacs.git=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr compile comint ansi-osc ansi-color ring comp-run bytecomp byte-compile comp-common rx emacsbug lisp-mnt message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty move-toolbar make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 66922 14238) (symbols 48 6803 0) (strings 32 17289 2551) (string-bytes 1 550776) (vectors 16 11399) (vector-slots 8 154109 11674) (floats 8 22 13) (intervals 56 252 0) (buffers 1064 11)) --0000000000008a9970063c6b5bf7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Please see the following excerpt from lisp/emacs-lisp/cond= -star.el:

=C2=A0 =C2=A0 =C2=A0`(bind* BINDINGS...)' means to bin= d BINDINGS (as if they were in `let*')
=C2=A0 =C2=A0 =C2=A0for the b= ody of the clause, and all subsequent clauses, since the `bind*'
=C2= =A0 =C2=A0 =C2=A0clause is always a non-exit clause.=C2=A0 As a condition, = it counts as true
=C2=A0 =C2=A0 =C2=A0and runs the body of the clause if= the first binding's value is non-nil.

However, the above qualif= ier "and all subsequent clauses" is missing from (info "(eli= sp) cond* Macro") / doc/lispref/control.texi:

=C2=A0 =C2=A0 =C2= =A0=E2=80=98(bind* BINDINGS...)=E2=80=99 means to bind BINDINGS (like the b= indings
=C2=A0 =C2=A0 =C2=A0list in =E2=80=98let*=E2=80=99, *note Local = Variables::) for the body of the
=C2=A0 =C2=A0 =C2=A0clause.=C2=A0 As a = condition, it counts as true if the first binding=E2=80=99s
=C2=A0 =C2= =A0 =C2=A0value is non-=E2=80=98nil=E2=80=99.

I believe that it woul= d be helpful for doc/lispref/control.texi to be updated with that additiona= l information (i.e., from lisp/emacs-lisp/cond-star.el), since it's use= ful in understanding how & why bind* works.

This aspect was expl= ained in https://lists.gnu.org/archive/html/emacs-devel/2025-01/msg00= 429.html:

> That is the purpose of bind*: to bind variables t= hat reach over subsequent clauses.

... which is where I first notice= d it, since (I think) it's not in the manual.

Thanks,
Lester<= br>
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
= =C2=A03.24.38, cairo version 1.16.0) of 2025-08-11 built on penguin
Repo= sitory revision: 66eead6fd06d40b919ee6d1de86099592729d671
Repository bra= nch: master
System Description: Debian GNU/Linux 12 (bookworm)

Co= nfigured using:
=C2=A0'configure --with-pgtk 'CFLAGS=3D-g -O2=C2=A0-ffile-prefix-map=3D/tmp/emacs.git=3D. -fstack-protector-strong -Wfo= rmat
=C2=A0-Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-t= ime
=C2=A0-D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro'

= Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSE= TTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES = NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS T= IFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB

Important = settings:
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 locale-coding-sys= tem: utf-8-unix

Major mode: Lisp Interaction

Minor modes in e= ffect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mode: t
=C2=A0 e= ldoc-mode: t
=C2=A0 show-paren-mode: t
=C2=A0 electric-indent-mode: t=
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-ba= r-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mod= e: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 m= inibuffer-regexp-mode: t
=C2=A0 line-number-mode: t
=C2=A0 indent-tab= s-mode: t
=C2=A0 transient-mark-mode: t
=C2=A0 auto-composition-mode:= t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=
Load-path shadows:
None found.

Features:
(shadow sort mail= -extr compile comint ansi-osc ansi-color ring comp-run
bytecomp byte-com= pile comp-common rx emacsbug lisp-mnt message mailcap
yank-media puny di= red dired-loaddefs rfc822 mml mml-sec password-cache
epa derived epg rfc= 6068 epg-config gnus-util text-property-search
time-date subr-x mm-decod= e mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader= cl-loaddefs cl-lib sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prs= vr mail-utils rmc iso-transl tooltip
cconv eldoc paren electric uniquify= ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgt= k-win term/common-win touch-screen
pgtk-dnd tool-bar dnd fontset image r= egexp-opt fringe tabulated-list
replace newcomment text-mode lisp-mode p= rog-mode register page tab-bar
menu-bar rfn-eshadow isearch easymenu tim= er select scroll-bar mouse
jit-lock font-lock syntax font-core term/tty-= colors frame minibuffer
nadvice seq simple cl-generic indonesian philipp= ine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet = lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech = european
ethiopic indian cyrillic chinese composite emoji-zwj charscript= charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure=
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
= files window text-properties overlay sha1 md5 base64 format env
code-pag= es mule custom widget keymap hashtable-print-readable backquote
threads = dbusbind inotify dynamic-setting system-font-setting
font-render-setting= cairo gtk pgtk lcms2 multi-tty move-toolbar
make-network-process tty-ch= ild-frames native-compile emacs)

Memory information:
((conses 16 = 66922 14238) (symbols 48 6803 0) (strings 32 17289 2551)
=C2=A0(string-b= ytes 1 550776) (vectors 16 11399)
=C2=A0(vector-slots 8 154109 11674) (f= loats 8 22 13) (intervals 56 252 0)
=C2=A0(buffers 1064 11))
--0000000000008a9970063c6b5bf7-- From unknown Mon Aug 18 11:27:47 2025 X-Loop: help-debbugs@gnu.org Subject: bug#79246: 31.0.50; cond* bind* variable scope - documentation Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Aug 2025 09:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 79246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Lester Longley , Richard Stallman Cc: 79246@debbugs.gnu.org Received: via spool by 79246-submit@debbugs.gnu.org id=B79246.175533777617894 (code B ref 79246); Sat, 16 Aug 2025 09:50:02 +0000 Received: (at 79246) by debbugs.gnu.org; 16 Aug 2025 09:49:36 +0000 Received: from localhost ([127.0.0.1]:41038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unDXc-0004eY-2W for submit@debbugs.gnu.org; Sat, 16 Aug 2025 05:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57718) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unDXZ-0004eG-8Y for 79246@debbugs.gnu.org; Sat, 16 Aug 2025 05:49:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1unDXS-0004gz-Hl; Sat, 16 Aug 2025 05:49:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GdQZHgBhKfQzS5DqbWRtnvOnUCJdQtaQiYSDd4crafU=; b=oTzBqnGDe0giI1rWSHWo Sj3H5/vt4xx6LmJyjBd7j+2qogJ2jiN42yz4dL+GUI9pMow+IaECPBPuG2W744QwqACFuaAXeNFKG FTW4Ik71w78Q9FnjlICfkc7bMsiCT4/VDHws2HtpyvS6xb9gNibiT4vT6p3LYwhqauYMKtxeKM2Qp 8qMAD5t/h8Wew7g/pZK9a1vxwNw9EAJ4HQ+7kKvbqq468kEwLYRMylV07yHfcTcIS+SN1hToxadpg 12ukJdd+6xdrjY6X2woydSuPxrjZ1vTDkH3Jr/uneD/PSrR1O950vsrSPo28YvKcOkulhnwN/TY20 j4egoBZUdIr2dw==; Date: Sat, 16 Aug 2025 12:49:17 +0300 Message-Id: <867bz3lhpe.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (bug-gnu-emacs@gnu.org) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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" > > 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.