GNU bug report logs - #63410
30.0.50; [FR] Optionally allow defcustom to check type for standard value

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Ruijie Yu <ruijie@HIDDEN>; dated Wed, 10 May 2023 05:37:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 63410 <at> debbugs.gnu.org:


Received: (at 63410) by debbugs.gnu.org; 11 May 2023 14:08:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 11 10:08:44 2023
Received: from localhost ([127.0.0.1]:53091 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1px6yJ-0001uf-MX
	for submit <at> debbugs.gnu.org; Thu, 11 May 2023 10:08:44 -0400
Received: from netyu.xyz ([152.44.41.246]:44034 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1px6yE-0001uR-DA
 for 63410 <at> debbugs.gnu.org; Thu, 11 May 2023 10:08:42 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id b44ad50d
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Thu, 11 May 2023 14:08:36 +0000 (UTC)
References: <sdvwn1gagtm.fsf@HIDDEN>
 <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
 <sdvmt2c9r4t.fsf@HIDDEN> <83ttwk6vq4.fsf@HIDDEN>
 <sdv7ctfa9ju.fsf@HIDDEN>
User-agent: mu4e 1.11.3; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
To: 63410 <at> debbugs.gnu.org
Subject: Re: bug#63410: 30.0.50; [FR] Optionally allow defcustom to check
 type for standard value
In-reply-to: <sdv7ctfa9ju.fsf@HIDDEN>
Date: Thu, 11 May 2023 22:08:20 +0800
Message-ID: <sdvh6sj7ygb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 63410
Cc: Eli Zaretskii <eliz@HIDDEN>, drew.adams@HIDDEN
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: 0.0 (/)

--=-=-=
Content-Type: text/plain


Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes:

> In that case, I had my semi-parallel second proposal: provide a command
> that checks for a group of variables and see if types of all variables
> within the group (or its subgroups) are correct.

Regarding the second proposal: I have quickly hacked together a
functional example of type checking, see the attachment.  If we think
this should be integrated into Emacs, I can make some minor edits and
propose a patch.  In that case, I would probably put the functions
somewhere in cus-edit.el or custom.el.

Note that at the moment it depends on the internal function
`custom--standard-value', which is a one-line function accessing a
property of the symbol.


--=-=-=
Content-Type: text/plain
Content-Disposition: attachment; filename=cfg-check-defcustom.el

;;; cfg-check-defcustom.el --- Ensure type-strictness of defcustom

;;; Commentary:

;;; Code:
(autoload 'customize-read-group "cus-edit")
(autoload 'custom-variable-prompt "cus-edit")

(defun ccd (variable)
  "Check the standard value of VARIABLE is of the correct type."
  (interactive (custom-variable-prompt))
  (custom-load-symbol variable)
  (when-let ((type (get variable 'custom-type)))
    (let ((value (custom--standard-value variable)))
      (unless (widget-apply (widget-convert type) :match value)
        (warn "Type mismatch on `%s': value `%S'; type %s"
              variable value type)))))

(defun ccd--vars-in-group (group &optional recursive)
  "Return a list of all variable symbols contained in GROUP.
When RECURSIVE is non-nil, the list contains variables in
subgroups recursively."
  (when-let (((symbolp group))
             (gp (get group 'custom-group)))
    (let* ((filter
            (lambda (s)
              (mapcar
               #'car (seq-filter (lambda (c) (eq s (nth 1 c))) gp))))
           (child (funcall filter 'custom-variable))
           (subgroup (and recursive
                          (funcall filter 'custom-group))))
      (nconc child (mapcan #'ccd--vars-in-group-r subgroup)))))

(defun ccd--vars-in-group-r (group)
  "Shorthand for \\(cfg-check-defcustom--vars-in-group GROUP t)."
  (ccd--vars-in-group group t))

(defun ccd-group (group &optional recursive)
  "Check all variables within GROUP.
When RECURSIVE is non-nil, check the group recursively.  See also
`cfg-check-defcustom'."
  (interactive (list (customize-read-group) current-prefix-arg))
  (mapc #'ccd (ccd--vars-in-group (intern group) recursive)))

(provide 'cfg-check-defcustom)
;;; cfg-check-defcustom.el ends here.

;; Local Variables:
;; read-symbol-shorthands: (("ccd" . "cfg-check-defcustom"))
;; End:

--=-=-=
Content-Type: text/plain


Also, note that I added the symbol into the warning text because the
goal of this command is to mass-check an entire group, whereas `setopt'
did not mention the variable symbol name.  Not sure if `setopt' should
show the symbol in trouble, but I understand if we don't want to do
that.

-- 
Best,


RY

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.

Message received at 63410 <at> debbugs.gnu.org:


Received: (at 63410) by debbugs.gnu.org; 11 May 2023 02:26:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 10 22:26:09 2023
Received: from localhost ([127.0.0.1]:49357 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pww0N-0003Wv-Ic
	for submit <at> debbugs.gnu.org; Wed, 10 May 2023 22:26:09 -0400
Received: from netyu.xyz ([152.44.41.246]:34358 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1pww0H-0003WX-Ve
 for 63410 <at> debbugs.gnu.org; Wed, 10 May 2023 22:26:05 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id ffecc44c
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Thu, 11 May 2023 02:26:00 +0000 (UTC)
References: <sdvwn1gagtm.fsf@HIDDEN>
 <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
 <sdvmt2c9r4t.fsf@HIDDEN> <83ttwk6vq4.fsf@HIDDEN>
User-agent: mu4e 1.11.3; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#63410: 30.0.50; [FR] Optionally allow defcustom to check
 type for standard value
In-reply-to: <83ttwk6vq4.fsf@HIDDEN>
Date: Thu, 11 May 2023 10:25:41 +0800
Message-ID: <sdv7ctfa9ju.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 63410
Cc: 63410 <at> debbugs.gnu.org, drew.adams@HIDDEN
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: 0.0 (/)


Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: "63410 <at> debbugs.gnu.org" <63410 <at> debbugs.gnu.org>
>> Date: Wed, 10 May 2023 22:51:14 +0800
>> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>> 
>> My request is that Emacs should (optionally, maybe behind a defcustom,
>> or configure, or cli flag, etc.) warn you warn a defcustom's standard
>> value does not match its declared type.
>
> Warn you at what time?  When defcustom is byte-compiled? when it is
> evaluated at run time? when the user says "M-x set-variable"?
> something else?

I was initially thinking of at runtime, but now that you mention it,
byte-compilation time sounds more reasonable.

So, I would say check the type unconditionally on byte-compilation time,
or when something is toggled on, check the type at runtime if a
defcustom is not compiled.

>> Since a similar warning is already in place for `setopt', I don't
>> think it is farfetched to request `defcustom' to follow suit.
>
> setopt says it when you invoke it.  But setopt is designed to be
> called as a function at run time, whereas defcustom isn't.

In that case, I had my semi-parallel second proposal: provide a command
that checks for a group of variables and see if types of all variables
within the group (or its subgroups) are correct.

-- 
Best,


RY




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.

Message received at 63410 <at> debbugs.gnu.org:


Received: (at 63410) by debbugs.gnu.org; 10 May 2023 15:39:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 10 11:39:24 2023
Received: from localhost ([127.0.0.1]:48718 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwluW-0001W9-7L
	for submit <at> debbugs.gnu.org; Wed, 10 May 2023 11:39:24 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56588)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pwluT-0001Vu-7f
 for 63410 <at> debbugs.gnu.org; Wed, 10 May 2023 11:39:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwluK-0001km-L5; Wed, 10 May 2023 11:39:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=sSyb1D+ZC+T7U7bIEMAjrP1TpSmcdRzV5tsmnQKanyQ=; b=BnQ4KpuQmZJM
 mSmE8Vgv2yUiYbcyRsYLZe2idC0lZGyd83CLpVrp0J9wpzKSOgHp05tGsH4eZERe19MbgpK9eHASu
 Geb2ef5vpkBrYdt5HpPhyJu9naTXqOcwbiqFSxEGMiUh0y+becAy6OM59l+6Qm6HXmuRv7ExT2Gm5
 3Zb5QYD4BPzeGr0wAZPcz45sBWH45EMW0kyJWdPJ6Y4E4sJ23DKtsnyhBqlvr6dj2a6oCIufUAWTu
 YMaprzhlmzzRcy14GPxNsNHL6IHPXUZedRE4GuR/DHhSLEGK9uKI/FQHBDizhcfBu8vWDyluJrbzH
 Dlcc8eppIIZZOppNflfw4w==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pwluK-00047x-55; Wed, 10 May 2023 11:39:12 -0400
Date: Wed, 10 May 2023 18:40:19 +0300
Message-Id: <83ttwk6vq4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ruijie Yu <ruijie@HIDDEN>
In-Reply-To: <sdvmt2c9r4t.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#63410: 30.0.50;
 [FR] Optionally allow defcustom to check type for standard value
References: <sdvwn1gagtm.fsf@HIDDEN>
 <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
 <sdvmt2c9r4t.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 63410
Cc: 63410 <at> debbugs.gnu.org, drew.adams@HIDDEN
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 (---)

> Cc: "63410 <at> debbugs.gnu.org" <63410 <at> debbugs.gnu.org>
> Date: Wed, 10 May 2023 22:51:14 +0800
> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> My request is that Emacs should (optionally, maybe behind a defcustom,
> or configure, or cli flag, etc.) warn you warn a defcustom's standard
> value does not match its declared type.

Warn you at what time?  When defcustom is byte-compiled? when it is
evaluated at run time? when the user says "M-x set-variable"?
something else?

> Since a similar warning is already in place for `setopt', I don't
> think it is farfetched to request `defcustom' to follow suit.

setopt says it when you invoke it.  But setopt is designed to be
called as a function at run time, whereas defcustom isn't.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.

Message received at 63410 <at> debbugs.gnu.org:


Received: (at 63410) by debbugs.gnu.org; 10 May 2023 14:51:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 10 10:51:50 2023
Received: from localhost ([127.0.0.1]:48631 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwlAU-000083-4u
	for submit <at> debbugs.gnu.org; Wed, 10 May 2023 10:51:50 -0400
Received: from netyu.xyz ([152.44.41.246]:35240 helo=mail.netyu.xyz)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1pwlAO-00007m-SB
 for 63410 <at> debbugs.gnu.org; Wed, 10 May 2023 10:51:48 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id dc9fa7be
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); 
 Wed, 10 May 2023 14:51:41 +0000 (UTC)
References: <sdvwn1gagtm.fsf@HIDDEN>
 <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
User-agent: mu4e 1.11.3; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
To: Drew Adams <drew.adams@HIDDEN>
Subject: Re: bug#63410: 30.0.50; [FR] Optionally allow defcustom to check
 type for standard value
In-reply-to: <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
Date: Wed, 10 May 2023 22:51:14 +0800
Message-ID: <sdvmt2c9r4t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 63410
Cc: "63410 <at> debbugs.gnu.org" <63410 <at> debbugs.gnu.org>
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: 0.0 (/)


Drew Adams <drew.adams@HIDDEN> writes:

>> 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.
>
> Not sure I understand.  Doesn't it do that already,
> showing "mismatch" next to the default value if it
> doesn't match the type definition?

Yes, it does, but I think it is not "automated" enough, since you would
have to go over the variables one at a time.

My request is that Emacs should (optionally, maybe behind a defcustom,
or configure, or cli flag, etc.) warn you warn a defcustom's standard
value does not match its declared type.  Since a similar warning is
already in place for `setopt', I don't think it is farfetched to request
`defcustom' to follow suit.

Alternatively, or in addition to the above, maybe provide a
function/command that checks types for a group+subgroups, or for all
defined customizable variables.  Again, this would help package authors
to catch typing errors which would otherwise be quite difficult to
catch.

As I mentioned upthread, using `setopt' directly like the following
snippet is unnecessarily expensive: it calls the :set function of a
customizable variable, where the only thing we want is to check its
type.

```emacs-lisp
(defcustom expensive-var t
  :type 'string
  :set (lambda (n v)
         (dotimes (_ 424242) 'expensive)
         (set n v)))
(setopt expensive-var expensive-var)
;; warns the user that the type is correct, but only after spending a
;; long time in the :set function
```

-----

Let me also explain the reason behind this request.  I have encountered
this scenario multiple times, where when I `setopt' something for a
customizable variable according to its docs, I get a warning saying that
the type is incorrect.  Examples of this scenario include eshell, mu4e,
and pyim.

Seeing this type of warning would prompt me to examine the entire
package in which the warning occurs.  I would have to rgrep the entire
package, and examine the types of each defcustom one-by-one, fixing all
type errors along the way.  When I encounter difficult-to-parse types I
would do the `(setopt var var)' method to save time and brain cells.

And here comes my feature request.  We have the warning in `setopt'; we
have some visual indication in the customization view; and I want to
have one more: to know when a defcustom call defines a wrongly-typed
standard value.

-- 
Best,


RY




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.

Message received at 63410 <at> debbugs.gnu.org:


Received: (at 63410) by debbugs.gnu.org; 10 May 2023 13:37:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 10 09:36:59 2023
Received: from localhost ([127.0.0.1]:45562 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwk03-0005XN-NT
	for submit <at> debbugs.gnu.org; Wed, 10 May 2023 09:36:59 -0400
Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:18126)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1pwjzz-0005XB-Es
 for 63410 <at> debbugs.gnu.org; Wed, 10 May 2023 09:36:57 -0400
Received: from pps.filterd (m0333520.ppops.net [127.0.0.1])
 by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 34A9Xw0l005657; Wed, 10 May 2023 13:36:54 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;
 h=from : to : subject :
 date : message-id : references : in-reply-to : content-type :
 content-transfer-encoding : mime-version; s=corp-2023-03-30;
 bh=H0zuF/Zs9AoJlwGMOfzpUBMw3yvUWiE7ad2TrImRXBU=;
 b=bVGRD4eDKSeRbSYYcrDBMFb+k3FGUWSiZyc44LCqmd7tMCQYnyEa5f8gtGYjRWbDVZNA
 0sTBdPdoD5n0lj131R8QCyYywQZeZ2/3KDcuxh+UAj6q2TJmgyCOlMUrrOKs8u87G6o5
 c1tBfDh5aOIaFNiwkBB8dyLTMa2gUpTX1Sa88PK/3iTlNnR7c8OqT+Csck9v9yz648SZ
 SCOIluqATXmzmcZT5wM8zhUtxLsNOyqeCX8nyF10725DkmMdeeAzDldjT2Aqr3J4Pjx8
 cd1W2ANgHV5QlzljNDW7GU62xOYAsfZsg9UdnSnz8omGOHhYmr315l6xd2IWWO9mitp3 fQ== 
Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com
 (phxpaimrmta03.appoci.oracle.com [138.1.37.129])
 by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qf7754mj9-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 10 May 2023 13:36:54 +0000
Received: from pps.filterd
 (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1])
 by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19)
 with ESMTP id 34ABs9ww021644; Wed, 10 May 2023 13:36:53 GMT
Received: from nam12-dm6-obe.outbound.protection.outlook.com
 (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168])
 by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id
 3qf8121tvj-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);
 Wed, 10 May 2023 13:36:53 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=n5jboYKzSUXLEtxuPuRL0eHiAFsGzLoIQ/X0XN8hr+P2VKglfziO3iYig7HJbnaP84zEo+FSZ+3rriYSBm6x5xrJWqLgypYJP8FTrSEz0EGLWrOyWsVKmQ947ZiUy0gCZ2D35+W9Z5fLDPXc7tsWKcSApjVmoQ2IRUvqBtwNye4vmdLKyyqoJLWfHF+hZO4uxsaYz/+IlzzdBMuPH0us+UxYDQnJvQA5xZxeRAvT8e6QdxUicpHfyQTRPeVZom3ja3wo93IxkoCN/FRmfzmn1vWhYz3pgxYW00OcyC40AqOeN9ltbGxf0JW624paEOgkioXk2+SXg5qXHMGnW61xYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; 
 s=arcselector9901;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=H0zuF/Zs9AoJlwGMOfzpUBMw3yvUWiE7ad2TrImRXBU=;
 b=T3ArpGGgrdG9VQhvKra30LOeLpBihv0BBZepjVqBp3AFGmh/P454AALAoJUo2s4MRBZPmXLbG64fgGyx5LOnDqCEVRpGbtJR77KZIfTBvQHK4NkskEvn4XHT9i4FWlY9WEtJ0Wn2lse1c82/Qrk/8dV73bBwTvaaOEte2RXKZ8MWYTDCWCDzUSMzMmSGQ6kV92/nAUV+F9xXHHVJyn85qkTC5LcyRss94+2KW87OvEpJ/oDugRMWLZEa60xUxqnyiiTIIZ0zIp7PA9D95M63hufb91nL91Cr9NB0WT+ElhUGpPyLKh7xyPXcxv0ZaHFs0OijXQz/exWGIfeuE92Iwg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com;
 dkim=pass header.d=oracle.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=H0zuF/Zs9AoJlwGMOfzpUBMw3yvUWiE7ad2TrImRXBU=;
 b=YLBa+gsu59RkV0blTGL3HNWT7HcANiv4ZkPVl3YWxKO8vstrZl3HaI1vhVKznQG19adoe623nyQVTmgR7NGqZ7aW9Ta4UC24FCFuULQ5V7pX3TPfwJitxLtFub121mj079HgZtt9wfd1nyIE89Ms6Boto1MOhBIWGTojmAgwuXo=
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19)
 by CO6PR10MB5393.namprd10.prod.outlook.com (2603:10b6:5:35e::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May
 2023 13:36:49 +0000
Received: from SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::a995:2ae5:2745:24ff]) by SJ0PR10MB5488.namprd10.prod.outlook.com
 ([fe80::a995:2ae5:2745:24ff%6]) with mapi id 15.20.6387.019; Wed, 10 May 2023
 13:36:49 +0000
From: Drew Adams <drew.adams@HIDDEN>
To: Ruijie Yu <ruijie@HIDDEN>, "63410 <at> debbugs.gnu.org"
 <63410 <at> debbugs.gnu.org>
Subject: RE: [External] : bug#63410: 30.0.50; [FR] Optionally allow defcustom
 to check type for standard value
Thread-Topic: [External] : bug#63410: 30.0.50; [FR] Optionally allow defcustom
 to check type for standard value
Thread-Index: AQHZgwF/7IsqpQEHo02tbZGCWwF6ea9TgqaQ
Date: Wed, 10 May 2023 13:36:49 +0000
Message-ID: <SJ0PR10MB5488220DD9597357CE80230FF3779@HIDDEN>
References: <sdvwn1gagtm.fsf@HIDDEN>
In-Reply-To: <sdvwn1gagtm.fsf@HIDDEN>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|CO6PR10MB5393:EE_
x-ms-office365-filtering-correlation-id: 05eddda1-77d5-458d-b8ab-08db515b9b88
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: TPoskk+/6wqUTfbYuzEbiLQ14GbleX+AjJ/zBdEmUZ78IBLXOcvowtve4lnjQxJ7Jo6rhLbg9bEFnB7rYRg7n6JhZX6Np7O9fyjwQn7/D7J+/8wwMyXQh5ks6EIByaF31r5eUC0R4IkeyRBbY9KpmnzGc7YDS2NSnnam4+qoMWnChVmoqKYOn4wbmlMO3J7BX5AgIV6ESLKqWf2Wb8ENMWNwWpn/hpBWZ8AsfY3HoXusrgh2QorZPG2DPXfVvhu5ZWvs3ZpSBPYWQX6hTxd4sjBcEMgKbdeYyodf5joMi+UaARL74GaEoaujhRjEH6q6yavZ6W5qy2e34VPi4m8gibH7SeH5YFNHmIfValPsirhTH6Ukcqo1ZpIfA1dX+o5DDzQJFVgMCPmEC1i4/IpmMYDXuSkmpRiMqNL9cJSN53N3HAT/Z9ViciVWYfvTDOxLVzrWLtEbmI2EBcMr3oSrSD1LVR94CDeb19YWl0SuIoxNTqR6aLjukxRNWsjSAxkqCjRZ9h1HhuWO/KUnI8z06a2Kw6ZyWbzVwUrpboS+kP/7CaCgRGcxYK1nc21Z3tJjRoGD0TS0GKbtlJjFrV8LGVN5/oeIBV8NAtm28j3+Or7+tI/Y1AyVMh1TsHv9PiWu
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230028)(39860400002)(136003)(396003)(376002)(346002)(366004)(451199021)(9686003)(122000001)(26005)(6506007)(38100700002)(86362001)(76116006)(66946007)(66556008)(55016003)(33656002)(4744005)(44832011)(2906002)(478600001)(316002)(8676002)(66476007)(41300700001)(5660300002)(8936002)(110136005)(52536014)(64756008)(66446008)(38070700005)(7696005)(71200400001)(186003);
 DIR:OUT; SFP:1101; 
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?v7nJ+4qD0T0GbOSKCjAoWBzI1RMpsfUsLwr4up4v71/WciZnxiZ53sySBGQk?=
 =?us-ascii?Q?vvC/+Pe8ZKcnOzwsI4cOLzOpaC3iKMoRvfh5eR9krSYbhN2Xp8SUNW6Htfjf?=
 =?us-ascii?Q?fB1ck8rmPmpA4rh5dNCtcRLZQKZ/18Yh2SfGbkrb+FioY6/7DNkavqwefBIN?=
 =?us-ascii?Q?8j82ifnrAKTuq4I93JdQYcKOh7XwNQaDE6p/5fG2ZKBy9KvTzkYaRJWfNwVy?=
 =?us-ascii?Q?zBLmgjRaFui42zmDLKS6TnN5/ElqRscZSq2c1lCuJurcYzaTTqJdxM12wFrR?=
 =?us-ascii?Q?n/pPSlScDaI1YcXT4JXCbqBJmgB6UGyUYPClBRIZ+/MnWWVseEyAAKf00U83?=
 =?us-ascii?Q?ssAr7y0aOwKB5HEEk/VBdfJvaSa54ztHMqNCeiEdBn1ZGlB7VQqnEDUN5ka8?=
 =?us-ascii?Q?TL/ZnMLfBOOo1xii4mJSYYMGDqJZJn6pQrgfn6G44BZJ4UKODX/aXVtCN5cR?=
 =?us-ascii?Q?7GGALb+FIiCONS3XDbSbC/5CHlnzhkDHihhTIcWP8SbKqshPUXzWUMcOXmzo?=
 =?us-ascii?Q?NC0RzbbS+p5xgxJOb+0IR4ZI8NPVgtpunpe5E0chU1qZPvm+Z1u7adY6JUH9?=
 =?us-ascii?Q?HxWNN5W+BRXeBls/gC9zIYYSEroswTpgWb3wujGxIBnFCb/G2Nf0ybWZkbHa?=
 =?us-ascii?Q?P6efYf5WL5R8X8TkegSKtKxqYE2hKD09MbTQDvw+YLMcmlmx//3ggkzt2ch+?=
 =?us-ascii?Q?Dkn6UnxE0/lxxklW49alcmXlSGUqu5Y1Lc/8AWCZCo2hlnd21FRFAYjo2700?=
 =?us-ascii?Q?wrY33bAn9pB0M9cz7X65x+AOePlizWQjEhER15Zyu1F4vHle03YNzbwZaAXC?=
 =?us-ascii?Q?3Z06ic8YzSK+PubgmNM4uz1+K3xR64Cc5W+WheyDCzoqIRV6Qdzegyusrgnx?=
 =?us-ascii?Q?6WIXFv/Mm3HA5f86oXWlJCp/+fp1EWzw94P6WMnJouF+SLRE4DhhETrUegYY?=
 =?us-ascii?Q?n5HF8rIczlysihgsD+t50YIo5cx62tjRzXfhosnCOKK7fDhp/EQMlukBFn8k?=
 =?us-ascii?Q?2QtOuXCdmu6U8ZBNgchcLKXttToHR+qEiPWMNnrNTwpF3v6Mt4bAaodrHE4B?=
 =?us-ascii?Q?tW1C5Tw7OPRSbQD90tu1IC+VxH/8E9lU9cnfMQXq9uCY9H0oUNnQxBSf713J?=
 =?us-ascii?Q?uXSjrq2Eqc315CzUDU1D4QH55Sl6YvtQpDDrOjMdhb+4/zJpndCvq8FLP+cQ?=
 =?us-ascii?Q?Zz3rHpI1IuV9aLy2xPDidKlsuwd+/YoBmLIplJ7GL2+F8inCzfWvYaQ7Aw/P?=
 =?us-ascii?Q?L4XLsJiVfYVRrwTk6ZPLn2ZnBi7nxOfDeINd3Qb9FDZDuDgBciXE+sBY2+6V?=
 =?us-ascii?Q?UY+QOX1oCYCSbLRwBEQG2ih920O0Tts6CoiU3/ZemUwLbODPv1O754MrcYW/?=
 =?us-ascii?Q?BeS9Q/2Vg0NYY62UM0P5D0ZuA0eSfG9Llex3pgNUg4q7sqts2dR84qXOoacC?=
 =?us-ascii?Q?7UOP3THxLkyobbkugmoco7m51XiWgUu7A9NZN8UfrgzxJb2AlWNWJZkQh7Z7?=
 =?us-ascii?Q?FJqn+yb094A5QuRxr+/ZxUIsYXLTTm6u1+KnQO46P6/qesZFA6jrwvVdJCdk?=
 =?us-ascii?Q?t+X+Cv0BUKtC/Sc7XNGOSY8Trg/uVxIg35wd6QBQ?=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SccHhEC5YSBbvSqsWWgTkM2R0tgpEDL54wu1xTWYaszhkCep3hXmSl48gg9c8MJLc2Ca502X1ZUxhANi/Cn66fyk/hSny951vG0Yl1zvdUUdotQ/gjbIlyBlmnim6lCtwJNivitTdi9uXJwTW1a5/0E59NVe+RgHJKSpbS3rQ357+u+l039/himNdztcjK1Q7vJy7DlEQkiQQluS3sfs52gN8LUjeZGHb8xAsc8/zNbMvyitViW0U9MD0b8O0kOjLZNNjsAYU+IYdwa1V+MigpsJ/esJY/qggtfi5+aPxwvaJ7V+X7QM2vuArXqFlyZKDsN9eRConEX6jAwdZpRvfLeFjlSbt3FOldSwFQoHV+VvqEFC61kHiecLq/4wk5R2IUg7/NCZpM2RgQOpE66fkV6ZL9wZRpeDhpcQA07YZi/CLOaRT70sG0sx8Ep5SeM+a271ZCrWnGm5XlezDXDaZkaZvYg2zisXij12msy7KMTHmHLmExNqIBnRnmJYSixDEgkKfTBFIaqMB1ZExcZq+8y4f6FlYZ6PSP2rJ7+7/R2tEG7WVtROfKyRkZhz7tPF/PlsOjLA6w5DcoZxOZn76ABKWRRujnf4+ORWZK+5iWhjhro3CeYk8cLXcTlA+kJ/tUkD2R/vAj3w6oZpyXN7Y6se22WWRGASIPecBc7oD73O5hOb1JitmMkA/HzGN6dzIZivrZu7wRHtgKRo8bQMm3bZCgWzt8hWt/26GWfIxrtptrNKJfes7Phzk5VVgw98XFqvDBsdZoHonrfiWyYEnnglREriJ/qUCLu6F3YSKTg=
X-OriginatorOrg: oracle.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 05eddda1-77d5-458d-b8ab-08db515b9b88
X-MS-Exchange-CrossTenant-originalarrivaltime: 10 May 2023 13:36:49.5802 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: HOHqqRsxVZgtOQeh/sjKwQZBZWaVRvXh/ws4mFoAJ0Wootvk8PlrsrjVC+xTAQyfSebQOZ7WONHBWoTmofSa0Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5393
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22
 definitions=2023-05-10_04,2023-05-05_01,2023-02-09_01
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=916
 phishscore=0
 adultscore=0 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0
 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.12.0-2304280000 definitions=main-2305100108
X-Proofpoint-GUID: Xq3XEmUwhoTvcaYZ0INFMqvusaES5Gby
X-Proofpoint-ORIG-GUID: Xq3XEmUwhoTvcaYZ0INFMqvusaES5Gby
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 63410
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.7 (-)

> 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.

Not sure I understand.  Doesn't it do that already,
showing "mismatch" next to the default value if it
doesn't match the type definition?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 10 May 2023 05:36:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 10 01:36:48 2023
Received: from localhost ([127.0.0.1]:45030 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pwcVM-0000T4-Hl
	for submit <at> debbugs.gnu.org; Wed, 10 May 2023 01:36:48 -0400
Received: from lists.gnu.org ([209.51.188.17]:47338)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ruijie@HIDDEN>) id 1pwcVI-0000St-Hi
 for submit <at> debbugs.gnu.org; Wed, 10 May 2023 01:36:46 -0400
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 <ruijie@HIDDEN>) id 1pwcVG-0000NI-CX
 for bug-gnu-emacs@HIDDEN; Wed, 10 May 2023 01:36:42 -0400
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 <ruijie@HIDDEN>) id 1pwcVD-0003t0-4o
 for bug-gnu-emacs@HIDDEN; Wed, 10 May 2023 01:36:41 -0400
Received: from fw.net.yu.netyu.xyz (<unknown> [222.248.4.98])
 by netyu.xyz (OpenSMTPD) with ESMTPSA id 5e793040
 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <bug-gnu-emacs@HIDDEN>;
 Wed, 10 May 2023 05:36:33 +0000 (UTC)
User-agent: mu4e 1.11.3; emacs 30.0.50
From: Ruijie Yu <ruijie@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.0.50; [FR] Optionally allow defcustom to check type for standard
 value
Date: Wed, 10 May 2023 13:22:34 +0800
Message-ID: <sdvwn1gagtm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@HIDDEN;
 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-Spam-Score: 0.6 (/)
X-Debbugs-Envelope-To: submit
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.4 (--)

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




Acknowledgement sent to Ruijie Yu <ruijie@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#63410; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 6 Sep 2023 20:30:02 UTC

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