/[emacs]/emacs/src/keyboard.c
ViewVC logotype

Diff of /emacs/src/keyboard.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.681.2.21 by miles, Sat Sep 4 09:26:25 2004 UTC revision 1.681.2.22 by miles, Mon Oct 25 04:19:36 2004 UTC
# Line 676  static Lisp_Object apply_modifiers P_ (( Line 676  static Lisp_Object apply_modifiers P_ ((
676  static void clear_event P_ ((struct input_event *));  static void clear_event P_ ((struct input_event *));
677  static void any_kboard_state P_ ((void));  static void any_kboard_state P_ ((void));
678  static SIGTYPE interrupt_signal P_ ((int signalnum));  static SIGTYPE interrupt_signal P_ ((int signalnum));
679    static void timer_start_idle P_ ((void));
680    static void timer_stop_idle P_ ((void));
681    static void timer_resume_idle P_ ((void));
682    
683  /* Nonzero means don't try to suspend even if the operating system seems  /* Nonzero means don't try to suspend even if the operating system seems
684     to support it.  */     to support it.  */
# Line 2387  read_char (commandflag, nmaps, maps, pre Line 2390  read_char (commandflag, nmaps, maps, pre
2390    volatile Lisp_Object also_record;    volatile Lisp_Object also_record;
2391    volatile int reread;    volatile int reread;
2392    struct gcpro gcpro1, gcpro2;    struct gcpro gcpro1, gcpro2;
   EMACS_TIME last_idle_start;  
2393    int polling_stopped_here = 0;    int polling_stopped_here = 0;
2394    
2395    also_record = Qnil;    also_record = Qnil;
# Line 2894  read_char (commandflag, nmaps, maps, pre Line 2896  read_char (commandflag, nmaps, maps, pre
2896    
2897   non_reread:   non_reread:
2898    
   /* 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;  
2899    timer_stop_idle ();    timer_stop_idle ();
2900    RESUME_POLLING;    RESUME_POLLING;
2901    
# Line 2936  read_char (commandflag, nmaps, maps, pre Line 2935  read_char (commandflag, nmaps, maps, pre
2935             prevents automatic window selection (under             prevents automatic window selection (under
2936             mouse_autoselect_window from acting as a real input event, for             mouse_autoselect_window from acting as a real input event, for
2937             example banishing the mouse under mouse-avoidance-mode.  */             example banishing the mouse under mouse-avoidance-mode.  */
2938          timer_idleness_start_time = last_idle_start;          timer_resume_idle ();
2939    
2940        /* Resume allowing input from any kboard, if that was true before.  */        /* Resume allowing input from any kboard, if that was true before.  */
2941        if (!was_locked)        if (!was_locked)
# Line 3135  read_char (commandflag, nmaps, maps, pre Line 3134  read_char (commandflag, nmaps, maps, pre
3134        show_help_echo (help, window, object, position, 0);        show_help_echo (help, window, object, position, 0);
3135    
3136        /* We stopped being idle for this event; undo that.  */        /* We stopped being idle for this event; undo that.  */
3137        timer_idleness_start_time = last_idle_start;        timer_resume_idle ();
3138        goto retry;        goto retry;
3139      }      }
3140    
# Line 4252  swallow_events (do_display) Line 4251  swallow_events (do_display)
4251  /* Record the start of when Emacs is idle,  /* Record the start of when Emacs is idle,
4252     for the sake of running idle-time timers.  */     for the sake of running idle-time timers.  */
4253    
4254  void  static void
4255  timer_start_idle ()  timer_start_idle ()
4256  {  {
4257    Lisp_Object timers;    Lisp_Object timers;
# Line 4280  timer_start_idle () Line 4279  timer_start_idle ()
4279    
4280  /* Record that Emacs is no longer idle, so stop running idle-time timers.  */  /* Record that Emacs is no longer idle, so stop running idle-time timers.  */
4281    
4282  void  static void
4283  timer_stop_idle ()  timer_stop_idle ()
4284  {  {
4285    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
4286  }  }
4287    
4288    /* Resume idle timer from last idle start time.  */
4289    
4290    static void
4291    timer_resume_idle ()
4292    {
4293      if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
4294        return;
4295    
4296      timer_idleness_start_time = timer_last_idleness_start_time;
4297    }
4298    
4299  /* This is only for debugging.  */  /* This is only for debugging.  */
4300  struct input_event last_timer_event;  struct input_event last_timer_event;
4301    
# Line 8847  read_key_sequence (keybuf, bufsize, prom Line 8857  read_key_sequence (keybuf, bufsize, prom
8857               keymap may have changed, so replay the sequence.  */               keymap may have changed, so replay the sequence.  */
8858            if (BUFFERP (key))            if (BUFFERP (key))
8859              {              {
8860                EMACS_TIME initial_idleness_start_time;                timer_resume_idle ();
               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;  
8861    
8862                mock_input = t;                mock_input = t;
8863                /* Reset the current buffer from the selected window                /* Reset the current buffer from the selected window

Legend:
Removed from v.1.681.2.21  
changed lines
  Added in v.1.681.2.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26