[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#63410: 30.0.50; [FR] Optionally allow defcustom to check type for st
From: |
Ruijie Yu |
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 |
User-agent: |
mu4e 1.11.3; emacs 30.0.50 |
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
- bug#63410: 30.0.50; [FR] Optionally allow defcustom to check type for standard value,
Ruijie Yu <=