GNU bug report logs -
#56400
Make setopt warn on type mismatch
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Tue, 5 Jul 2022 15:33:02 UTC
Severity: wishlist
Tags: moreinfo
Fixed in version 29.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #13 received at 56400 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Stefan Kangas <stefan <at> marxist.se> writes:
>
> > Why not make `setopt' warn in case there is a type mismatch?
> > For example, in:
> >
> > (setopt tetris-buffer-width "hello")
> >
> > But the type of `tetris-buffer-width' is natnum.
>
> It should throw an error already:
Aha, I guess it doesn't throw an error if `tetris' isn't loaded
already, as it has no way of knowing the type yet. IOW, in emacs -Q,
I need to say this to get an error:
(progn
(require 'tetris)
(setopt tetris-buffer-width "hello"))
That's pretty good, but I wonder if we could do better. I expect that
users will often set settings from libraries that aren't yet loaded.
For example, how about warning upon loading the library if the
variable is set to an incompatible value? Or something.
This bug report was last modified 2 years and 359 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.