all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63410: 30.0.50; [FR] Optionally allow defcustom to check type for standard value
@ 2023-05-10  5:22 Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-05-10 13:36 ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-05-10  5:22 UTC (permalink / raw)
  To: 63410

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-11 14:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-10  5:22 bug#63410: 30.0.50; [FR] Optionally allow defcustom to check type for standard value Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-10 13:36 ` Drew Adams
2023-05-10 14:51   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-10 15:40     ` Eli Zaretskii
2023-05-11  2:25       ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-11 14:08         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.