emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/keyboard.c [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/keyboard.c [emacs-unicode-2]
Date: Thu, 14 Oct 2004 05:13:37 -0400

Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.753.2.11 emacs/src/keyboard.c:1.753.2.12
*** emacs/src/keyboard.c:1.753.2.11     Fri Aug 27 07:00:31 2004
--- emacs/src/keyboard.c        Thu Oct 14 08:49:55 2004
***************
*** 676,681 ****
--- 676,684 ----
  static void clear_event P_ ((struct input_event *));
  static void any_kboard_state P_ ((void));
  static SIGTYPE interrupt_signal P_ ((int signalnum));
+ static void timer_start_idle P_ ((void));
+ static void timer_stop_idle P_ ((void));
+ static void timer_resume_idle P_ ((void));
  
  /* Nonzero means don't try to suspend even if the operating system seems
     to support it.  */
***************
*** 2387,2393 ****
    volatile Lisp_Object also_record;
    volatile int reread;
    struct gcpro gcpro1, gcpro2;
-   EMACS_TIME last_idle_start;
    int polling_stopped_here = 0;
  
    also_record = Qnil;
--- 2390,2395 ----
***************
*** 2894,2902 ****
  
   non_reread:
  
-   /* Record the last idle start time so that we can reset it
-      should the next event read be a help-echo.  */
-   last_idle_start = timer_idleness_start_time;
    timer_stop_idle ();
    RESUME_POLLING;
  
--- 2896,2901 ----
***************
*** 2936,2942 ****
           prevents automatic window selection (under
           mouse_autoselect_window from acting as a real input event, for
           example banishing the mouse under mouse-avoidance-mode.  */
!       timer_idleness_start_time = last_idle_start;
  
        /* Resume allowing input from any kboard, if that was true before.  */
        if (!was_locked)
--- 2935,2941 ----
           prevents automatic window selection (under
           mouse_autoselect_window from acting as a real input event, for
           example banishing the mouse under mouse-avoidance-mode.  */
!       timer_resume_idle ();
  
        /* Resume allowing input from any kboard, if that was true before.  */
        if (!was_locked)
***************
*** 3134,3140 ****
        show_help_echo (help, window, object, position, 0);
  
        /* We stopped being idle for this event; undo that.  */
!       timer_idleness_start_time = last_idle_start;
        goto retry;
      }
  
--- 3133,3139 ----
        show_help_echo (help, window, object, position, 0);
  
        /* We stopped being idle for this event; undo that.  */
!       timer_resume_idle ();
        goto retry;
      }
  
***************
*** 4251,4257 ****
  /* Record the start of when Emacs is idle,
     for the sake of running idle-time timers.  */
  
! void
  timer_start_idle ()
  {
    Lisp_Object timers;
--- 4250,4256 ----
  /* Record the start of when Emacs is idle,
     for the sake of running idle-time timers.  */
  
! static void
  timer_start_idle ()
  {
    Lisp_Object timers;
***************
*** 4279,4290 ****
  
  /* Record that Emacs is no longer idle, so stop running idle-time timers.  */
  
! void
  timer_stop_idle ()
  {
    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
  }
  
  /* This is only for debugging.  */
  struct input_event last_timer_event;
  
--- 4278,4300 ----
  
  /* Record that Emacs is no longer idle, so stop running idle-time timers.  */
  
! static void
  timer_stop_idle ()
  {
    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
  }
  
+ /* Resume idle timer from last idle start time.  */
+ 
+ static void
+ timer_resume_idle ()
+ {
+   if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
+     return;
+ 
+   timer_idleness_start_time = timer_last_idleness_start_time;
+ }
+ 
  /* This is only for debugging.  */
  struct input_event last_timer_event;
  
***************
*** 8846,8859 ****
             keymap may have changed, so replay the sequence.  */
          if (BUFFERP (key))
            {
!             EMACS_TIME initial_idleness_start_time;
!             EMACS_SET_SECS_USECS (initial_idleness_start_time,
!                                   EMACS_SECS (timer_last_idleness_start_time),
!                                   EMACS_USECS 
(timer_last_idleness_start_time));
! 
!             /* Resume idle state, using the same start-time as before.  */
!             timer_start_idle ();
!             timer_idleness_start_time = initial_idleness_start_time;
  
              mock_input = t;
              /* Reset the current buffer from the selected window
--- 8856,8862 ----
             keymap may have changed, so replay the sequence.  */
          if (BUFFERP (key))
            {
!             timer_resume_idle ();
  
              mock_input = t;
              /* Reset the current buffer from the selected window




reply via email to

[Prev in Thread] Current Thread [Next in Thread]