* bug#19023: 24.4; Long pause when evaluating numeric expression
@ 2014-11-11 20:01 Gareth Rees
2014-11-11 20:36 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Gareth Rees @ 2014-11-11 20:01 UTC (permalink / raw)
To: 19023
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 20:01 bug#19023: 24.4; Long pause when evaluating numeric expression Gareth Rees
@ 2014-11-11 20:36 ` Eli Zaretskii
2014-11-11 20:51 ` Gareth Rees
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-11 20:36 UTC (permalink / raw)
To: Gareth Rees; +Cc: 19023
> From: Gareth Rees <gdr@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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 20:36 ` Eli Zaretskii
@ 2014-11-11 20:51 ` Gareth Rees
2014-11-11 21:04 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Gareth Rees @ 2014-11-11 20:51 UTC (permalink / raw)
To: 19023
> 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).
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 20:51 ` Gareth Rees
@ 2014-11-11 21:04 ` Eli Zaretskii
2014-11-11 21:41 ` Gareth Rees
2014-11-11 22:25 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2014-11-11 21:04 UTC (permalink / raw)
To: Gareth Rees; +Cc: 19023
> From: Gareth Rees <gdr@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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 21:04 ` Eli Zaretskii
@ 2014-11-11 21:41 ` Gareth Rees
2014-11-12 1:52 ` Stefan Monnier
2014-11-11 22:25 ` Lars Magne Ingebrigtsen
1 sibling, 1 reply; 10+ messages in thread
From: Gareth Rees @ 2014-11-11 21:41 UTC (permalink / raw)
To: 19023
> 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)
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 21:04 ` Eli Zaretskii
2014-11-11 21:41 ` Gareth Rees
@ 2014-11-11 22:25 ` Lars Magne Ingebrigtsen
2014-11-12 1:56 ` Stefan Monnier
1 sibling, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-11 22:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 19023, Gareth Rees
Eli Zaretskii <eliz@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
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 21:41 ` Gareth Rees
@ 2014-11-12 1:52 ` Stefan Monnier
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2014-11-12 1:52 UTC (permalink / raw)
To: Gareth Rees; +Cc: 19023
[ 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-11 22:25 ` Lars Magne Ingebrigtsen
@ 2014-11-12 1:56 ` Stefan Monnier
2014-11-12 2:04 ` Lars Magne Ingebrigtsen
2014-11-12 2:06 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 10+ messages in thread
From: Stefan Monnier @ 2014-11-12 1:56 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: 19023, Gareth Rees
> 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-12 1:56 ` Stefan Monnier
@ 2014-11-12 2:04 ` Lars Magne Ingebrigtsen
2014-11-12 2:06 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-12 2:04 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 19023, Gareth Rees
Stefan Monnier <monnier@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
^ permalink raw reply [flat|nested] 10+ messages in thread
* bug#19023: 24.4; Long pause when evaluating numeric expression
2014-11-12 1:56 ` Stefan Monnier
2014-11-12 2:04 ` Lars Magne Ingebrigtsen
@ 2014-11-12 2:06 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 2014-11-12 2:06 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 19023, Gareth Rees
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
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-11-12 2:06 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-11 20:01 bug#19023: 24.4; Long pause when evaluating numeric expression Gareth Rees
2014-11-11 20:36 ` Eli Zaretskii
2014-11-11 20:51 ` Gareth Rees
2014-11-11 21:04 ` Eli Zaretskii
2014-11-11 21:41 ` Gareth Rees
2014-11-12 1:52 ` Stefan Monnier
2014-11-11 22:25 ` Lars Magne Ingebrigtsen
2014-11-12 1:56 ` Stefan Monnier
2014-11-12 2:04 ` Lars Magne Ingebrigtsen
2014-11-12 2:06 ` Lars Magne Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).