From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58513: describe-function should say that defconst variables are constant Date: Sat, 15 Oct 2022 10:11:35 -0400 Message-ID: References: <87zgdy8ug8.fsf@gnus.org> <8fae3292e6c1b175853b557060d05487@webmail.orcon.net.nz> <87v8om8tok.fsf@gnus.org> <87edva8seu.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28161"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Phil Sainty , Lars Ingebrigtsen , 58513@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 15 16:12:12 2022 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 1ojhtZ-00076i-HN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 16:12:09 +0200 Original-Received: from localhost ([::1]:37762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojhtY-00063X-6x for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 10:12:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojhtS-00062U-QH for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojhtS-0002Hw-IC for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojhtS-0008UO-5S for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 10:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2022 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58513 X-GNU-PR-Package: emacs Original-Received: via spool by 58513-submit@debbugs.gnu.org id=B58513.166584310732610 (code B ref 58513); Sat, 15 Oct 2022 14:12:02 +0000 Original-Received: (at 58513) by debbugs.gnu.org; 15 Oct 2022 14:11:47 +0000 Original-Received: from localhost ([127.0.0.1]:42311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojhtC-0008Tt-UJ for submit@debbugs.gnu.org; Sat, 15 Oct 2022 10:11:47 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojhtA-0008Tf-Tc for 58513@debbugs.gnu.org; Sat, 15 Oct 2022 10:11:45 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 25481100130; Sat, 15 Oct 2022 10:11:39 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B9477100084; Sat, 15 Oct 2022 10:11:37 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665843097; bh=EYk8re3KK43526q+qTG5bloIGGmogtcAZ4fmS6AOX1I=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CJVo8V0sjrDG6lQOcyBWKGBVSOYzGMqfvQg4ydGtn/Z4O/uHTZHMHcZRsdIkSM1fa PLQuBB4FVwILwh/W+6o9mrwicMRHV0qRgAuIxWJHTS3Fpv5aA6onoCgIM7nXeIDEja Z/g4EJRQihPFy8bS9fAw2+/1gaI7wDbQKm9gM8oAPd/+P7+bDUicdDTY6A/GR/E7iT yM4SoIBu5l4D4IYH+JMPpQ/O3gl4GIdwC5FAwdkbV7GkfK+NDmUsNzjsKlgAIKHlIr ehiuekzyP/nkvsuGbZUequ66wNGXRBSfVPB/wgiOaUz/NKKKD08Y5ypiIGq66aU3Q+ 6WkAZR5nXDrug== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4AA3B1205E5; Sat, 15 Oct 2022 10:11:37 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Sat, 15 Oct 2022 12:33:29 +0000") 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" Xref: news.gmane.io gmane.emacs.bugs:245559 Archived-At: Stefan Kangas [2022-10-15 12:33:29] wrote: > Stefan Monnier writes: >> The byte-compiler already does warn about it, but only if the assignment >> is in the same file as the `defconst`. > I don't get any warnings with this recipe: > > echo "(defconst foo-bar t) (setq foo-bar nil)" > /tmp/foo.el > emacs -Q -batch -eval '(byte-compile-file "/tmp/foo.el")' > > Am I missing something? Hmm... I don't get a warning either. And looking at `bytecomp.el` I see that we push stuff to `byte-compile-const-variables` but we never look stuff up in it :-( I'm pretty sure I wrote some code to use that variable (apparently around 2003), but apparently it got lost in subsequent changes, probably when we introduced lexical-binding. Stefan