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: Fri, 14 Oct 2022 09:34:00 -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="34817"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Phil Sainty , Stefan Kangas , 58513@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 14 15:35:59 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 1ojKr1-0008oO-FT for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Oct 2022 15:35:59 +0200 Original-Received: from localhost ([::1]:46098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojKqz-0005Ff-P3 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 14 Oct 2022 09:35:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojKq6-0005Ej-Kn for bug-gnu-emacs@gnu.org; Fri, 14 Oct 2022 09:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojKq6-0007s3-CD for bug-gnu-emacs@gnu.org; Fri, 14 Oct 2022 09:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojKq6-0003ME-7l for bug-gnu-emacs@gnu.org; Fri, 14 Oct 2022 09:35: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: Fri, 14 Oct 2022 13:35: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.166575445812841 (code B ref 58513); Fri, 14 Oct 2022 13:35:02 +0000 Original-Received: (at 58513) by debbugs.gnu.org; 14 Oct 2022 13:34:18 +0000 Original-Received: from localhost ([127.0.0.1]:36251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojKpN-0003L3-NR for submit@debbugs.gnu.org; Fri, 14 Oct 2022 09:34:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:65094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojKpL-0003Kc-7k for 58513@debbugs.gnu.org; Fri, 14 Oct 2022 09:34:16 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3D045807E8; Fri, 14 Oct 2022 09:34:09 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D0D3A80014; Fri, 14 Oct 2022 09:34:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665754447; bh=XGLmEWYrZAa1zKJHrRQXhdBWh4q8qJvx1LvifuiHjOk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=h0fE/sp5KUf+wLdnmJ0Hb6kSlPpaQ4hsTejlThbXQZULIERw3NnozX8CEzcPVY0V3 1XwMBc5+qN7KTRgkPW23MNFxecxnitU5CWuPlbJLW8KGo+NSZgkvpw8GBg1qyrGZg4 CatPqJlQE/oyFXtdIy7u8xjEKZiUGupWePCq6ek14lGFtnyctdpt2dvs/hRL57Vw0E wHS+pnZyyuk/ne1UtSDCeOCjJLpAZPIoVMG3iUplVTtplY43k9tmBN8Ok7W58i6Rva ZroqFy8MxXJud5nvm+yTX6osbp7W/k4HrvVHTkXt9thMrJcPYSVrjeiPduknMYuqw+ 1r/Cw9KOmoRMA== Original-Received: from alfajor (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 98D2912090D; Fri, 14 Oct 2022 09:34:07 -0400 (EDT) In-Reply-To: <87edva8seu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 14 Oct 2022 15:07:53 +0200") 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:245447 Archived-At: >> Yes, incurring a run-time cost doesn't sound worth it, but we could >> perhaps make the byte-compiler warn about it. The byte-compiler already does warn about it, but only if the assignment is in the same file as the `defconst`. FWIW, my own local Emacs has `defconst` create actually constant variables by adding a `SYMBOL_DEFCONST` to `enum symbol_trapped_write`. Admittedly I didn't make them really constant: I allow a subsequent `defconst` to change the value set by a previous `defconst`, but `setq` signals an error just like it does if you try to `setq` on `enable-multibyte-characters` or on `nil`. I didn't bother exporting this info to `describe-variable` (and the byte-compiler) but it would be easy to do. Stefan