all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting a hourglass cursor
@ 2009-09-15  3:22 Eli Zaretskii
  2009-09-15 12:15 ` Jason Rumney
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2009-09-15  3:22 UTC (permalink / raw)
  To: emacs-devel

What is the paradigm for getting a hourglass cursor for a prolonged
operation?  I thought Emacs does that automagically, but I don't see
how that could happen, looking at the code.  It sounds like a command
that expects to be long should do that by hand, is that right?  Or am
I missing something?

The case in point is "C-h H", which (at least on Windows) takes an
annoyingly long time.




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

* Re: Getting a hourglass cursor
  2009-09-15  3:22 Getting a hourglass cursor Eli Zaretskii
@ 2009-09-15 12:15 ` Jason Rumney
  2009-09-15 12:19   ` Lennart Borgman
  2009-09-15 17:36   ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Jason Rumney @ 2009-09-15 12:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:
> The case in point is "C-h H", which (at least on Windows) takes an
> annoyingly long time.
>   

On Windows, we don't support asynchronous timers, so the hourglass will 
only display if we spend a long time executing lisp code. C-h H is 
spending time doing redisplay (specifically finding fonts to display the 
various scripts), so the hourglass does not display.





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

* Re: Getting a hourglass cursor
  2009-09-15 12:15 ` Jason Rumney
@ 2009-09-15 12:19   ` Lennart Borgman
  2009-09-15 12:32     ` Jason Rumney
  2009-09-15 17:36   ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2009-09-15 12:19 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, emacs-devel

On Tue, Sep 15, 2009 at 2:15 PM, Jason Rumney <jasonr@gnu.org> wrote:
> Eli Zaretskii wrote:
>>
>> The case in point is "C-h H", which (at least on Windows) takes an
>> annoyingly long time.
>>
>
> On Windows, we don't support asynchronous timers, so the hourglass will only
> display if we spend a long time executing lisp code. C-h H is spending time
> doing redisplay (specifically finding fonts to display the various scripts),
> so the hourglass does not display.


Are there any difficulties with supporting async timers on w32?




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

* Re: Getting a hourglass cursor
  2009-09-15 12:19   ` Lennart Borgman
@ 2009-09-15 12:32     ` Jason Rumney
  2009-09-15 16:43       ` Lennart Borgman
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Rumney @ 2009-09-15 12:32 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Eli Zaretskii, emacs-devel

Lennart Borgman wrote:
> On Tue, Sep 15, 2009 at 2:15 PM, Jason Rumney <jasonr@gnu.org> wrote:
>   
>> Eli Zaretskii wrote:
>>     
>>> The case in point is "C-h H", which (at least on Windows) takes an
>>> annoyingly long time.
>>>
>>>       
>> On Windows, we don't support asynchronous timers, so the hourglass will only
>> display if we spend a long time executing lisp code. C-h H is spending time
>> doing redisplay (specifically finding fonts to display the various scripts),
>> so the hourglass does not display.
>>     
>
>
> Are there any difficulties with supporting async timers on w32?
>   

Yes, since Windows does not support signal handlers, anything 
asynchronous needs to be done in another thread, which cannot run Lisp 
code (at least until someone implements multithreading of Lisp, without 
restrictions like one thread per buffer or some of the other 
simplifications that have been talked about).






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

* Re: Getting a hourglass cursor
  2009-09-15 12:32     ` Jason Rumney
@ 2009-09-15 16:43       ` Lennart Borgman
  2009-09-16  0:46         ` Jason Rumney
  0 siblings, 1 reply; 13+ messages in thread
From: Lennart Borgman @ 2009-09-15 16:43 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, emacs-devel

On Tue, Sep 15, 2009 at 2:32 PM, Jason Rumney <jasonr@gnu.org> wrote:

>>> On Windows, we don't support asynchronous timers, so the hourglass will
>>> only
>>> display if we spend a long time executing lisp code. C-h H is spending
>>> time
>>> doing redisplay (specifically finding fonts to display the various
>>> scripts),
>>> so the hourglass does not display.
>>>
>>
>>
>> Are there any difficulties with supporting async timers on w32?
>>
>
> Yes, since Windows does not support signal handlers, anything asynchronous
> needs to be done in another thread, which cannot run Lisp code (at least
> until someone implements multithreading of Lisp, without restrictions like
> one thread per buffer or some of the other simplifications that have been
> talked about).


But can't that be handled by sending a w32 message to the thread that
handles Lisp (just like we do for w32 GUI events)?




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

* Re: Getting a hourglass cursor
  2009-09-15 12:15 ` Jason Rumney
  2009-09-15 12:19   ` Lennart Borgman
@ 2009-09-15 17:36   ` Eli Zaretskii
  2009-09-15 19:19     ` Jan Djärv
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2009-09-15 17:36 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

> Date: Tue, 15 Sep 2009 20:15:29 +0800
> From: Jason Rumney <jasonr@gnu.org>
> CC: emacs-devel@gnu.org
> 
> Eli Zaretskii wrote:
> > The case in point is "C-h H", which (at least on Windows) takes an
> > annoyingly long time.
> >   
> 
> On Windows, we don't support asynchronous timers, so the hourglass will 
> only display if we spend a long time executing lisp code. C-h H is 
> spending time doing redisplay (specifically finding fonts to display the 
> various scripts), so the hourglass does not display.

Sorry, I'm not sure I understand: are you saying that "C-h H" _will_
display the hourglass cursor on X?  If so, where's the code that
starts the atimer which, when expires, will display the hourglass?
Can you (or someone else) please verify that the hourglass is indeed
displayed on X?

AFAICS, the code which sets this atimer is in start_hourglass.  But if
that is true, all the calls to start_hourglass are made on Windows as
well, and the hourglass should display on Windows as it does on other
platforms.  What am I missing?




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

* Re: Getting a hourglass cursor
  2009-09-15 17:36   ` Eli Zaretskii
@ 2009-09-15 19:19     ` Jan Djärv
  2009-09-15 20:20       ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Jan Djärv @ 2009-09-15 19:19 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel, Jason Rumney



Eli Zaretskii skrev:
>> Date: Tue, 15 Sep 2009 20:15:29 +0800
>> From: Jason Rumney <jasonr@gnu.org>
>> CC: emacs-devel@gnu.org
>>
>> Eli Zaretskii wrote:
>>> The case in point is "C-h H", which (at least on Windows) takes an
>>> annoyingly long time.
>>>   
>> On Windows, we don't support asynchronous timers, so the hourglass will 
>> only display if we spend a long time executing lisp code. C-h H is 
>> spending time doing redisplay (specifically finding fonts to display the 
>> various scripts), so the hourglass does not display.
> 
> Sorry, I'm not sure I understand: are you saying that "C-h H" _will_
> display the hourglass cursor on X?  If so, where's the code that
> starts the atimer which, when expires, will display the hourglass?
> Can you (or someone else) please verify that the hourglass is indeed
> displayed on X?

Well, not for C-h H here, it is too fast.  But (sleep-for 10) does indeed
start an hourglass.  The code that starts it is in xdisp.c.

For W32, it is in w32fns.c.


> 
> AFAICS, the code which sets this atimer is in start_hourglass.  But if
> that is true, all the calls to start_hourglass are made on Windows as
> well, and the hourglass should display on Windows as it does on other
> platforms.  What am I missing?
> 

Don't know.

	Jan D.




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

* Re: Getting a hourglass cursor
  2009-09-15 19:19     ` Jan Djärv
@ 2009-09-15 20:20       ` Eli Zaretskii
  2009-09-15 22:49         ` Jason Rumney
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2009-09-15 20:20 UTC (permalink / raw)
  To: Jan Djärv; +Cc: emacs-devel, jasonr

> Date: Tue, 15 Sep 2009 21:19:34 +0200
> From: Jan_Djärv <jan.h.d@swipnet.se>
> CC: Jason Rumney <jasonr@gnu.org>, emacs-devel@gnu.org
> 
> > Sorry, I'm not sure I understand: are you saying that "C-h H" _will_
> > display the hourglass cursor on X?  If so, where's the code that
> > starts the atimer which, when expires, will display the hourglass?
> > Can you (or someone else) please verify that the hourglass is indeed
> > displayed on X?
> 
> Well, not for C-h H here, it is too fast.  But (sleep-for 10) does indeed
> start an hourglass.

On Windows, it doesn't.

Thanks for testing.





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

* Re: Getting a hourglass cursor
  2009-09-15 20:20       ` Eli Zaretskii
@ 2009-09-15 22:49         ` Jason Rumney
  2009-09-15 23:38           ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Rumney @ 2009-09-15 22:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Jan Djärv, emacs-devel

Eli Zaretskii wrote:
>> Date: Tue, 15 Sep 2009 21:19:34 +0200
>> From: Jan_Djärv <jan.h.d@swipnet.se>
>> CC: Jason Rumney <jasonr@gnu.org>, emacs-devel@gnu.org
>>
>>     
>>> Sorry, I'm not sure I understand: are you saying that "C-h H" _will_
>>> display the hourglass cursor on X?  If so, where's the code that
>>> starts the atimer which, when expires, will display the hourglass?
>>> Can you (or someone else) please verify that the hourglass is indeed
>>> displayed on X?
>>>       
>> Well, not for C-h H here, it is too fast.  But (sleep-for 10) does indeed
>> start an hourglass.
>>     
>
> On Windows, it doesn't.
>   
What about (progn (sleep-for 5) (sleep-for 5)) ?






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

* Re: Getting a hourglass cursor
  2009-09-15 22:49         ` Jason Rumney
@ 2009-09-15 23:38           ` Juanma Barranquero
  2009-09-16  3:13             ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2009-09-15 23:38 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, Jan Djärv, emacs-devel

On Wed, Sep 16, 2009 at 00:49, Jason Rumney <jasonr@gnu.org> wrote:

>> On Windows, it doesn't.
>>
>
> What about (progn (sleep-for 5) (sleep-for 5)) ?

  M-: (sleep-for X) <RET>

does not start an hourglass for me, but

  (sleep-for X) ^J

or

  IELM> (sleep-for X) <RET>

do, for values as short as 1.5 seconds.

    Juanma




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

* Re: Getting a hourglass cursor
  2009-09-15 16:43       ` Lennart Borgman
@ 2009-09-16  0:46         ` Jason Rumney
  2009-09-16  1:23           ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Rumney @ 2009-09-16  0:46 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Eli Zaretskii, emacs-devel

Lennart Borgman wrote:
> But can't that be handled by sending a w32 message to the thread that
> handles Lisp (just like we do for w32 GUI events)?
>   
That is not asynchronous, as the message is only processed when the 
currently running code finishes or certain functions like sit-for are run.






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

* Re: Getting a hourglass cursor
  2009-09-16  0:46         ` Jason Rumney
@ 2009-09-16  1:23           ` Stefan Monnier
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2009-09-16  1:23 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, Lennart Borgman, emacs-devel

>> But can't that be handled by sending a w32 message to the thread that
>> handles Lisp (just like we do for w32 GUI events)?
> That is not asynchronous, as the message is only processed when the
> currently running code finishes or certain functions like sit-for are run.

Couldn't it do it from the code run in the QUIT macro?


        Stefan





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

* Re: Getting a hourglass cursor
  2009-09-15 23:38           ` Juanma Barranquero
@ 2009-09-16  3:13             ` Eli Zaretskii
  0 siblings, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2009-09-16  3:13 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: jan.h.d, emacs-devel, jasonr

> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Wed, 16 Sep 2009 01:38:09 +0200
> Cc: Eli Zaretskii <eliz@gnu.org>, =?UTF-8?Q?Jan_Dj=C3=A4rv?= <jan.h.d@swipnet.se>, 
> 	emacs-devel@gnu.org
> 
> On Wed, Sep 16, 2009 at 00:49, Jason Rumney <jasonr@gnu.org> wrote:
> 
> >> On Windows, it doesn't.
> >>
> >
> > What about (progn (sleep-for 5) (sleep-for 5)) ?
> 
>   M-: (sleep-for X) <RET>
> 
> does not start an hourglass for me, but
> 
>   (sleep-for X) ^J
> 
> or
> 
>   IELM> (sleep-for X) <RET>
> 
> do, for values as short as 1.5 seconds.

Right, and the same here.  Previously, I only tried M-: with
(sleep-for 10).




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

end of thread, other threads:[~2009-09-16  3:13 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15  3:22 Getting a hourglass cursor Eli Zaretskii
2009-09-15 12:15 ` Jason Rumney
2009-09-15 12:19   ` Lennart Borgman
2009-09-15 12:32     ` Jason Rumney
2009-09-15 16:43       ` Lennart Borgman
2009-09-16  0:46         ` Jason Rumney
2009-09-16  1:23           ` Stefan Monnier
2009-09-15 17:36   ` Eli Zaretskii
2009-09-15 19:19     ` Jan Djärv
2009-09-15 20:20       ` Eli Zaretskii
2009-09-15 22:49         ` Jason Rumney
2009-09-15 23:38           ` Juanma Barranquero
2009-09-16  3:13             ` 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.