/[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.753.2.11 by miles, Fri Aug 27 07:00:31 2004 UTC revision 1.753.2.12 by miles, Thu Oct 14 08:49:55 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 3134  read_char (commandflag, nmaps, maps, pre Line 3133  read_char (commandflag, nmaps, maps, pre
3133        show_help_echo (help, window, object, position, 0);        show_help_echo (help, window, object, position, 0);
3134    
3135        /* We stopped being idle for this event; undo that.  */        /* We stopped being idle for this event; undo that.  */
3136        timer_idleness_start_time = last_idle_start;        timer_resume_idle ();
3137        goto retry;        goto retry;
3138      }      }
3139    
# Line 4251  swallow_events (do_display) Line 4250  swallow_events (do_display)
4250  /* Record the start of when Emacs is idle,  /* Record the start of when Emacs is idle,
4251     for the sake of running idle-time timers.  */     for the sake of running idle-time timers.  */
4252    
4253  void  static void
4254  timer_start_idle ()  timer_start_idle ()
4255  {  {
4256    Lisp_Object timers;    Lisp_Object timers;
# Line 4279  timer_start_idle () Line 4278  timer_start_idle ()
4278    
4279  /* 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.  */
4280    
4281  void  static void
4282  timer_stop_idle ()  timer_stop_idle ()
4283  {  {
4284    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);    EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
4285  }  }
4286    
4287    /* Resume idle timer from last idle start time.  */
4288    
4289    static void
4290    timer_resume_idle ()
4291    {
4292      if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
4293        return;
4294    
4295      timer_idleness_start_time = timer_last_idleness_start_time;
4296    }
4297    
4298  /* This is only for debugging.  */  /* This is only for debugging.  */
4299  struct input_event last_timer_event;  struct input_event last_timer_event;
4300    
# Line 8846  read_key_sequence (keybuf, bufsize, prom Line 8856  read_key_sequence (keybuf, bufsize, prom
8856               keymap may have changed, so replay the sequence.  */               keymap may have changed, so replay the sequence.  */
8857            if (BUFFERP (key))            if (BUFFERP (key))
8858              {              {
8859                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;  
8860    
8861                mock_input = t;                mock_input = t;
8862                /* Reset the current buffer from the selected window                /* Reset the current buffer from the selected window

Legend:
Removed from v.1.753.2.11  
changed lines
  Added in v.1.753.2.12

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