From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#73098: setopt float warning unexpected Date: Sun, 8 Sep 2024 06:59:31 -0400 Message-ID: References: <86r09uwuf3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000098fd1f06219989e3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23945"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73098@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 08 13:01:15 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1snFfP-000649-B3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Sep 2024 13:01:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1snFfB-0003Tg-Jo; Sun, 08 Sep 2024 07:01:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1snFfA-0003TY-5n for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 07:01:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1snFf9-0003gV-TH for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 07:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=gEV/FoW33P+yxsBIGxyIRJmXODOB8hnPq0yTpBfCOiM=; b=LRuF1ppLqIbO5ZTt3oCtjl6sH3ARr+phXKUVNJrpIy/FofOStv5PfXvUB/WSYDX/kvNtNftjYc7bJ1Ie+KHlNm8FDbYgDhLgQ1odDhFyHf/VIbYcQzzuhYySxWfpAHge/c+4Ht9S43PLZR4oqyMojWmAVaRsfYbK49ItFlVKCZBbKXqIX2Wp/D7UJeC3MOVbWgMTApwiab8cLaWvClzoCpyP1EQbcB8WwWnMvkTr1Gs+Q78W6LcyKM/uoAK5VVP9FlLhAPplU+EvPq35rP/8Wxzdw1L8sJwAQc6oUOpvxVv10AfP/y1KMVjunRBtOw3mzLWIYHkt75W2qpabBUtKrQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1snFfB-0005Na-Te for bug-gnu-emacs@gnu.org; Sun, 08 Sep 2024 07:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 11:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73098 X-GNU-PR-Package: emacs Original-Received: via spool by 73098-submit@debbugs.gnu.org id=B73098.172579325220653 (code B ref 73098); Sun, 08 Sep 2024 11:01:01 +0000 Original-Received: (at 73098) by debbugs.gnu.org; 8 Sep 2024 11:00:52 +0000 Original-Received: from localhost ([127.0.0.1]:58027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snFf1-0005N3-MD for submit@debbugs.gnu.org; Sun, 08 Sep 2024 07:00:52 -0400 Original-Received: from mail-vs1-f48.google.com ([209.85.217.48]:56743) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snFf0-0005Mr-DV for 73098@debbugs.gnu.org; Sun, 08 Sep 2024 07:00:51 -0400 Original-Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-49bf3b4d07bso201453137.1 for <73098@debbugs.gnu.org>; Sun, 08 Sep 2024 04:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725793182; x=1726397982; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=gEV/FoW33P+yxsBIGxyIRJmXODOB8hnPq0yTpBfCOiM=; b=NNLVwLl2MMEpxqin8oA1Nfq+/jRg0wWCP/dwtW3gG1FGIbLVrDKF9JVbxNN44IF2nb fRMiF2pc8uQMyVrH611vb4LPZnSjppkGnmdWKfOhSQSJe8Vv1y2a382t1nz2mWJy65Zk X09rSzKHw6r3oYa//F7VaUf2e6phqj+MgO4/h3qI61JUVSyNucRVA1a0D9Y3gNmdIbhf agUsgWu9DAYny/vzJH6Up+u7nKh3EbOA8JEOI3zwP6fw5yGUmFKfnR4JW3wbi4QZ3Suz r4dbsCB332xwFw2SlPy/S36kAl0sl+Da9APnROqgWxNRaidvvOxyI17iOMZKusRJZ3TR GRBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725793182; x=1726397982; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gEV/FoW33P+yxsBIGxyIRJmXODOB8hnPq0yTpBfCOiM=; b=YYWEooQDojDnZGbbYbeNDq1fUe/wiUxREWZK4D7A5rXHDSWA5dsPHwfDPvhjdol+/n wZXuh0VHr/wViBcOPlf4WS47crM1OioFthediysfqcwppW9hzYSfMbO9A+zBrjgMkHdy teMAxaGn6QZxVnnlACS3yiZTtuAslUMKOW5Afv+5hWuOuz8ev8YghHrqMzcdld3L2wkv fOJwsyHem+UpMqsonE5ibeOgaaj/KXKXFAaL2+ehlviljEY1dGDTCwCYC57vg/qNa6y7 juX3Y5NKZp9/KpMA7iSNk+urkfkbRW1BcarhB2Aqsp8D6Fhe7uVl5n/59hkyat/7bUT1 r00w== X-Gm-Message-State: AOJu0YzLfdudraQoa+e2+ui8HjKe4IAiD7i/lSjdxNCjDSsULF/9w30t +ZqTfgstiWYnvgVFYIW+swy/mn09XMdddCo7hsyfqZtT6wF+4/f5Icj9SVnT6l1/T6GULcbAmmO hdyqruoMGVbTqJuJG/FvG8S4EGQI= X-Google-Smtp-Source: AGHT+IEx0YKBezeeuCwKX0HyuebixCxZw84e8zQA2MRuWwi/v6TTtO0jJIot/kuLS7G4f5fRfdJ4XgWCcPJHA8p9R7c= X-Received: by 2002:a05:6102:441d:b0:493:b8d8:93d5 with SMTP id ada2fe7eead31-49bde263442mr8842200137.20.1725793182479; Sun, 08 Sep 2024 03:59:42 -0700 (PDT) In-Reply-To: <86r09uwuf3.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291436 Archived-At: --00000000000098fd1f06219989e3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yessir. I was talking about users' likely expectations for type coercion. There are cases in elisp where numeric type coercion is the default, e.g., (=3D 2.0 2) is t. I expected it to be so here, too. If you feel this is moot, then so be it. On Sun, Sep 8, 2024 at 2:07=E2=80=AFAM Eli Zaretskii wrote: > > From: Ship Mints > > 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: > > =E2=80=98float=E2=80=99 > The value must be floating point. > > "Must be floating point." The value 2 isn't. > --00000000000098fd1f06219989e3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yessir. I was talking about users' likely expectations for type=C2= =A0coercion. There are cases in elisp where numeric type coercion is the de= fault, e.g.,=C2=A0(=3D 2.0 2) is t. I expected it to be so here, too.
=

If you feel this i= s moot, then so be it.

On Sun, Sep 8, 2024 at 2:07=E2=80=AFAM Eli Za= retskii <eliz@gnu.org> wrote:
=
> From: Ship Min= ts <shipmints@g= mail.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 encounte= r situations like the below where they
> expect constant numeric types to be coerced.
>
> (defcustom temp-float "Float"
>=C2=A0 =C2=A0"Float type."
>=C2=A0 =C2=A0:type 'float)
>
> (setopt temp-float 2.0) ; works
> (setopt temp-float 2) ; Warning (emacs): Value '2' does not ma= tch type float

If you are going to allow integer values, shouldn't :type be 'numbe= r,
not 'float?=C2=A0 The documentation of 'float says:

=C2=A0 =E2=80=98float=E2=80=99
=C2=A0 =C2=A0 =C2=A0 =C2=A0The value must be floating point.

"Must be floating point."=C2=A0 The value 2 isn't.
--00000000000098fd1f06219989e3--