Mercurial > emacs
comparison src/keyboard.c @ 38195:7255d1f70b82
(read_char) <non_reread>: Record the previous idle
start time before calling timer_stop_idle.
(read_char) <reread_first>: After processing a help-echo event,
restore the previous idle start time.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 26 Jun 2001 12:30:59 +0000 |
parents | c3dd00963b46 |
children | bd16bae990a7 |
comparison
equal
deleted
inserted
replaced
38194:a23820c19d03 | 38195:7255d1f70b82 |
---|---|
641 Lisp_Object Vdisable_point_adjustment; | 641 Lisp_Object Vdisable_point_adjustment; |
642 | 642 |
643 /* If non-nil, always disable point adjustment. */ | 643 /* If non-nil, always disable point adjustment. */ |
644 | 644 |
645 Lisp_Object Vglobal_disable_point_adjustment; | 645 Lisp_Object Vglobal_disable_point_adjustment; |
646 | |
647 /* The time when Emacs started being idle. */ | |
648 | |
649 static EMACS_TIME timer_idleness_start_time; | |
646 | 650 |
647 | 651 |
648 /* Global variable declarations. */ | 652 /* Global variable declarations. */ |
649 | 653 |
650 /* Function for init_keyboard to call with no args (if nonzero). */ | 654 /* Function for init_keyboard to call with no args (if nonzero). */ |
2093 Lisp_Object tem, save; | 2097 Lisp_Object tem, save; |
2094 volatile Lisp_Object previous_echo_area_message; | 2098 volatile Lisp_Object previous_echo_area_message; |
2095 volatile Lisp_Object also_record; | 2099 volatile Lisp_Object also_record; |
2096 volatile int reread; | 2100 volatile int reread; |
2097 struct gcpro gcpro1, gcpro2; | 2101 struct gcpro gcpro1, gcpro2; |
2102 EMACS_TIME last_idle_start; | |
2098 | 2103 |
2099 also_record = Qnil; | 2104 also_record = Qnil; |
2100 | 2105 |
2101 before_command_key_count = this_command_key_count; | 2106 before_command_key_count = this_command_key_count; |
2102 before_command_echo_length = echo_length (); | 2107 before_command_echo_length = echo_length (); |
2586 XSETINT (c, XINT (c) | (extra_keyboard_modifiers & ~0xff7f & ~CHAR_CTL)); | 2591 XSETINT (c, XINT (c) | (extra_keyboard_modifiers & ~0xff7f & ~CHAR_CTL)); |
2587 } | 2592 } |
2588 | 2593 |
2589 non_reread: | 2594 non_reread: |
2590 | 2595 |
2596 /* Record the last idle start time so that we can reset it | |
2597 should the next event read be a help-echo. */ | |
2598 last_idle_start = timer_idleness_start_time; | |
2591 timer_stop_idle (); | 2599 timer_stop_idle (); |
2592 start_polling (); | 2600 start_polling (); |
2593 | 2601 |
2594 if (NILP (c)) | 2602 if (NILP (c)) |
2595 { | 2603 { |
2802 help = Fnth (make_number (2), c); | 2810 help = Fnth (make_number (2), c); |
2803 window = Fnth (make_number (3), c); | 2811 window = Fnth (make_number (3), c); |
2804 object = Fnth (make_number (4), c); | 2812 object = Fnth (make_number (4), c); |
2805 position = Fnth (make_number (5), c); | 2813 position = Fnth (make_number (5), c); |
2806 show_help_echo (help, window, object, position, 0); | 2814 show_help_echo (help, window, object, position, 0); |
2815 | |
2816 /* We stopped being idle for this event; undo that. */ | |
2817 timer_idleness_start_time = last_idle_start; | |
2807 goto retry; | 2818 goto retry; |
2808 } | 2819 } |
2809 | 2820 |
2810 if (this_command_key_count == 0 || ! reread) | 2821 if (this_command_key_count == 0 || ! reread) |
2811 { | 2822 { |
3822 | 3833 |
3823 if (timers_run != old_timers_run && do_display) | 3834 if (timers_run != old_timers_run && do_display) |
3824 redisplay_preserve_echo_area (7); | 3835 redisplay_preserve_echo_area (7); |
3825 } | 3836 } |
3826 | 3837 |
3827 static EMACS_TIME timer_idleness_start_time; | |
3828 | |
3829 /* Record the start of when Emacs is idle, | 3838 /* Record the start of when Emacs is idle, |
3830 for the sake of running idle-time timers. */ | 3839 for the sake of running idle-time timers. */ |
3831 | 3840 |
3832 void | 3841 void |
3833 timer_start_idle () | 3842 timer_start_idle () |