changeset 27915:e5b8e194d279

(start_busy_cursor): Allow floats for busy-cursor-delay.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 01 Mar 2000 10:25:12 +0000
parents 4ca5a1eef92d
children 3288a7cd4796
files src/xfns.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Tue Feb 29 13:50:23 2000 +0000
+++ b/src/xfns.c	Wed Mar 01 10:25:12 2000 +0000
@@ -10088,17 +10088,25 @@
 start_busy_cursor ()
 {
   EMACS_TIME delay;
-  int secs;
+  int secs, usecs = 0;
   
   cancel_busy_cursor ();
 
   if (INTEGERP (Vbusy_cursor_delay)
       && XINT (Vbusy_cursor_delay) > 0)
     secs = XFASTINT (Vbusy_cursor_delay);
+  else if (FLOATP (Vbusy_cursor_delay)
+	   && XFLOAT_DATA (Vbusy_cursor_delay) > 0)
+    {
+      Lisp_Object tem;
+      tem = Ftruncate (Vbusy_cursor_delay, Qnil);
+      secs = XFASTINT (tem);
+      usecs = (XFLOAT_DATA (Vbusy_cursor_delay) - secs) * 1000000;
+    }
   else
     secs = DEFAULT_BUSY_CURSOR_DELAY;
   
-  EMACS_SET_SECS_USECS (delay, secs, 0);
+  EMACS_SET_SECS_USECS (delay, secs, usecs);
   busy_cursor_atimer = start_atimer (ATIMER_RELATIVE, delay,
 				     show_busy_cursor, NULL);
 }
@@ -10994,7 +11002,7 @@
   
   DEFVAR_LISP ("busy-cursor-delay", &Vbusy_cursor_delay,
      "*Seconds to wait before displaying a busy-cursor.\n\
-Value must be an integer.");
+Value must be an integer or float.");
   Vbusy_cursor_delay = make_number (DEFAULT_BUSY_CURSOR_DELAY);
 
 #if 0 /* This doesn't really do anything.  */