]> code.delx.au - gnu-emacs/blobdiff - src/atimer.c
(table group): Add :version.
[gnu-emacs] / src / atimer.c
index 6b0e077788668c40f57c4e0d562bb5db71f9fb48..7410cad0244c8c02244493b4af61be28cc1b9453 100644 (file)
@@ -1,5 +1,5 @@
 /* Asynchronous timers.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -19,13 +19,13 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
-#include <lisp.h>
 #include <signal.h>
+#include <stdio.h>
+#include <lisp.h>
 #include <syssignal.h>
 #include <systime.h>
 #include <blockinput.h>
 #include <atimer.h>
-#include <stdio.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -375,7 +375,9 @@ alarm_signal_handler (signo)
 
       t = atimers;
       atimers = atimers->next;
+#ifndef MAC_OSX
       t->fn (t);
+#endif
 
       if (t->type == ATIMER_CONTINUOUS)
        {
@@ -387,11 +389,16 @@ alarm_signal_handler (signo)
          t->next = free_atimers;
          free_atimers = t;
        }
+#ifdef MAC_OSX
+      /* Fix for Ctrl-G.  Perhaps this should apply to all platforms. */
+      t->fn (t); 
+#endif
 
       EMACS_GET_TIME (now);
     }
 
-  set_alarm ();
+  if (! pending_atimers)
+    set_alarm ();
 }