From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mike Kupfer Newsgroups: gmane.emacs.bugs Subject: bug#74540: 30.0.91; mention special variables in lexbind Info page Date: Mon, 25 Nov 2024 16:52:05 -0800 Message-ID: <54843.1732582325@alto.camomileplus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3663"; mail-complaints-to="usenet@ciao.gmane.io" To: 74540@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 26 01:53:33 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tFjpd-0000qL-7J for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Nov 2024 01:53:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFjpB-00049z-0y; Mon, 25 Nov 2024 19:53:05 -0500 Original-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 1tFjp9-00049n-AE for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 19:53:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFjp9-0005Y4-1f for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 19:53:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:From:To:Subject; bh=Biv0uRBnHJs3xUPkbdkWNwiD2FJ1U+jnVihnO0XwOmc=; b=Md2af/n3LH4Utwvnz7aEah1wbKTJrOc6sEl6hIDZlRjI2DDjj+hYJNqj3BjOtjEGSLcPAA4qZf6EU5y+56zEsEdmXzx3JlrK9EugtEWsNp2PXBSwavEz67izNqAeF4xNVrvDp5H0BfmdS/Q4IFkwiEQC/9V74GUkbHhYujXIKxvcHtYuiWkn7uNmMnv8W/XQ/zufnPYPVNxT4B1zIbf4CqDsdvGsgT958svzlaiXp+geRxLd4FA5NfDQz56iObFTi16MWFunPBNgTrrZ/eqRP6W75MK5vJDzq76AhqnUumWw0dtDtuu+SlMqE/HQp1d3VIZnR8toHpMAZdYBO5uWmA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFjp8-0007XA-Jy for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 19:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kupfer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2024 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74540 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.173258234128894 (code B ref -1); Tue, 26 Nov 2024 00:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Nov 2024 00:52:21 +0000 Original-Received: from localhost ([127.0.0.1]:43368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFjoS-0007Vy-UW for submit@debbugs.gnu.org; Mon, 25 Nov 2024 19:52:21 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:45668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFjoR-0007Vq-Cu for submit@debbugs.gnu.org; Mon, 25 Nov 2024 19:52:19 -0500 Original-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 1tFjoO-00048I-9O for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 19:52:17 -0500 Original-Received: from shell1.rawbw.com ([198.144.192.42]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFjoM-0005Rv-Eu for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 19:52:16 -0500 Original-Received: from alto.camomileplus.org (135-180-174-211.dsl.dynamic.sonic.net [135.180.174.211] (may be forged)) (authenticated bits=0) by shell1.rawbw.com (8.15.1/8.15.1) with ESMTPSA id 4AQ0q5KL037333 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 25 Nov 2024 16:52:11 -0800 (PST) (envelope-from kupfer@rawbw.com) X-Authentication-Warning: shell1.rawbw.com: Host 135-180-174-211.dsl.dynamic.sonic.net [135.180.174.211] (may be forged) claimed to be alto.camomileplus.org X-Mailer: MH-E 8.6+git; nmh 1.8-RC2; Emacs 30.0.91 Received-SPF: pass client-ip=198.144.192.42; envelope-from=kupfer@rawbw.com; helo=shell1.rawbw.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295969 Archived-At: --=-=-= Content-Type: text/plain When I first read up on lexical binding, I didn't realize that I also needed to review the documentation for dynamic binding, so that I could learn about special variables. I think it would be good for the Info page for lexical binding to mention special variables, clarify that the specialness also affects new bindings (not just the initial defvar/defcustom/defconst), and provide a link to the page for dynamic binding (for details about special variables). I've enclosed a draft patch for your consideration. thanks, mike --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=lexbind-special-vars.patch Content-Description: draft patch user: Mike Kupfer date: Mon Nov 25 15:37:53 2024 -0800 files: doc/lispref/variables.texi description: Mention special variables in lexical binding documentation * doc/lispref/variables.texi (Lexical Binding): Briefly mention special variables and their semantics. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1096,7 +1096,7 @@ @end example @noindent -The @code{let} binding defines a lexical environment in which the +Here, the @code{let} binding defines a lexical environment in which the variable @code{x} is locally bound to 0. Within this binding construct, we define a lambda expression which increments @code{x} by one and returns the incremented value. This lambda expression is @@ -1113,6 +1113,12 @@ variable's dynamic binding (i.e., the contents of its symbol's value cell). + Note also that variables may be declared special, in which case they +will use dynamic binding, even for new bindings such as a @code{let} +binding. Depending on how the variable is declared, it can be +special globally, for a single file, or for a portion of a file. +@xref{Dynamic Binding} for details. + @node Dynamic Binding @subsection Dynamic Binding --=-=-=--