From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63410: 30.0.50; [FR] Optionally allow defcustom to check type for standard value Date: Wed, 10 May 2023 13:22:34 +0800 Message-ID: Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12204"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.11.3; emacs 30.0.50 To: 63410@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 10 07:37:30 2023 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 1pwcW1-00031m-Aa for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 May 2023 07:37:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwcVb-0000Ps-Eq; Wed, 10 May 2023 01:37:03 -0400 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 1pwcVa-0000Pk-8A for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 01:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwcVZ-00042k-UD for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 01:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pwcVZ-0000TW-Q7 for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 01:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ruijie Yu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 May 2023 05:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63410 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.16836970081806 (code B ref -1); Wed, 10 May 2023 05:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 May 2023 05:36:48 +0000 Original-Received: from localhost ([127.0.0.1]:45030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwcVM-0000T4-Hl for submit@debbugs.gnu.org; Wed, 10 May 2023 01:36:48 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:47338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pwcVI-0000St-Hi for submit@debbugs.gnu.org; Wed, 10 May 2023 01:36:46 -0400 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 1pwcVG-0000NI-CX for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 01:36:42 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwcVD-0003t0-4o for bug-gnu-emacs@gnu.org; Wed, 10 May 2023 01:36:41 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 5e793040 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 10 May 2023 05:36:33 +0000 (UTC) Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz 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, 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-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:261468 Archived-At: Similar to `setopt' introduced in 29, which warns when a variable gets assigned a value with an incorrect type, I hope `defcustom' can (optionally) check that the standard value of a customizable variable is correct. This would help external as well as internal package authors to catch errors on the types. I don't know how to define such optionality though -- can/should it also be a customizable variable? Or maybe it should just be a function/command which checks customizable variables (e.g., a single variable; a group; all of them; etc.), and warns about all the type mismatches along the way? In addition, a "check all variables within this group (and subgroups)" might be helpful as well. At the moment, the only via workaround I know of to check existing value type for any given variable is this: (setopt variable variable) But this introduces the runtime cost of the :set function, which sometimes do pretty expensive things like (re-) loading a package. Another workaround I know of, of course, is to run M-x customize-variable on the variable, but that is painfully slow compared to the first workaround. If no-one gets to it first, I may start looking into how to implement it within a week or two. -- Best, RY