bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56400: Make setopt warn on type mismatch


From: Lars Ingebrigtsen
Subject: bug#56400: Make setopt warn on type mismatch
Date: Tue, 05 Jul 2022 19:32:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Kangas <stefan@marxist.se> writes:

> 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"))

Yup.

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

Hm...  yes, that should certainly be possible.  I guess the check would
go in...  `custom-declare-variable'?  Yeah, almost.

Now fixed in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]