GNU bug report logs -
#73098
setopt float warning unexpected
Previous Next
Reported by: Ship Mints <shipmints <at> gmail.com>
Date: Sat, 7 Sep 2024 13:16:01 UTC
Severity: normal
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 73098 <at> debbugs.gnu.org (full text, mbox):
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 7 Sep 2024 09:14:54 -0400
>
> This one bit me yesterday on Emacs 29.3 as I was revising my init file (for the thousandth time this week).
>
> As setopt becomes more widely recommended, people will likely encounter situations like the below where they
> expect constant numeric types to be coerced.
>
> (defcustom temp-float "Float"
> "Float type."
> :type 'float)
>
> (setopt temp-float 2.0) ; works
> (setopt temp-float 2) ; Warning (emacs): Value '2' does not match type float
If you are going to allow integer values, shouldn't :type be 'number,
not 'float? The documentation of 'float says:
‘float’
The value must be floating point.
"Must be floating point." The value 2 isn't.
This bug report was last modified 342 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.