Discussion:
[VM] vm-sit-for, display-hourglass, etc
Jay Borkenhagen
2012-12-08 21:32:44 UTC
Permalink
Hi,

Many years ago, I had suggested to Kyle Jones that if vm-get-new-mail
had retrieved nothing, that the "No new mail for ..." message in the
minibuffer should go away after a few seconds, so one would not be
misled by seeing that message still present when returning to vm
possibly several hours later. Kyle agreed, and built that logic using
a call to function "(sit-for 4)".

This sit-for behavior was not working for me in my new vm-8.2.0b
environment, so I started digging. I found that vm-get-new-mail now
uses a special function vm-sit-for, which keys on variable
display-hourglass.

I changed display-hourglass to nil, and I now I do see the "No new
mail ..." message disappear from the minibuffer after 4 seconds. If
that is what I have to do to get the desired behavior I'm OK with
that, but I think this all may not be working the way Uday had
intended so I decided to mention it here.

FWIW, for a number of years now I most often run my vm inside an
"emacs -nw" running under screen in an xterm. Perhaps the "emacs -nw"
is the reason my display-hourglass setting doesn't produce the right
results -- I certainly had not done anything explicit to change it
until discovering the above.

Thanks!

Jay B.
Uday Reddy
2012-12-09 00:12:02 UTC
Permalink
Post by Jay Borkenhagen
I changed display-hourglass to nil, and I now I do see the "No new
mail ..." message disappear from the minibuffer after 4 seconds. If
that is what I have to do to get the desired behavior I'm OK with
that, but I think this all may not be working the way Uday had
intended so I decided to mention it here.
Yes, I remember the issues now. While sit-for is doing its sitting, the
hourglass will keep showing that Emacs is busy. This was confusing to users
because they tend to wait for the hourglass to go off before doing their
next operation.

So, yes, if you want the 4 second disappearance, you need to turn off the
hourglass.

Cheers,
Uday
Jay Borkenhagen
2012-12-09 00:33:57 UTC
Permalink
Post by Uday Reddy
Post by Jay Borkenhagen
I changed display-hourglass to nil, and I now I do see the "No new
mail ..." message disappear from the minibuffer after 4 seconds. If
that is what I have to do to get the desired behavior I'm OK with
that, but I think this all may not be working the way Uday had
intended so I decided to mention it here.
Yes, I remember the issues now. While sit-for is doing its sitting, the
hourglass will keep showing that Emacs is busy. This was confusing to users
because they tend to wait for the hourglass to go off before doing their
next operation.
So, yes, if you want the 4 second disappearance, you need to turn off the
hourglass.
Thanks.

Let me ask: In "emacs -nw", should display-hourglass ever be set to t?
Seems like maybe emacs should do a better job of setting this
variable. Or should vm check whether a window system is being used,
and if not then don't even bother checking display-hourglass?

Thanks again.

Jay B.
Uday Reddy
2012-12-09 06:20:35 UTC
Permalink
Post by Jay Borkenhagen
Let me ask: In "emacs -nw", should display-hourglass ever be set to t?
Seems like maybe emacs should do a better job of setting this
variable. Or should vm check whether a window system is being used,
and if not then don't even bother checking display-hourglass?
It would make sense for Emacs to set it to nil in a text-mode terminal. But
it probably didn't occur to them. I will add a check in `vm-sit-for'.

Cheers,
Uday

Loading...