all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#6457: 24.0.50; Inappropriate error msg for set-variable
@ 2010-06-18 16:06 Drew Adams
  2010-06-19 14:43 ` Juri Linkov
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2010-06-18 16:06 UTC (permalink / raw)
  To: 6457

emacs -Q
M-x set-variable RET scroll-conservatively 
Set scroll-conservatively globally to value (0): 99999999 RET
 
No problem. Now do it again, adding one more `9':
M-x set-variable RET scroll-conservatively
Set scroll-conservatively globally to value (99999999): 999999999 RET
 
The error message is this:
 
Value `999999999.0' does not match type integer of
scroll-conservatively.
 
1. There should be no `.0' added to the echoed input. The actual input
should be echoed.  Emacs shouldn't seem to be complaining about
something the user didn't enter.
 
2. The cause of the error is an arithmetic overflow.  The message should
indicate this, if possible.  If not, it's OK to say that an integer
wasn't entered (since 999999999 is too big to correspond to an integer),
but such a message is not ideal and will be confusing to some users.
 
But the main problem is #1.  Confusion from a message saying that you
didn't input an integer is even greate if what is echoed is a decimal
number (999999999.0).
 
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-06-14 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/xpm/include'
 






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2010-06-18 16:06 bug#6457: 24.0.50; Inappropriate error msg for set-variable Drew Adams
@ 2010-06-19 14:43 ` Juri Linkov
  2010-06-20 14:47   ` Drew Adams
  0 siblings, 1 reply; 13+ messages in thread
From: Juri Linkov @ 2010-06-19 14:43 UTC (permalink / raw)
  To: Drew Adams; +Cc: 6457

> emacs -Q
> M-x set-variable RET scroll-conservatively
> Set scroll-conservatively globally to value (0): 99999999 RET
>
> No problem. Now do it again, adding one more `9':
> M-x set-variable RET scroll-conservatively
> Set scroll-conservatively globally to value (99999999): 999999999 RET

What is a number in parens?  I don't have these parens.
Do you use a modified source?

> The error message is this:
>
> Value `999999999.0' does not match type integer of
> scroll-conservatively.

I can't reproduce this bug when I set to 999999999.

When I tried a larger value "9999999999999999999",
I get the following error:

  Arithmetic overflow error: "9999999999999999999"

-- 
Juri Linkov
http://www.jurta.org/emacs/





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2010-06-19 14:43 ` Juri Linkov
@ 2010-06-20 14:47   ` Drew Adams
  2014-02-06  0:28     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Drew Adams @ 2010-06-20 14:47 UTC (permalink / raw)
  To: 'Juri Linkov'; +Cc: 6457

> > emacs -Q
> > M-x set-variable RET scroll-conservatively
> > Set scroll-conservatively globally to value (0): 99999999 RET
> >
> > No problem. Now do it again, adding one more `9':
> > M-x set-variable RET scroll-conservatively
> > Set scroll-conservatively globally to value (99999999): 
> 999999999 RET
> 
> What is a number in parens?  I don't have these parens.
> Do you use a modified source?

Forget the number in parens.
No, it does not appear with emacs -Q.

> > The error message is this:
> >
> > Value `999999999.0' does not match type integer of
> > scroll-conservatively.

That is still the (inappropriate) error message.

> I can't reproduce this bug when I set to 999999999.

Perhaps it is platform-specific.

> When I tried a larger value "9999999999999999999",
> I get the following error:
> 
>   Arithmetic overflow error: "9999999999999999999"

Perhaps the inappropriate error message is platform-specific.

I definitely see that message with emacs -Q.






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2010-06-20 14:47   ` Drew Adams
@ 2014-02-06  0:28     ` Lars Ingebrigtsen
  2014-02-06  1:41       ` Glenn Morris
  2014-02-06  6:10       ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-06  0:28 UTC (permalink / raw)
  To: Drew Adams; +Cc: 6457

"Drew Adams" <drew.adams@oracle.com> writes:

>> > The error message is this:
>> >
>> > Value `999999999.0' does not match type integer of
>> > scroll-conservatively.
>
> That is still the (inappropriate) error message.
>
>> I can't reproduce this bug when I set to 999999999.
>
> Perhaps it is platform-specific.
>
>> When I tried a larger value "9999999999999999999",
>> I get the following error:
>> 
>>   Arithmetic overflow error: "9999999999999999999"
>
> Perhaps the inappropriate error message is platform-specific.
>
> I definitely see that message with emacs -Q.

I get:

set-variable: Value `1e+19' does not match type integer of scroll-conservatively

So I can reproduce this bug.

(This is with Emacs 23.3.50 on Fedora.)

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  0:28     ` Lars Ingebrigtsen
@ 2014-02-06  1:41       ` Glenn Morris
  2014-02-06  6:19         ` Eli Zaretskii
  2014-02-06  6:10       ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Glenn Morris @ 2014-02-06  1:41 UTC (permalink / raw)
  To: 6457

Lars Ingebrigtsen wrote:

> set-variable: Value `1e+19' does not match type integer of scroll-conservatively
>

I guess this is due to the feature whereby values too large for integers
are read as floats, eg

http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00181.html

If so, I guess it is impossible for lisp code to know whether the user
originally typed an integer or a float. Therefore it is impossible to do
anything about this. It frankly doesn't seem worth bothering about
anyway.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  0:28     ` Lars Ingebrigtsen
  2014-02-06  1:41       ` Glenn Morris
@ 2014-02-06  6:10       ` Eli Zaretskii
  2014-02-06  6:28         ` Lars Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2014-02-06  6:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 6457

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 05 Feb 2014 16:28:23 -0800
> Cc: 6457@debbugs.gnu.org
> 
> "Drew Adams" <drew.adams@oracle.com> writes:
> 
> >> > The error message is this:
> >> >
> >> > Value `999999999.0' does not match type integer of
> >> > scroll-conservatively.
> >
> > That is still the (inappropriate) error message.
> >
> >> I can't reproduce this bug when I set to 999999999.
> >
> > Perhaps it is platform-specific.
> >
> >> When I tried a larger value "9999999999999999999",
> >> I get the following error:
> >> 
> >>   Arithmetic overflow error: "9999999999999999999"
> >
> > Perhaps the inappropriate error message is platform-specific.
> >
> > I definitely see that message with emacs -Q.
> 
> I get:
> 
> set-variable: Value `1e+19' does not match type integer of scroll-conservatively
> 
> So I can reproduce this bug.

Yes, you can, just in a slightly different way: the user didn't enter
1e+19, either.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  1:41       ` Glenn Morris
@ 2014-02-06  6:19         ` Eli Zaretskii
  2014-02-06  6:37           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2014-02-06  6:19 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 6457

> From: Glenn Morris <rgm@gnu.org>
> Date: Wed, 05 Feb 2014 20:41:29 -0500
> 
> Lars Ingebrigtsen wrote:
> 
> > set-variable: Value `1e+19' does not match type integer of scroll-conservatively
> >
> 
> I guess this is due to the feature whereby values too large for integers
> are read as floats, eg
> 
> http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00181.html
> 
> If so, I guess it is impossible for lisp code to know whether the user
> originally typed an integer or a float. Therefore it is impossible to do
> anything about this. It frankly doesn't seem worth bothering about
> anyway.

Then "wontfix" it.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:10       ` Eli Zaretskii
@ 2014-02-06  6:28         ` Lars Ingebrigtsen
  2014-02-06  8:17           ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-06  6:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 6457

Eli Zaretskii <eliz@gnu.org> writes:

>> set-variable: Value `1e+19' does not match type integer of
>> scroll-conservatively
>> 
>> So I can reproduce this bug.
>
> Yes, you can, just in a slightly different way: the user didn't enter
> 1e+19, either.

Yeah, I said "can", not "can't".  >"?

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:19         ` Eli Zaretskii
@ 2014-02-06  6:37           ` Lars Ingebrigtsen
  2014-02-06  6:55             ` Drew Adams
  2014-02-06  8:06             ` Glenn Morris
  0 siblings, 2 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2014-02-06  6:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 6457

Eli Zaretskii <eliz@gnu.org> writes:

>> If so, I guess it is impossible for lisp code to know whether the user
>> originally typed an integer or a float. Therefore it is impossible to do
>> anything about this. It frankly doesn't seem worth bothering about
>> anyway.
>
> Then "wontfix" it.

I agree that it's a minor thing, but it's an "er what?" moment for the
user.  So if anybody has an idea for how to fix this in a manner that
works across everything that asks for an integer, that would be nice...

Or is this problem only present for `set-variable'?  Then it might not
be worth fixing.

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:37           ` Lars Ingebrigtsen
@ 2014-02-06  6:55             ` Drew Adams
  2019-08-23  5:28               ` Lars Ingebrigtsen
  2014-02-06  8:06             ` Glenn Morris
  1 sibling, 1 reply; 13+ messages in thread
From: Drew Adams @ 2014-02-06  6:55 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Eli Zaretskii; +Cc: 6457

> Or is this problem only present for `set-variable'?  Then it might
> not be worth fixing.

No, it is a general problem.

It's a problem here because `read-from-minibuffer' reads an
integer numeral as input, and the value read is effectively a
floating-point number.

You can see the same thing happen for (format "%S" 999999999).
That returns the number 999999999.0.

IOW, it is the Lisp reader that reads an integer numeral and
returns a non-integer number: (not (integerp 999999999)).





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:37           ` Lars Ingebrigtsen
  2014-02-06  6:55             ` Drew Adams
@ 2014-02-06  8:06             ` Glenn Morris
  1 sibling, 0 replies; 13+ messages in thread
From: Glenn Morris @ 2014-02-06  8:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 6457

Lars Ingebrigtsen wrote:

> I agree that it's a minor thing, but it's an "er what?" moment for the
> user.

Realistically, how often do you expect people to try to customize
integer variables to values larger than most-positive-fixnum?
"I wonder what will happen if I set this to an absurdly large value"
does not count.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:28         ` Lars Ingebrigtsen
@ 2014-02-06  8:17           ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2014-02-06  8:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 6457

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: drew.adams@oracle.com,  6457@debbugs.gnu.org
> Date: Wed, 05 Feb 2014 22:28:02 -0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> set-variable: Value `1e+19' does not match type integer of
> >> scroll-conservatively
> >> 
> >> So I can reproduce this bug.
> >
> > Yes, you can, just in a slightly different way: the user didn't enter
> > 1e+19, either.
> 
> Yeah, I said "can", not "can't".  >"?

Sorry, I didn't have enough caffeine in my blood when I wrote that.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#6457: 24.0.50; Inappropriate error msg for set-variable
  2014-02-06  6:55             ` Drew Adams
@ 2019-08-23  5:28               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-23  5:28 UTC (permalink / raw)
  To: Drew Adams; +Cc: 6457

Drew Adams <drew.adams@oracle.com> writes:

>> Or is this problem only present for `set-variable'?  Then it might
>> not be worth fixing.
>
> No, it is a general problem.
>
> It's a problem here because `read-from-minibuffer' reads an
> integer numeral as input, and the value read is effectively a
> floating-point number.
>
> You can see the same thing happen for (format "%S" 999999999).
> That returns the number 999999999.0.
>
> IOW, it is the Lisp reader that reads an integer numeral and
> returns a non-integer number: (not (integerp 999999999)).

I think this has been fixed once and for all in Emacs 27 with the new
bignum support, so I'm closing this bug report.

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2019-08-23  5:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-18 16:06 bug#6457: 24.0.50; Inappropriate error msg for set-variable Drew Adams
2010-06-19 14:43 ` Juri Linkov
2010-06-20 14:47   ` Drew Adams
2014-02-06  0:28     ` Lars Ingebrigtsen
2014-02-06  1:41       ` Glenn Morris
2014-02-06  6:19         ` Eli Zaretskii
2014-02-06  6:37           ` Lars Ingebrigtsen
2014-02-06  6:55             ` Drew Adams
2019-08-23  5:28               ` Lars Ingebrigtsen
2014-02-06  8:06             ` Glenn Morris
2014-02-06  6:10       ` Eli Zaretskii
2014-02-06  6:28         ` Lars Ingebrigtsen
2014-02-06  8:17           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.