diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 129 |
1 files changed, 64 insertions, 65 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index c026b16e689..b8e05cf7925 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -360,7 +360,7 @@ Lisp_Object Qmenu_bar; | |||
| 360 | static void recursive_edit_unwind (Lisp_Object buffer); | 360 | static void recursive_edit_unwind (Lisp_Object buffer); |
| 361 | static Lisp_Object command_loop (void); | 361 | static Lisp_Object command_loop (void); |
| 362 | static Lisp_Object Qcommand_execute; | 362 | static Lisp_Object Qcommand_execute; |
| 363 | EMACS_TIME timer_check (void); | 363 | struct timespec timer_check (void); |
| 364 | 364 | ||
| 365 | static void echo_now (void); | 365 | static void echo_now (void); |
| 366 | static ptrdiff_t echo_length (void); | 366 | static ptrdiff_t echo_length (void); |
| @@ -370,9 +370,9 @@ static Lisp_Object Qpolling_period; | |||
| 370 | /* Incremented whenever a timer is run. */ | 370 | /* Incremented whenever a timer is run. */ |
| 371 | unsigned timers_run; | 371 | unsigned timers_run; |
| 372 | 372 | ||
| 373 | /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt | 373 | /* Address (if not 0) of struct timespec to zero out if a SIGIO interrupt |
| 374 | happens. */ | 374 | happens. */ |
| 375 | EMACS_TIME *input_available_clear_time; | 375 | struct timespec *input_available_clear_time; |
| 376 | 376 | ||
| 377 | /* True means use SIGIO interrupts; false means use CBREAK mode. | 377 | /* True means use SIGIO interrupts; false means use CBREAK mode. |
| 378 | Default is true if INTERRUPT_INPUT is defined. */ | 378 | Default is true if INTERRUPT_INPUT is defined. */ |
| @@ -389,12 +389,12 @@ bool interrupts_deferred; | |||
| 389 | 389 | ||
| 390 | /* The time when Emacs started being idle. */ | 390 | /* The time when Emacs started being idle. */ |
| 391 | 391 | ||
| 392 | static EMACS_TIME timer_idleness_start_time; | 392 | static struct timespec timer_idleness_start_time; |
| 393 | 393 | ||
| 394 | /* After Emacs stops being idle, this saves the last value | 394 | /* After Emacs stops being idle, this saves the last value |
| 395 | of timer_idleness_start_time from when it was idle. */ | 395 | of timer_idleness_start_time from when it was idle. */ |
| 396 | 396 | ||
| 397 | static EMACS_TIME timer_last_idleness_start_time; | 397 | static struct timespec timer_last_idleness_start_time; |
| 398 | 398 | ||
| 399 | 399 | ||
| 400 | /* Global variable declarations. */ | 400 | /* Global variable declarations. */ |
| @@ -1986,10 +1986,10 @@ start_polling (void) | |||
| 1986 | /* If poll timer doesn't exist, are we need one with | 1986 | /* If poll timer doesn't exist, are we need one with |
| 1987 | a different interval, start a new one. */ | 1987 | a different interval, start a new one. */ |
| 1988 | if (poll_timer == NULL | 1988 | if (poll_timer == NULL |
| 1989 | || EMACS_SECS (poll_timer->interval) != polling_period) | 1989 | || poll_timer->interval.tv_sec != polling_period) |
| 1990 | { | 1990 | { |
| 1991 | time_t period = max (1, min (polling_period, TYPE_MAXIMUM (time_t))); | 1991 | time_t period = max (1, min (polling_period, TYPE_MAXIMUM (time_t))); |
| 1992 | EMACS_TIME interval = make_emacs_time (period, 0); | 1992 | struct timespec interval = make_timespec (period, 0); |
| 1993 | 1993 | ||
| 1994 | if (poll_timer) | 1994 | if (poll_timer) |
| 1995 | cancel_atimer (poll_timer); | 1995 | cancel_atimer (poll_timer); |
| @@ -2182,7 +2182,7 @@ show_help_echo (Lisp_Object help, Lisp_Object window, Lisp_Object object, | |||
| 2182 | /* Input of single characters from keyboard */ | 2182 | /* Input of single characters from keyboard */ |
| 2183 | 2183 | ||
| 2184 | static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu, | 2184 | static Lisp_Object kbd_buffer_get_event (KBOARD **kbp, bool *used_mouse_menu, |
| 2185 | EMACS_TIME *end_time); | 2185 | struct timespec *end_time); |
| 2186 | static void record_char (Lisp_Object c); | 2186 | static void record_char (Lisp_Object c); |
| 2187 | 2187 | ||
| 2188 | static Lisp_Object help_form_saved_window_configs; | 2188 | static Lisp_Object help_form_saved_window_configs; |
| @@ -2204,7 +2204,7 @@ do { if (polling_stopped_here) start_polling (); \ | |||
| 2204 | polling_stopped_here = 0; } while (0) | 2204 | polling_stopped_here = 0; } while (0) |
| 2205 | 2205 | ||
| 2206 | static Lisp_Object | 2206 | static Lisp_Object |
| 2207 | read_event_from_main_queue (EMACS_TIME *end_time, | 2207 | read_event_from_main_queue (struct timespec *end_time, |
| 2208 | sys_jmp_buf local_getcjmp, | 2208 | sys_jmp_buf local_getcjmp, |
| 2209 | bool *used_mouse_menu) | 2209 | bool *used_mouse_menu) |
| 2210 | { | 2210 | { |
| @@ -2217,7 +2217,7 @@ read_event_from_main_queue (EMACS_TIME *end_time, | |||
| 2217 | /* Read from the main queue, and if that gives us something we can't use yet, | 2217 | /* Read from the main queue, and if that gives us something we can't use yet, |
| 2218 | we put it on the appropriate side queue and try again. */ | 2218 | we put it on the appropriate side queue and try again. */ |
| 2219 | 2219 | ||
| 2220 | if (end_time && EMACS_TIME_LE (*end_time, current_emacs_time ())) | 2220 | if (end_time && timespec_cmp (*end_time, current_timespec ()) <= 0) |
| 2221 | return c; | 2221 | return c; |
| 2222 | 2222 | ||
| 2223 | /* Actually read a character, waiting if necessary. */ | 2223 | /* Actually read a character, waiting if necessary. */ |
| @@ -2278,7 +2278,7 @@ read_event_from_main_queue (EMACS_TIME *end_time, | |||
| 2278 | /* Like `read_event_from_main_queue' but applies keyboard-coding-system | 2278 | /* Like `read_event_from_main_queue' but applies keyboard-coding-system |
| 2279 | to tty input. */ | 2279 | to tty input. */ |
| 2280 | static Lisp_Object | 2280 | static Lisp_Object |
| 2281 | read_decoded_event_from_main_queue (EMACS_TIME *end_time, | 2281 | read_decoded_event_from_main_queue (struct timespec *end_time, |
| 2282 | sys_jmp_buf local_getcjmp, | 2282 | sys_jmp_buf local_getcjmp, |
| 2283 | Lisp_Object prev_event, | 2283 | Lisp_Object prev_event, |
| 2284 | bool *used_mouse_menu) | 2284 | bool *used_mouse_menu) |
| @@ -2376,7 +2376,7 @@ read_decoded_event_from_main_queue (EMACS_TIME *end_time, | |||
| 2376 | Value is -2 when we find input on another keyboard. A second call | 2376 | Value is -2 when we find input on another keyboard. A second call |
| 2377 | to read_char will read it. | 2377 | to read_char will read it. |
| 2378 | 2378 | ||
| 2379 | If END_TIME is non-null, it is a pointer to an EMACS_TIME | 2379 | If END_TIME is non-null, it is a pointer to a struct timespec |
| 2380 | specifying the maximum time to wait until. If no input arrives by | 2380 | specifying the maximum time to wait until. If no input arrives by |
| 2381 | that time, stop waiting and return nil. | 2381 | that time, stop waiting and return nil. |
| 2382 | 2382 | ||
| @@ -2385,7 +2385,7 @@ read_decoded_event_from_main_queue (EMACS_TIME *end_time, | |||
| 2385 | Lisp_Object | 2385 | Lisp_Object |
| 2386 | read_char (int commandflag, Lisp_Object map, | 2386 | read_char (int commandflag, Lisp_Object map, |
| 2387 | Lisp_Object prev_event, | 2387 | Lisp_Object prev_event, |
| 2388 | bool *used_mouse_menu, EMACS_TIME *end_time) | 2388 | bool *used_mouse_menu, struct timespec *end_time) |
| 2389 | { | 2389 | { |
| 2390 | Lisp_Object c; | 2390 | Lisp_Object c; |
| 2391 | ptrdiff_t jmpcount; | 2391 | ptrdiff_t jmpcount; |
| @@ -2877,7 +2877,7 @@ read_char (int commandflag, Lisp_Object map, | |||
| 2877 | { | 2877 | { |
| 2878 | c = read_decoded_event_from_main_queue (end_time, local_getcjmp, | 2878 | c = read_decoded_event_from_main_queue (end_time, local_getcjmp, |
| 2879 | prev_event, used_mouse_menu); | 2879 | prev_event, used_mouse_menu); |
| 2880 | if (end_time && EMACS_TIME_LE (*end_time, current_emacs_time ())) | 2880 | if (end_time && timespec_cmp (*end_time, current_timespec ()) <= 0) |
| 2881 | goto exit; | 2881 | goto exit; |
| 2882 | if (EQ (c, make_number (-2))) | 2882 | if (EQ (c, make_number (-2))) |
| 2883 | { | 2883 | { |
| @@ -3798,7 +3798,7 @@ clear_event (struct input_event *event) | |||
| 3798 | static Lisp_Object | 3798 | static Lisp_Object |
| 3799 | kbd_buffer_get_event (KBOARD **kbp, | 3799 | kbd_buffer_get_event (KBOARD **kbp, |
| 3800 | bool *used_mouse_menu, | 3800 | bool *used_mouse_menu, |
| 3801 | EMACS_TIME *end_time) | 3801 | struct timespec *end_time) |
| 3802 | { | 3802 | { |
| 3803 | Lisp_Object obj; | 3803 | Lisp_Object obj; |
| 3804 | 3804 | ||
| @@ -3856,15 +3856,15 @@ kbd_buffer_get_event (KBOARD **kbp, | |||
| 3856 | break; | 3856 | break; |
| 3857 | if (end_time) | 3857 | if (end_time) |
| 3858 | { | 3858 | { |
| 3859 | EMACS_TIME now = current_emacs_time (); | 3859 | struct timespec now = current_timespec (); |
| 3860 | if (EMACS_TIME_LE (*end_time, now)) | 3860 | if (timespec_cmp (*end_time, now) <= 0) |
| 3861 | return Qnil; /* Finished waiting. */ | 3861 | return Qnil; /* Finished waiting. */ |
| 3862 | else | 3862 | else |
| 3863 | { | 3863 | { |
| 3864 | EMACS_TIME duration = sub_emacs_time (*end_time, now); | 3864 | struct timespec duration = timespec_sub (*end_time, now); |
| 3865 | wait_reading_process_output (min (EMACS_SECS (duration), | 3865 | wait_reading_process_output (min (duration.tv_sec, |
| 3866 | WAIT_READING_MAX), | 3866 | WAIT_READING_MAX), |
| 3867 | EMACS_NSECS (duration), | 3867 | duration.tv_nsec, |
| 3868 | -1, 1, Qnil, NULL, 0); | 3868 | -1, 1, Qnil, NULL, 0); |
| 3869 | } | 3869 | } |
| 3870 | } | 3870 | } |
| @@ -4295,10 +4295,10 @@ static void | |||
| 4295 | timer_start_idle (void) | 4295 | timer_start_idle (void) |
| 4296 | { | 4296 | { |
| 4297 | /* If we are already in the idle state, do nothing. */ | 4297 | /* If we are already in the idle state, do nothing. */ |
| 4298 | if (EMACS_TIME_VALID_P (timer_idleness_start_time)) | 4298 | if (timespec_valid_p (timer_idleness_start_time)) |
| 4299 | return; | 4299 | return; |
| 4300 | 4300 | ||
| 4301 | timer_idleness_start_time = current_emacs_time (); | 4301 | timer_idleness_start_time = current_timespec (); |
| 4302 | timer_last_idleness_start_time = timer_idleness_start_time; | 4302 | timer_last_idleness_start_time = timer_idleness_start_time; |
| 4303 | 4303 | ||
| 4304 | /* Mark all idle-time timers as once again candidates for running. */ | 4304 | /* Mark all idle-time timers as once again candidates for running. */ |
| @@ -4310,7 +4310,7 @@ timer_start_idle (void) | |||
| 4310 | static void | 4310 | static void |
| 4311 | timer_stop_idle (void) | 4311 | timer_stop_idle (void) |
| 4312 | { | 4312 | { |
| 4313 | timer_idleness_start_time = invalid_emacs_time (); | 4313 | timer_idleness_start_time = invalid_timespec (); |
| 4314 | } | 4314 | } |
| 4315 | 4315 | ||
| 4316 | /* Resume idle timer from last idle start time. */ | 4316 | /* Resume idle timer from last idle start time. */ |
| @@ -4318,7 +4318,7 @@ timer_stop_idle (void) | |||
| 4318 | static void | 4318 | static void |
| 4319 | timer_resume_idle (void) | 4319 | timer_resume_idle (void) |
| 4320 | { | 4320 | { |
| 4321 | if (EMACS_TIME_VALID_P (timer_idleness_start_time)) | 4321 | if (timespec_valid_p (timer_idleness_start_time)) |
| 4322 | return; | 4322 | return; |
| 4323 | 4323 | ||
| 4324 | timer_idleness_start_time = timer_last_idleness_start_time; | 4324 | timer_idleness_start_time = timer_last_idleness_start_time; |
| @@ -4334,7 +4334,7 @@ Lisp_Object pending_funcalls; | |||
| 4334 | 4334 | ||
| 4335 | /* Return true if TIMER is a valid timer, placing its value into *RESULT. */ | 4335 | /* Return true if TIMER is a valid timer, placing its value into *RESULT. */ |
| 4336 | static bool | 4336 | static bool |
| 4337 | decode_timer (Lisp_Object timer, EMACS_TIME *result) | 4337 | decode_timer (Lisp_Object timer, struct timespec *result) |
| 4338 | { | 4338 | { |
| 4339 | Lisp_Object *vector; | 4339 | Lisp_Object *vector; |
| 4340 | 4340 | ||
| @@ -4361,16 +4361,16 @@ decode_timer (Lisp_Object timer, EMACS_TIME *result) | |||
| 4361 | In that case we return 0 to indicate that a new timer_check_2 call | 4361 | In that case we return 0 to indicate that a new timer_check_2 call |
| 4362 | should be done. */ | 4362 | should be done. */ |
| 4363 | 4363 | ||
| 4364 | static EMACS_TIME | 4364 | static struct timespec |
| 4365 | timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | 4365 | timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) |
| 4366 | { | 4366 | { |
| 4367 | EMACS_TIME nexttime; | 4367 | struct timespec nexttime; |
| 4368 | EMACS_TIME now; | 4368 | struct timespec now; |
| 4369 | EMACS_TIME idleness_now; | 4369 | struct timespec idleness_now; |
| 4370 | Lisp_Object chosen_timer; | 4370 | Lisp_Object chosen_timer; |
| 4371 | struct gcpro gcpro1; | 4371 | struct gcpro gcpro1; |
| 4372 | 4372 | ||
| 4373 | nexttime = invalid_emacs_time (); | 4373 | nexttime = invalid_timespec (); |
| 4374 | 4374 | ||
| 4375 | chosen_timer = Qnil; | 4375 | chosen_timer = Qnil; |
| 4376 | GCPRO1 (chosen_timer); | 4376 | GCPRO1 (chosen_timer); |
| @@ -4385,19 +4385,19 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | |||
| 4385 | 4385 | ||
| 4386 | if (CONSP (timers) || CONSP (idle_timers)) | 4386 | if (CONSP (timers) || CONSP (idle_timers)) |
| 4387 | { | 4387 | { |
| 4388 | now = current_emacs_time (); | 4388 | now = current_timespec (); |
| 4389 | idleness_now = (EMACS_TIME_VALID_P (timer_idleness_start_time) | 4389 | idleness_now = (timespec_valid_p (timer_idleness_start_time) |
| 4390 | ? sub_emacs_time (now, timer_idleness_start_time) | 4390 | ? timespec_sub (now, timer_idleness_start_time) |
| 4391 | : make_emacs_time (0, 0)); | 4391 | : make_timespec (0, 0)); |
| 4392 | } | 4392 | } |
| 4393 | 4393 | ||
| 4394 | while (CONSP (timers) || CONSP (idle_timers)) | 4394 | while (CONSP (timers) || CONSP (idle_timers)) |
| 4395 | { | 4395 | { |
| 4396 | Lisp_Object timer = Qnil, idle_timer = Qnil; | 4396 | Lisp_Object timer = Qnil, idle_timer = Qnil; |
| 4397 | EMACS_TIME timer_time, idle_timer_time; | 4397 | struct timespec timer_time, idle_timer_time; |
| 4398 | EMACS_TIME difference; | 4398 | struct timespec difference; |
| 4399 | EMACS_TIME timer_difference = invalid_emacs_time (); | 4399 | struct timespec timer_difference = invalid_timespec (); |
| 4400 | EMACS_TIME idle_timer_difference = invalid_emacs_time (); | 4400 | struct timespec idle_timer_difference = invalid_timespec (); |
| 4401 | bool ripe, timer_ripe = 0, idle_timer_ripe = 0; | 4401 | bool ripe, timer_ripe = 0, idle_timer_ripe = 0; |
| 4402 | 4402 | ||
| 4403 | /* Set TIMER and TIMER_DIFFERENCE | 4403 | /* Set TIMER and TIMER_DIFFERENCE |
| @@ -4414,10 +4414,10 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | |||
| 4414 | continue; | 4414 | continue; |
| 4415 | } | 4415 | } |
| 4416 | 4416 | ||
| 4417 | timer_ripe = EMACS_TIME_LE (timer_time, now); | 4417 | timer_ripe = timespec_cmp (timer_time, now) <= 0; |
| 4418 | timer_difference = (timer_ripe | 4418 | timer_difference = (timer_ripe |
| 4419 | ? sub_emacs_time (now, timer_time) | 4419 | ? timespec_sub (now, timer_time) |
| 4420 | : sub_emacs_time (timer_time, now)); | 4420 | : timespec_sub (timer_time, now)); |
| 4421 | } | 4421 | } |
| 4422 | 4422 | ||
| 4423 | /* Likewise for IDLE_TIMER and IDLE_TIMER_DIFFERENCE | 4423 | /* Likewise for IDLE_TIMER and IDLE_TIMER_DIFFERENCE |
| @@ -4431,26 +4431,27 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | |||
| 4431 | continue; | 4431 | continue; |
| 4432 | } | 4432 | } |
| 4433 | 4433 | ||
| 4434 | idle_timer_ripe = EMACS_TIME_LE (idle_timer_time, idleness_now); | 4434 | idle_timer_ripe = timespec_cmp (idle_timer_time, idleness_now) <= 0; |
| 4435 | idle_timer_difference | 4435 | idle_timer_difference |
| 4436 | = (idle_timer_ripe | 4436 | = (idle_timer_ripe |
| 4437 | ? sub_emacs_time (idleness_now, idle_timer_time) | 4437 | ? timespec_sub (idleness_now, idle_timer_time) |
| 4438 | : sub_emacs_time (idle_timer_time, idleness_now)); | 4438 | : timespec_sub (idle_timer_time, idleness_now)); |
| 4439 | } | 4439 | } |
| 4440 | 4440 | ||
| 4441 | /* Decide which timer is the next timer, | 4441 | /* Decide which timer is the next timer, |
| 4442 | and set CHOSEN_TIMER, DIFFERENCE, and RIPE accordingly. | 4442 | and set CHOSEN_TIMER, DIFFERENCE, and RIPE accordingly. |
| 4443 | Also step down the list where we found that timer. */ | 4443 | Also step down the list where we found that timer. */ |
| 4444 | 4444 | ||
| 4445 | if (EMACS_TIME_VALID_P (timer_difference) | 4445 | if (timespec_valid_p (timer_difference) |
| 4446 | && (! EMACS_TIME_VALID_P (idle_timer_difference) | 4446 | && (! timespec_valid_p (idle_timer_difference) |
| 4447 | || idle_timer_ripe < timer_ripe | 4447 | || idle_timer_ripe < timer_ripe |
| 4448 | || (idle_timer_ripe == timer_ripe | 4448 | || (idle_timer_ripe == timer_ripe |
| 4449 | && (timer_ripe | 4449 | && ((timer_ripe |
| 4450 | ? EMACS_TIME_LT (idle_timer_difference, | 4450 | ? timespec_cmp (idle_timer_difference, |
| 4451 | timer_difference) | 4451 | timer_difference) |
| 4452 | : EMACS_TIME_LT (timer_difference, | 4452 | : timespec_cmp (timer_difference, |
| 4453 | idle_timer_difference))))) | 4453 | idle_timer_difference)) |
| 4454 | < 0)))) | ||
| 4454 | { | 4455 | { |
| 4455 | chosen_timer = timer; | 4456 | chosen_timer = timer; |
| 4456 | timers = XCDR (timers); | 4457 | timers = XCDR (timers); |
| @@ -4490,7 +4491,7 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | |||
| 4490 | return 0 to indicate that. */ | 4491 | return 0 to indicate that. */ |
| 4491 | } | 4492 | } |
| 4492 | 4493 | ||
| 4493 | nexttime = make_emacs_time (0, 0); | 4494 | nexttime = make_timespec (0, 0); |
| 4494 | break; | 4495 | break; |
| 4495 | } | 4496 | } |
| 4496 | else | 4497 | else |
| @@ -4518,10 +4519,10 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) | |||
| 4518 | 4519 | ||
| 4519 | As long as any timer is ripe, we run it. */ | 4520 | As long as any timer is ripe, we run it. */ |
| 4520 | 4521 | ||
| 4521 | EMACS_TIME | 4522 | struct timespec |
| 4522 | timer_check (void) | 4523 | timer_check (void) |
| 4523 | { | 4524 | { |
| 4524 | EMACS_TIME nexttime; | 4525 | struct timespec nexttime; |
| 4525 | Lisp_Object timers, idle_timers; | 4526 | Lisp_Object timers, idle_timers; |
| 4526 | struct gcpro gcpro1, gcpro2; | 4527 | struct gcpro gcpro1, gcpro2; |
| 4527 | 4528 | ||
| @@ -4535,7 +4536,7 @@ timer_check (void) | |||
| 4535 | /* Always consider the ordinary timers. */ | 4536 | /* Always consider the ordinary timers. */ |
| 4536 | timers = Fcopy_sequence (Vtimer_list); | 4537 | timers = Fcopy_sequence (Vtimer_list); |
| 4537 | /* Consider the idle timers only if Emacs is idle. */ | 4538 | /* Consider the idle timers only if Emacs is idle. */ |
| 4538 | if (EMACS_TIME_VALID_P (timer_idleness_start_time)) | 4539 | if (timespec_valid_p (timer_idleness_start_time)) |
| 4539 | idle_timers = Fcopy_sequence (Vtimer_idle_list); | 4540 | idle_timers = Fcopy_sequence (Vtimer_idle_list); |
| 4540 | else | 4541 | else |
| 4541 | idle_timers = Qnil; | 4542 | idle_timers = Qnil; |
| @@ -4548,7 +4549,7 @@ timer_check (void) | |||
| 4548 | { | 4549 | { |
| 4549 | nexttime = timer_check_2 (timers, idle_timers); | 4550 | nexttime = timer_check_2 (timers, idle_timers); |
| 4550 | } | 4551 | } |
| 4551 | while (EMACS_SECS (nexttime) == 0 && EMACS_NSECS (nexttime) == 0); | 4552 | while (nexttime.tv_sec == 0 && nexttime.tv_nsec == 0); |
| 4552 | 4553 | ||
| 4553 | UNGCPRO; | 4554 | UNGCPRO; |
| 4554 | return nexttime; | 4555 | return nexttime; |
| @@ -4564,9 +4565,9 @@ The value when Emacs is not idle is nil. | |||
| 4564 | PSEC is a multiple of the system clock resolution. */) | 4565 | PSEC is a multiple of the system clock resolution. */) |
| 4565 | (void) | 4566 | (void) |
| 4566 | { | 4567 | { |
| 4567 | if (EMACS_TIME_VALID_P (timer_idleness_start_time)) | 4568 | if (timespec_valid_p (timer_idleness_start_time)) |
| 4568 | return make_lisp_time (sub_emacs_time (current_emacs_time (), | 4569 | return make_lisp_time (timespec_sub (current_timespec (), |
| 4569 | timer_idleness_start_time)); | 4570 | timer_idleness_start_time)); |
| 4570 | 4571 | ||
| 4571 | return Qnil; | 4572 | return Qnil; |
| 4572 | } | 4573 | } |
| @@ -7126,7 +7127,7 @@ handle_input_available_signal (int sig) | |||
| 7126 | pending_signals = 1; | 7127 | pending_signals = 1; |
| 7127 | 7128 | ||
| 7128 | if (input_available_clear_time) | 7129 | if (input_available_clear_time) |
| 7129 | *input_available_clear_time = make_emacs_time (0, 0); | 7130 | *input_available_clear_time = make_timespec (0, 0); |
| 7130 | } | 7131 | } |
| 7131 | 7132 | ||
| 7132 | static void | 7133 | static void |
| @@ -7213,7 +7214,7 @@ handle_user_signal (int sig) | |||
| 7213 | /* Tell wait_reading_process_output that it needs to wake | 7214 | /* Tell wait_reading_process_output that it needs to wake |
| 7214 | up and look around. */ | 7215 | up and look around. */ |
| 7215 | if (input_available_clear_time) | 7216 | if (input_available_clear_time) |
| 7216 | *input_available_clear_time = make_emacs_time (0, 0); | 7217 | *input_available_clear_time = make_timespec (0, 0); |
| 7217 | } | 7218 | } |
| 7218 | break; | 7219 | break; |
| 7219 | } | 7220 | } |
| @@ -8431,7 +8432,7 @@ read_char_minibuf_menu_prompt (int commandflag, | |||
| 8431 | return Qnil; | 8432 | return Qnil; |
| 8432 | 8433 | ||
| 8433 | #define PUSH_C_STR(str, listvar) \ | 8434 | #define PUSH_C_STR(str, listvar) \ |
| 8434 | listvar = Fcons (make_unibyte_string (str, strlen (str)), listvar) | 8435 | listvar = Fcons (build_unibyte_string (str), listvar) |
| 8435 | 8436 | ||
| 8436 | /* Prompt string always starts with map's prompt, and a space. */ | 8437 | /* Prompt string always starts with map's prompt, and a space. */ |
| 8437 | prompt_strings = Fcons (name, prompt_strings); | 8438 | prompt_strings = Fcons (name, prompt_strings); |
| @@ -10124,8 +10125,6 @@ Also end any kbd macro being defined. */) | |||
| 10124 | end_kbd_macro (); | 10125 | end_kbd_macro (); |
| 10125 | } | 10126 | } |
| 10126 | 10127 | ||
| 10127 | update_mode_lines++; | ||
| 10128 | |||
| 10129 | Vunread_command_events = Qnil; | 10128 | Vunread_command_events = Qnil; |
| 10130 | 10129 | ||
| 10131 | discard_tty_input (); | 10130 | discard_tty_input (); |
| @@ -10237,7 +10236,7 @@ stuff_buffered_input (Lisp_Object stuffstring) | |||
| 10237 | } | 10236 | } |
| 10238 | 10237 | ||
| 10239 | void | 10238 | void |
| 10240 | set_waiting_for_input (EMACS_TIME *time_to_clear) | 10239 | set_waiting_for_input (struct timespec *time_to_clear) |
| 10241 | { | 10240 | { |
| 10242 | input_available_clear_time = time_to_clear; | 10241 | input_available_clear_time = time_to_clear; |
| 10243 | 10242 | ||
| @@ -10848,7 +10847,7 @@ init_keyboard (void) | |||
| 10848 | immediate_quit = 0; | 10847 | immediate_quit = 0; |
| 10849 | quit_char = Ctl ('g'); | 10848 | quit_char = Ctl ('g'); |
| 10850 | Vunread_command_events = Qnil; | 10849 | Vunread_command_events = Qnil; |
| 10851 | timer_idleness_start_time = invalid_emacs_time (); | 10850 | timer_idleness_start_time = invalid_timespec (); |
| 10852 | total_keys = 0; | 10851 | total_keys = 0; |
| 10853 | recent_keys_index = 0; | 10852 | recent_keys_index = 0; |
| 10854 | kbd_fetch_ptr = kbd_buffer; | 10853 | kbd_fetch_ptr = kbd_buffer; |