GNU bug report logs - #74540
30.0.91; mention special variables in lexbind Info page

Previous Next

Package: emacs;

Reported by: Mike Kupfer <kupfer <at> rawbw.com>

Date: Tue, 26 Nov 2024 00:53:02 UTC

Severity: normal

Found in version 30.0.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74540 in the body.
You can then email your comments to 74540 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#74540; Package emacs. (Tue, 26 Nov 2024 00:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Kupfer <kupfer <at> rawbw.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Nov 2024 00:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mike Kupfer <kupfer <at> rawbw.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.91; mention special variables in lexbind Info page
Date: Mon, 25 Nov 2024 16:52:05 -0800
[Message part 1 (text/plain, inline)]
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

[lexbind-special-vars.patch (text/x-diff, inline)]
user:        Mike Kupfer <kupfer <at> rawbw.com>
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
 


Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 28 Nov 2024 15:29:02 GMT) Full text and rfc822 format available.

Notification sent to Mike Kupfer <kupfer <at> rawbw.com>:
bug acknowledged by developer. (Thu, 28 Nov 2024 15:29:02 GMT) Full text and rfc822 format available.

Message #10 received at 74540-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mike Kupfer <kupfer <at> rawbw.com>
Cc: 74540-done <at> debbugs.gnu.org
Subject: Re: bug#74540: 30.0.91; mention special variables in lexbind Info page
Date: Thu, 28 Nov 2024 17:28:31 +0200
> From: Mike Kupfer <kupfer <at> rawbw.com>
> Date: Mon, 25 Nov 2024 16:52:05 -0800
> 
> 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, installed on the emacs-30 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 Dec 2024 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.