Subject: Re: bug#73098: setopt float warning unexpected

From: Ship Mints <[email-masked]>
Date: Fri, 13 Sep 2024 13:14:59 -0400

Revised language:

"Set VARIABLE/VALUE pairs with type warnings, and return the final VALUE.

This is like setq, but is meant for user options instead of
plain variables.  This means that setopt will execute any
custom-set form associated with VARIABLE, and will emit a
warning if VALUE is not of the type expected by the user option.

Example: If the user option is declared to accept a `float',
set the option to 2.0 rather than 2, which is considered an `integer'.

Despite the warning, the user option will still be set to VALUE."

On Fri, Sep 13, 2024 at 11:28 AM Eli Zaretskii <[email-masked]> wrote:

> > From: Ship Mints <[email-masked]>
> > Date: Fri, 13 Sep 2024 11:11:18 -0400
> > Cc: Stefan Monnier <[email-masked]>, Eli Zaretskii <
> [email-masked]>,
> >       Michael Heerdegen <[email-masked]>,
> [email-masked]
> >
> > Perhaps, some expanded advice in the docstring for setopt?
> >
> > "Set VARIABLE/VALUE pairs with enforced types, and return the final
> VALUE.
>
> "Enforce" is inaccurate, since a value that doesn't match :type just
> emits a warning (which can be shut up by the users, if they want), it
> doesn't signal an error.  And the variable is assigned the value event
> if the type doesn't match.
>