GNU logs - #55914, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55914: 28.1; Defining as dynamic an already lexical var
Resent-From: Hendrik Tews <hendrik.tews@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 11 Jun 2022 21:34:01 +0000
Resent-Message-ID: <handler.55914.B.165498321916346 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 55914
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 55914 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.165498321916346
          (code B ref -1); Sat, 11 Jun 2022 21:34:01 +0000
Received: (at submit) by debbugs.gnu.org; 11 Jun 2022 21:33:39 +0000
Received: from localhost ([127.0.0.1]:54159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o08ji-0004FZ-RN
	for submit <at> debbugs.gnu.org; Sat, 11 Jun 2022 17:33:39 -0400
Received: from lists.gnu.org ([209.51.188.17]:48738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hendrik.tews@HIDDEN>) id 1o08jf-0004FQ-1a
 for submit <at> debbugs.gnu.org; Sat, 11 Jun 2022 17:33:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43238)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hendrik.tews@HIDDEN>)
 id 1o08je-00087p-Pp
 for bug-gnu-emacs@HIDDEN; Sat, 11 Jun 2022 17:33:34 -0400
Received: from serv1.kernkonzept.com ([2a01:4f8:1c1c:b490::2]:36360
 helo=mx.kernkonzept.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hendrik.tews@HIDDEN>)
 id 1o08jc-0008Na-4I
 for bug-gnu-emacs@HIDDEN; Sat, 11 Jun 2022 17:33:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=kernkonzept.com; s=mx1; h=Content-Transfer-Encoding:Content-Type:
 MIME-Version:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=t0fgYOlYx1E97mBqGvYhC4JZ/3ay0VJpRj/n9mObKLM=; b=oLIniCL+TG5jFSw+LKdnCOK3xu
 BvcTIba8cGfJPEd6Nt0MtOAHP0BD6VNtZv9NXTmZwIrddZTt9NIJCo1xk5pO6fAKVEIBVnJNir58x
 i4G2MW3XYyB52Lgplk/exKLjbX4R4b6ksDcIklpeZQdDBKq18BS9fKN+OJRoFaDcJIArDUpX+GY9X
 /tE1YUsBu6QYYBdY6KIx8x9q7eKxjpnzoRYOtlcPW+TeN03EMRiyz20q1ZGQcSxzPO2iwCnB6o2wh
 AZSp2GAr5UzzQBCc2oCqQ2+EJII7NayT2mFzoIKu0jggPJTEP70OaAhjY94WgT21oHK5N+0F50gCl
 xcELk/cQ==;
Received: from [2a02:810a:8d00:56bc:caea:3529:f8e9:e9c2] (helo=cert2)
 by mx.kernkonzept.com with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2)
 id 1o08jV-004s24-Ta
 for bug-gnu-emacs@HIDDEN; Sat, 11 Jun 2022 23:33:26 +0200
Received: from localhost ([::1] helo=cert2)
 by cert2 with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 (Exim 4.95) (envelope-from <hendrik.tews@HIDDEN>)
 id 1o08jS-001mpI-UH for bug-gnu-emacs@HIDDEN;
 Sat, 11 Jun 2022 23:33:24 +0200
From: Hendrik Tews <hendrik.tews@HIDDEN>
Date: Sat, 11 Jun 2022 23:33:24 +0200
Message-ID: <87zgiilwbf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=2a01:4f8:1c1c:b490::2;
 envelope-from=hendrik.tews@HIDDEN; helo=mx.kernkonzept.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, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi,

evaluating

    (let ((test-var nil))
      (eval '(defvar test-var t "XXX")))

works fine in emacs 27 but fails in 28.1 with "Defining as
dynamic an already lexical var", similarly for defcustom instead
of defvar.

The elisp manual 28.1 says in 12.5 Defining Global Variables:

     If SYMBOL is already lexically bound (e.g., if the =E2=80=98defvar=E2=
=80=99 form
     occurs in a =E2=80=98let=E2=80=99 form with lexical binding enabled), =
then =E2=80=98defvar=E2=80=99
     sets the dynamic value.

From this I would conclude that the error is a bug. Or did I
overlook something in the documentation?

(I noticed this problem because of failing tests for Proof
General with emacs 28, see
https://github.com/ProofGeneral/PG/issues/657. There, inside a
let binding a Coq file is opened, which causes the Coq instance
of Proof General to be loaded, which somewhere contained a
defcustom for the variable that was bound with let.)

Best regards,

Hendrik Tews






Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Hendrik Tews <hendrik.tews@HIDDEN>
Subject: bug#55914: Acknowledgement (28.1; Defining as dynamic an already
 lexical var)
Message-ID: <handler.55914.B.165498321916346.ack <at> debbugs.gnu.org>
References: <87zgiilwbf.fsf@HIDDEN>
X-Gnu-PR-Message: ack 55914
X-Gnu-PR-Package: emacs
Reply-To: 55914 <at> debbugs.gnu.org
Date: Sat, 11 Jun 2022 21:34:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 55914 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
55914: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D55914
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55914: 28.1; Defining as dynamic an already lexical var
Resent-From: Phil Sainty <psainty@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 12 Jun 2022 00:11:01 +0000
Resent-Message-ID: <handler.55914.B55914.165499261031493 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55914
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Hendrik Tews <hendrik.tews@HIDDEN>
Cc: 55914 <at> debbugs.gnu.org
Received: via spool by 55914-submit <at> debbugs.gnu.org id=B55914.165499261031493
          (code B ref 55914); Sun, 12 Jun 2022 00:11:01 +0000
Received: (at 55914) by debbugs.gnu.org; 12 Jun 2022 00:10:10 +0000
Received: from localhost ([127.0.0.1]:54292 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o0BBC-0008Bt-9R
	for submit <at> debbugs.gnu.org; Sat, 11 Jun 2022 20:10:10 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:45221)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1o0BB9-0008Bf-EQ
 for 55914 <at> debbugs.gnu.org; Sat, 11 Jun 2022 20:10:08 -0400
Received: from [10.253.37.70] (port=57182 helo=webmail.orcon.net.nz)
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1o0BB6-0003tC-EH; Sun, 12 Jun 2022 12:10:04 +1200
Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Sun, 12 Jun 2022 12:10:04 +1200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Sun, 12 Jun 2022 12:10:04 +1200
From: Phil Sainty <psainty@HIDDEN>
In-Reply-To: <87zgiilwbf.fsf@HIDDEN>
References: <87zgiilwbf.fsf@HIDDEN>
Message-ID: <f6870511b38a34c8aa56224a88862d5e@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2022-06-12 09:33, Hendrik Tews wrote:
> From this I would conclude that the error is a bug. Or did I
> overlook something in the documentation?

It sounds like it's been upgraded from a mere description to an
error, and the point would be "definitely don't do that; and if
you see this then you should treat it as a bug to be fixed".


> (I noticed this problem because of failing tests for Proof
> General with emacs 28, see
> https://github.com/ProofGeneral/PG/issues/657. There, inside a
> let binding a Coq file is opened, which causes the Coq instance
> of Proof General to be loaded, which somewhere contained a
> defcustom for the variable that was bound with let.)

Which indicates a bug to be fixed, no?

If the variable is *supposed* to be dynamic (everywhere), then
lexical libraries which refer to it must declare (defvar FOO) to
mark it as a dynamic variable, if it's possible that the proper
definition may not yet have been loaded.

If the variable is supposed to be lexical, then it should be
renamed to something which doesn't clash with a dynamic variable.
There's need for hyphenated name-spacing for lexical vars, so the
majority of single-word names are particularly safe to use.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55914: 28.1; Defining as dynamic an already lexical var
Resent-From: Phil Sainty <psainty@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 12 Jun 2022 02:11:02 +0000
Resent-Message-ID: <handler.55914.B55914.165499985010435 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55914
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Hendrik Tews <hendrik.tews@HIDDEN>
Cc: 55914 <at> debbugs.gnu.org
Received: via spool by 55914-submit <at> debbugs.gnu.org id=B55914.165499985010435
          (code B ref 55914); Sun, 12 Jun 2022 02:11:02 +0000
Received: (at 55914) by debbugs.gnu.org; 12 Jun 2022 02:10:50 +0000
Received: from localhost ([127.0.0.1]:54339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o0D3x-0002iE-Uk
	for submit <at> debbugs.gnu.org; Sat, 11 Jun 2022 22:10:50 -0400
Received: from smtp-1.orcon.net.nz ([60.234.4.34]:46931)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <psainty@HIDDEN>) id 1o0D3t-0002i0-On
 for 55914 <at> debbugs.gnu.org; Sat, 11 Jun 2022 22:10:48 -0400
Received: from [10.253.37.70] (port=48216 helo=webmail.orcon.net.nz)
 by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1)
 (envelope-from <psainty@HIDDEN>)
 id 1o0D3q-00033D-Iv; Sun, 12 Jun 2022 14:10:42 +1200
Received: from ip-116-251-140-135.kinect.net.nz ([116.251.140.135])
 via [10.253.37.253] by webmail.orcon.net.nz
 with HTTP (HTTP/1.1 POST); Sun, 12 Jun 2022 14:10:42 +1200
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Sun, 12 Jun 2022 14:10:42 +1200
From: Phil Sainty <psainty@HIDDEN>
In-Reply-To: <f6870511b38a34c8aa56224a88862d5e@HIDDEN>
References: <87zgiilwbf.fsf@HIDDEN>
 <f6870511b38a34c8aa56224a88862d5e@HIDDEN>
Message-ID: <cf16aebaa3faf12c4b88736c1a6807d3@HIDDEN>
X-Sender: psainty@HIDDEN
User-Agent: Orcon Webmail
X-GeoIP: --
X-Spam_score: -2.9
X-Spam_score_int: -28
X-Spam_bar: --
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2022-06-12 12:10, Phil Sainty wrote:
> There's need for hyphenated name-spacing for lexical vars, so the
> majority of single-word names are particularly safe to use.

That should have been:

There's *no* need for hyphenated name-spacing for lexical vars.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55914: 28.1; Defining as dynamic an already lexical var
Resent-From: Hendrik Tews <hendrik.tews@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 12 Jun 2022 08:55:03 +0000
Resent-Message-ID: <handler.55914.B55914.165502410228086 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55914
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Phil Sainty <psainty@HIDDEN>
Cc: 55914 <at> debbugs.gnu.org
Received: via spool by 55914-submit <at> debbugs.gnu.org id=B55914.165502410228086
          (code B ref 55914); Sun, 12 Jun 2022 08:55:03 +0000
Received: (at 55914) by debbugs.gnu.org; 12 Jun 2022 08:55:02 +0000
Received: from localhost ([127.0.0.1]:54712 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o0JN8-0007Ip-IQ
	for submit <at> debbugs.gnu.org; Sun, 12 Jun 2022 04:55:02 -0400
Received: from serv1.kernkonzept.com ([159.69.200.6]:55619
 helo=mx.kernkonzept.com) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <hendrik.tews@HIDDEN>) id 1o0JN5-0007HR-4q
 for 55914 <at> debbugs.gnu.org; Sun, 12 Jun 2022 04:55:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
 d=kernkonzept.com; s=mx1; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:
 Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=an2hVeiuDXL1XSjb6fsjO8eeinMQnA33P36vmcNHwm0=; b=SU8PQiWbubr+eWwlqK5z0TbUTB
 lSDSE4+2/rafRtzKIcMYtB02ZAwbl8G+JKBFTee6YGHbWAAmVheRnJcOV1BjBYbpyAGm6QJcNDJU5
 lWKyhiiYUatUbYaXm6Bo0PDIcFhpDfcS0+Bmxj0TQdfozQzqP4SHCtWueVe1PiaHTy/8GDfRnsdlb
 foTvRgLzvRwj32BYDBT3qShgCN69Hl7HBZXrIm3mlmd1X0zdGpXJqbo/vX+E0g+9gD5gKRRr8iJR2
 4z42ch1y7Ao6/O76qJJ5K8d7tFEyfb8lw3LtmjX4l8IWAkLFIVLQhiC8uWQVHNUFyPtmPT5prqqzW
 Nxyf4UxA==;
Received: from [2a02:810a:8d00:56bc:caea:3529:f8e9:e9c2] (helo=cert2)
 by mx.kernkonzept.com with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2)
 id 1o0JN3-004vgr-4Y; Sun, 12 Jun 2022 10:54:57 +0200
Received: from localhost ([::1] helo=cert2)
 by cert2 with esmtps  (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
 (Exim 4.95) (envelope-from <hendrik.tews@HIDDEN>)
 id 1o0JMx-001qLX-4d; Sun, 12 Jun 2022 10:54:53 +0200
From: Hendrik Tews <hendrik.tews@HIDDEN>
References: <87zgiilwbf.fsf@HIDDEN>
 <f6870511b38a34c8aa56224a88862d5e@HIDDEN>
Date: Sun, 12 Jun 2022 10:54:52 +0200
In-Reply-To: <f6870511b38a34c8aa56224a88862d5e@HIDDEN> (Phil
 Sainty's message of "Sun, 12 Jun 2022 12:10:04 +1200")
Message-ID: <87a6ail0rn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi,

thanks for your quick answer.

> Which indicates a bug to be fixed, no?

Well, not as long as the documentation clear states that in this
case the dynamic value is set.

> If the variable is *supposed* to be dynamic (everywhere), then
> lexical libraries which refer to it must declare (defvar FOO) to
> mark it as a dynamic variable, if it's possible that the proper
> definition may not yet have been loaded.

Is this statement in the manual somewhere? If not, would you mind
adding it?

Best regards,

Hendrik Tews




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#55914: 28.1; Defining as dynamic an already lexical var
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 12 Jun 2022 10:35:02 +0000
Resent-Message-ID: <handler.55914.B55914.165503005214509 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 55914
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Hendrik Tews <hendrik.tews@HIDDEN>
Cc: Stefan Monnier <monnier@HIDDEN>, 55914 <at> debbugs.gnu.org
Received: via spool by 55914-submit <at> debbugs.gnu.org id=B55914.165503005214509
          (code B ref 55914); Sun, 12 Jun 2022 10:35:02 +0000
Received: (at 55914) by debbugs.gnu.org; 12 Jun 2022 10:34:12 +0000
Received: from localhost ([127.0.0.1]:54856 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1o0Kv6-0003lx-Jj
	for submit <at> debbugs.gnu.org; Sun, 12 Jun 2022 06:34:12 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53372)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1o0Kv4-0003lf-23
 for 55914 <at> debbugs.gnu.org; Sun, 12 Jun 2022 06:34:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=BtKFFejREWOdpZjhNh5cZcrMFDabOK+g7bwTHo/BdYY=; b=Q2m2mnwVqw4S6bu5wIm6RSAbRn
 Rt3Sms50FAuM1EeeUQIylA9da/vqL1IIxWlihIxmkThlMft9kHoudU61qX3fRmssZi2XtWF2ZhOcp
 3IWaReerPrZup90jLjmUlCq/0piHKz9HEogtqaye5mrRuDhY74FFQV+BDPP42NawQ6lY=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1o0Kut-0003fc-LK; Sun, 12 Jun 2022 12:34:02 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <87zgiilwbf.fsf@HIDDEN>
X-Now-Playing: Everything But The Girl's _Walking Wounded_: "Single"
Date: Sun, 12 Jun 2022 12:33:59 +0200
In-Reply-To: <87zgiilwbf.fsf@HIDDEN> (Hendrik Tews's message of
 "Sat, 11 Jun 2022 23:33:24 +0200")
Message-ID: <87o7yynpbc.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 
 Content preview:  Hendrik Tews <hendrik.tews@HIDDEN> writes: > The
   elisp manual 28.1 says in 12.5 Defining Global Variables: > > If SYMBOL is
    already lexically bound (e.g., if the =?UTF-8?Q?=E2=80=98defvar=E2=80=99?= form > occurs in a =?UTF-8?Q?=E2=80=98let=E2=80=99?=
    form with lexical binding enabled), the [...] 
 
 Content analysis details:   (-2.9 points, 5.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hendrik Tews <hendrik.tews@HIDDEN> writes:

> The elisp manual 28.1 says in 12.5 Defining Global Variables:
>
>      If SYMBOL is already lexically bound (e.g., if the =E2=80=98defvar=
=E2=80=99 form
>      occurs in a =E2=80=98let=E2=80=99 form with lexical binding enabled)=
, then =E2=80=98defvar=E2=80=99
>      sets the dynamic value.
>
>>From this I would conclude that the error is a bug. Or did I
> overlook something in the documentation?

There's been some back and forth about what happens in these cases.
This section in the manual currently reads (in Emacs 29):

---
If @var{symbol} is already let bound (e.g., if the @code{defvar}
form occurs in a @code{let} form), then @code{defvar} sets the toplevel
default value, like @code{set-default-toplevel-value}.
---

However, your test case signals an error, so I think the documentation
needs further clarifications here:

    (let ((test-var nil))
      (eval '(defvar test-var t "XXX")))

I've added Stefan to the CCs.

--=20
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Last modified: Sun, 12 Jun 2022 10:45:02 UTC

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