GNU bug report logs - #19023
24.4; Long pause when evaluating numeric expression

Previous Next

Package: emacs;

Reported by: Gareth Rees <gdr <at> garethrees.org>

Date: Tue, 11 Nov 2014 20:19:02 UTC

Severity: minor

Tags: fixed, patch

Merged with 16828, 21131, 23930

Found in versions 24.3.50, 24.4, 25.0.95

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19023 in the body.
You can then email your comments to 19023 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 20:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gareth Rees <gdr <at> garethrees.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 11 Nov 2014 20:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gareth Rees <gdr <at> garethrees.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 20:01:08 +0000
In GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)
of 2014-10-20 on builder10-9.porkrind.org

In a fresh emacs -Q, if I type:

    M-: 1000000 RET

there is a pause of about 10 seconds before Emacs displays:

    1000000 (#o3641100, #xf4240)

I suggest that the length of this pause be reduced.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 20:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gareth Rees <gdr <at> garethrees.org>
Cc: 19023 <at> debbugs.gnu.org
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 22:36:09 +0200
> From: Gareth Rees <gdr <at> garethrees.org>
> Date: Tue, 11 Nov 2014 20:01:08 +0000
> 
> In GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)
> of 2014-10-20 on builder10-9.porkrind.org
> 
> In a fresh emacs -Q, if I type:
> 
>     M-: 1000000 RET
> 
> there is a pause of about 10 seconds before Emacs displays:
> 
>     1000000 (#o3641100, #xf4240)
> 
> I suggest that the length of this pause be reduced.

My crystal ball says that this pause is due to Emacs trying to locate
a font that can display a character whose codepoint is U+F4240.  In
which case, the pause is not n Emacs, it is in system libraries that
search the available fonts.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 20:52:02 GMT) Full text and rfc822 format available.

Message #11 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Gareth Rees <gdr <at> garethrees.org>
To: 19023 <at> debbugs.gnu.org
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 20:51:29 +0000
> My crystal ball says that this pause is due to Emacs trying to locate
> a font that can display a character whose codepoint is U+F4240.  In
> which case, the pause is not n Emacs, it is in system libraries that
> search the available fonts.

That was my guess too, and if I was hoping to see a character at that code point, I would have to be prepared to wait for the system to search all the fonts to find it.

But normally when I evaluate a numeric expression, I do not want to see a character—I’m just using M-: as a calculator—and so the wait is unnecessary (and a regression from 24.3).



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 21:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gareth Rees <gdr <at> garethrees.org>
Cc: 19023 <at> debbugs.gnu.org
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 23:04:54 +0200
> From: Gareth Rees <gdr <at> garethrees.org>
> Date: Tue, 11 Nov 2014 20:51:29 +0000
> 
> But normally when I evaluate a numeric expression, I do not want to see a character—I’m just using M-: as a calculator

But Emacs doesn't (and cannot) know what you want.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 21:43:02 GMT) Full text and rfc822 format available.

Message #17 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Gareth Rees <gdr <at> garethrees.org>
To: 19023 <at> debbugs.gnu.org
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 21:41:57 +0000
> But Emacs doesn't (and cannot) know what you want.

Surely Emacs should know that I don’t want to wait 10 seconds to see the result of evaluating a numeric expression? Or if this is really in doubt, Emacs could provide a user option by which I could tell it how long I’m prepared to wait. Or Emacs could show me the numeric result *while* it is searching the fonts, allowing me to hit C-g to cancel the search if I am happy with just the number.

For reference, the commit that introduced this problem appears to have been 3223d013c2f94e6a0dd37879cf5faec8c0b2261d

For the moment, I am working around the problem by advising eval-expression-print-format, like this:

(defun old-format (orig-fun value)
  (and (integerp value) (eq standard-output t)
       (format " (#o%o, #x%x)" value value)))

(advice-add 'eval-expression-print-format :around #'old-format)



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Tue, 11 Nov 2014 22:26:01 GMT) Full text and rfc822 format available.

Message #20 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19023 <at> debbugs.gnu.org, Gareth Rees <gdr <at> garethrees.org>
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 23:25:35 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> But normally when I evaluate a numeric expression, I do not want to
>> see a character—I’m just using M-: as a calculator
>
> But Emacs doesn't (and cannot) know what you want.

I've always thought it rather strange that Emacs tries to display the
character corresponding to the integer value when you M-: stuff.  How
useful is that, really?

In my experience, I've never wanted to know the octal value or the
corresponding Unicode codepoint of the integer.  I have found the hex
value useful, I think, once.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Wed, 12 Nov 2014 01:53:02 GMT) Full text and rfc822 format available.

Message #23 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Gareth Rees <gdr <at> garethrees.org>
Cc: 19023 <at> debbugs.gnu.org
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 20:52:22 -0500
[ Side comment.  ]

> (defun old-format (orig-fun value)
>   (and (integerp value) (eq standard-output t)
>        (format " (#o%o, #x%x)" value value)))

> (advice-add 'eval-expression-print-format :around #'old-format)

If you don't use `orig-fun', you might as well use :override rather
than :around.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Wed, 12 Nov 2014 01:57:02 GMT) Full text and rfc822 format available.

Message #26 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 19023 <at> debbugs.gnu.org,
 Gareth Rees <gdr <at> garethrees.org>
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Tue, 11 Nov 2014 20:56:26 -0500
> I've always thought it rather strange that Emacs tries to display the
> character corresponding to the integer value when you M-: stuff.  How
> useful is that, really?

If you ask it this way, then it's probably never useful.
But when you use M-: on an expression which returns a character, then
I find it handy to see the character rather than only its integer value.

But maybe this feature is more trouble than it's worth.  After all, you
can always use M-: (string <exp>) RET to force Emacs to show you the
character.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Wed, 12 Nov 2014 02:05:02 GMT) Full text and rfc822 format available.

Message #29 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 19023 <at> debbugs.gnu.org,
 Gareth Rees <gdr <at> garethrees.org>
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Wed, 12 Nov 2014 03:04:26 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> But maybe this feature is more trouble than it's worth.  After all, you
> can always use M-: (string <exp>) RET to force Emacs to show you the
> character.

Yeah.

I tried reproducing the problem reported here, and I got nothing.

But I evaluated a number of digits, and one of them took a couple of
seconds to display.  (This is with X over ssh over wifi.)  So I'm able
to reproduce the problem, and the slower the X connection is, the more
severe it probably is.

Unless somebody else thinks this is really useful functionality, I think
we should probably just ditch it.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19023; Package emacs. (Wed, 12 Nov 2014 02:08:02 GMT) Full text and rfc822 format available.

Message #32 received at 19023 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 19023 <at> debbugs.gnu.org,
 Gareth Rees <gdr <at> garethrees.org>
Subject: Re: bug#19023: 24.4; Long pause when evaluating numeric expression
Date: Wed, 12 Nov 2014 03:06:58 +0100
On the other hand, M-: (following-char) currently returns

110 (#o156, #x6e, ?n)

which is useful, come to think of it.  Er.  So I don't know...

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





Merged 16828 19023. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Fri, 01 Jul 2016 03:46:02 GMT) Full text and rfc822 format available.

Forcibly Merged 16828 19023 21131 23930. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 10 Jul 2016 00:00:03 GMT) Full text and rfc822 format available.

Added tag(s) patch. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 26 Mar 2017 03:45:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 19 May 2017 22:28:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.1, send any further explanations to 16828 <at> debbugs.gnu.org and Anders Lindgren <andlind <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 19 May 2017 22:28:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Jun 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.