From 5e093f4432b787ddf421b96abfe5f4c04554188a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 29 Jul 2006 01:54:16 +0000 Subject: (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. --- src/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 23e10aefac1..95d880d1209 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2032,6 +2032,8 @@ static Lisp_Object safe_run_hooks_1 (hook) Lisp_Object hook; { + if (NILP (Vrun_hooks)) + return Qnil; return call1 (Vrun_hooks, Vinhibit_quit); } -- cgit v1.2.1 From 092869b9735590049a4be576970c95dc4b53af75 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:38:21 +0000 Subject: * keyboard.c (read_char): Rebalance specpdl after receiving jump. --- src/keyboard.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 95d880d1209..a4e1c98c013 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2403,7 +2403,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) EMACS_TIME *end_time; { volatile Lisp_Object c; - int count; + int count, jmpcount; jmp_buf local_getcjmp; jmp_buf save_jump; volatile int key_already_recorded = 0; @@ -2629,11 +2629,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) around any call to sit_for or kbd_buffer_get_event; it *must not* be in effect when we call redisplay. */ + jmpcount = SPECPDL_INDEX (); if (_setjmp (local_getcjmp)) { /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); + unbind_to (jmpcount, Qnil); XSETINT (c, quit_char); internal_last_event_frame = selected_frame; Vlast_event_frame = internal_last_event_frame; -- cgit v1.2.1 From 6b657e423e2e10e4d9f7061e76cd3f8f3fcff7b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 12:00:32 +0000 Subject: (kbd_buffer_get_event): Return Qnil when current time is exactly equal to end_time, not only when it is past that. --- src/keyboard.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index a4e1c98c013..6f12994a1b8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3954,13 +3954,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) { EMACS_TIME duration; EMACS_GET_TIME (duration); - EMACS_SUB_TIME (duration, *end_time, duration); - if (EMACS_TIME_NEG_P (duration)) - return Qnil; + if (EMACS_TIME_GE (duration, *end_time)) + return Qnil; /* finished waiting */ else - wait_reading_process_output (EMACS_SECS (duration), - EMACS_USECS (duration), - -1, 1, Qnil, NULL, 0); + { + EMACS_SUB_TIME (duration, *end_time, duration); + wait_reading_process_output (EMACS_SECS (duration), + EMACS_USECS (duration), + -1, 1, Qnil, NULL, 0); + } } else wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); -- cgit v1.2.1 From c2028ac64fab925570fa9ef7e1ed564f4aa3eb2c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 9 Aug 2006 04:55:10 +0000 Subject: (keyremap_step): No-op if fkey->parent = nil. (read_key_sequence): Always start fkey.start and fkey.end at 0, and likewise for keytran. --- src/keyboard.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 6f12994a1b8..ae3b78b04d2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8385,7 +8385,15 @@ follow_key (key, nmaps, current, defs, next) such as Vfunction_key_map and Vkey_translation_map. */ typedef struct keyremap { - Lisp_Object map, parent; + /* This is the map originally specified for this use. */ + Lisp_Object parent; + /* This is a submap reached by looking up, in PARENT, + the events from START to END. */ + Lisp_Object map; + /* Positions [START, END) in the key sequence buffer + are the key that we have scanned so far. + Those events are the ones that we will replace + if PAREHT maps them into a key sequence. */ int start, end; } keyremap; @@ -8458,7 +8466,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) Lisp_Object next, key; key = keybuf[fkey->end++]; - next = access_keymap_keyremap (fkey->map, key, prompt, doit); + + if (KEYMAPP (fkey->parent)) + next = access_keymap_keyremap (fkey->map, key, prompt, doit); + else + next = Qnil; /* If keybuf[fkey->start..fkey->end] is bound in the map and we're in a position to do the key remapping, replace it with @@ -8656,9 +8668,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, delayed_switch_frame = Qnil; fkey.map = fkey.parent = Vfunction_key_map; keytran.map = keytran.parent = Vkey_translation_map; - /* If there is no translation-map, turn off scanning. */ - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; if (INTERACTIVE) { @@ -9486,8 +9497,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[t - 1] = new_key; mock_input = max (t, mock_input); - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; goto replay_sequence; } -- cgit v1.2.1 From 90b03d58966b9bb4f8de4f4b5fcbb24cec70b45a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 10 Aug 2006 06:07:15 +0000 Subject: * keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. --- src/keyboard.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index ae3b78b04d2..c715eadeb80 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,6 +100,9 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; +/* Nonzero if we are executing from the SIGIO signal handler. */ +int in_sighandler; + #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -6924,6 +6927,8 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif + in_sighandler = 1; + if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6935,6 +6940,7 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; + in_sighandler = 0; } #endif /* SIGIO */ @@ -10802,6 +10808,7 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; + in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ -- cgit v1.2.1 From 70282fce62e13117947dfb4151e93eeb60251d65 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 14 Aug 2006 18:32:23 +0000 Subject: * keyboard.c (read_char): Don't reset idle timers if a time limit is supplied. --- src/keyboard.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index c715eadeb80..bea35a05731 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,7 +2679,14 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - timer_start_idle (); + /* Start idle timers. If a time limit is supplied, we don't reset + idle timers. This avoids an infinite recursion in case an idle + timer calls `sit-for'. */ + + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); /* If in middle of key sequence and minibuffer not active, start echoing if enough time elapses. */ @@ -2879,7 +2886,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - timer_start_idle (); + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); -- cgit v1.2.1 From 3236e6b849ab228d0e0d466343f10b1202e1cf9d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 15 Aug 2006 17:39:21 +0000 Subject: * keyboard.c (read_char): Don't change idle timer state at all if end_time is supplied. --- src/keyboard.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index bea35a05731..fed6fbc79dd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,13 +2679,11 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - /* Start idle timers. If a time limit is supplied, we don't reset - idle timers. This avoids an infinite recursion in case an idle - timer calls `sit-for'. */ + /* Start idle timers if no time limit is supplied. We don't do it + if a time limit is supplied to avoid an infinite recursion in the + situation where an idle timer calls `sit-for'. */ - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); /* If in middle of key sequence and minibuffer not active, @@ -2756,7 +2754,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); /* Now that we have read an event, Emacs is not idle. */ - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); goto exit; } @@ -2886,9 +2885,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); @@ -2941,7 +2938,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) non_reread: - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); RESUME_POLLING; if (NILP (c)) @@ -2975,7 +2973,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) last_input_char = c; Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window)) + if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) /* We stopped being idle for this event; undo that. This prevents automatic window selection (under mouse_autoselect_window from acting as a real input event, for @@ -3181,7 +3179,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) show_help_echo (help, window, object, position, 0); /* We stopped being idle for this event; undo that. */ - timer_resume_idle (); + if (!end_time) + timer_resume_idle (); goto retry; } -- cgit v1.2.1 From ff458d812f881e04585bef6bdb96e3cd0ddd905d Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 20 Aug 2006 12:06:20 +0000 Subject: (Fcurrent_idle_time): New function. (syms_of_keyboard): defsubr it. --- src/keyboard.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index fed6fbc79dd..13ab5299982 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4543,6 +4543,35 @@ timer_check (do_it_now) UNGCPRO; return nexttime; } + +DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, + /* Return the current length of Emacs idleness. +The value is returned as a list of three integers. The first has the +most significant 16 bits of the seconds, while the second has the +least significant 16 bits. The third integer gives the microsecond +count. + +The microsecond count is zero on systems that do not provide +resolution finer than a second. */) + () +{ + EMACS_TIME now, idleness_now; + Lisp_Object result[3]; + + EMACS_GET_TIME (now); + if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) + { + EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); + + XSETINT (result[0], (EMACS_SECS (idleness_now) >> 16) & 0xffff); + XSETINT (result[1], (EMACS_SECS (idleness_now) >> 0) & 0xffff); + XSETINT (result[2], EMACS_USECS (idleness_now)); + + return Flist (3, result); + } + + return Qnil; +} /* Caches for modify_event_symbol. */ static Lisp_Object accent_key_syms; @@ -11131,6 +11160,7 @@ syms_of_keyboard () menu_bar_items_vector = Qnil; staticpro (&menu_bar_items_vector); + defsubr (&Scurrent_idle_time); defsubr (&Sevent_convert_list); defsubr (&Sread_key_sequence); defsubr (&Sread_key_sequence_vector); -- cgit v1.2.1 From c5b76d6cf7f35283aae93ef33b8dad1bdf13e085 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 20 Aug 2006 17:58:09 +0000 Subject: * keyboard.c (show_help_echo): Preserve mouse movement flag if tracking mouse. --- src/keyboard.c | 144 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 77 insertions(+), 67 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 13ab5299982..e4c17d5d43f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1390,6 +1390,72 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, return Qnil; } +#ifdef HAVE_MOUSE + +/* Restore mouse tracking enablement. See Ftrack_mouse for the only use + of this function. */ + +static Lisp_Object +tracking_off (old_value) + Lisp_Object old_value; +{ + do_mouse_tracking = old_value; + if (NILP (old_value)) + { + /* Redisplay may have been preempted because there was input + available, and it assumes it will be called again after the + input has been processed. If the only input available was + the sort that we have just disabled, then we need to call + redisplay. */ + if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) + { + redisplay_preserve_echo_area (6); + get_input_pending (&input_pending, + READABLE_EVENTS_DO_TIMERS_NOW); + } + } + return Qnil; +} + +DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, + doc: /* Evaluate BODY with mouse movement events enabled. +Within a `track-mouse' form, mouse motion generates input events that +you can read with `read-event'. +Normally, mouse motion is ignored. +usage: (track-mouse BODY ...) */) + (args) + Lisp_Object args; +{ + int count = SPECPDL_INDEX (); + Lisp_Object val; + + record_unwind_protect (tracking_off, do_mouse_tracking); + + do_mouse_tracking = Qt; + + val = Fprogn (args); + return unbind_to (count, val); +} + +/* If mouse has moved on some frame, return one of those frames. + Return 0 otherwise. */ + +static FRAME_PTR +some_mouse_moved () +{ + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + { + if (XFRAME (frame)->mouse_moved) + return XFRAME (frame); + } + + return 0; +} + +#endif /* HAVE_MOUSE */ + /* This is the actual command reading loop, sans error-handling encapsulation. */ @@ -2310,7 +2376,17 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) #ifdef HAVE_MOUSE if (!noninteractive && STRINGP (help)) - help = call1 (Qmouse_fixup_help_message, help); + { + /* The mouse-fixup-help-message Lisp function can call + mouse_position_hook, which resets the mouse_moved flags. + This causes trouble if we are trying to read a mouse motion + event (i.e., if we are inside a `track-mouse' form), so we + restore the mouse_moved flag. */ + FRAME_PTR f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved (); + help = call1 (Qmouse_fixup_help_message, help); + if (f) + f->mouse_moved = 1; + } #endif if (STRINGP (help) || NILP (help)) @@ -3464,72 +3540,6 @@ restore_getcjmp (temp) bcopy (temp, getcjmp, sizeof getcjmp); } -#ifdef HAVE_MOUSE - -/* Restore mouse tracking enablement. See Ftrack_mouse for the only use - of this function. */ - -static Lisp_Object -tracking_off (old_value) - Lisp_Object old_value; -{ - do_mouse_tracking = old_value; - if (NILP (old_value)) - { - /* Redisplay may have been preempted because there was input - available, and it assumes it will be called again after the - input has been processed. If the only input available was - the sort that we have just disabled, then we need to call - redisplay. */ - if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) - { - redisplay_preserve_echo_area (6); - get_input_pending (&input_pending, - READABLE_EVENTS_DO_TIMERS_NOW); - } - } - return Qnil; -} - -DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, - doc: /* Evaluate BODY with mouse movement events enabled. -Within a `track-mouse' form, mouse motion generates input events that -you can read with `read-event'. -Normally, mouse motion is ignored. -usage: (track-mouse BODY ...) */) - (args) - Lisp_Object args; -{ - int count = SPECPDL_INDEX (); - Lisp_Object val; - - record_unwind_protect (tracking_off, do_mouse_tracking); - - do_mouse_tracking = Qt; - - val = Fprogn (args); - return unbind_to (count, val); -} - -/* If mouse has moved on some frame, return one of those frames. - Return 0 otherwise. */ - -static FRAME_PTR -some_mouse_moved () -{ - Lisp_Object tail, frame; - - FOR_EACH_FRAME (tail, frame) - { - if (XFRAME (frame)->mouse_moved) - return XFRAME (frame); - } - - return 0; -} - -#endif /* HAVE_MOUSE */ - /* Low level keyboard/mouse input. kbd_buffer_store_event places events in kbd_buffer, and kbd_buffer_get_event retrieves them. */ -- cgit v1.2.1 From 748726f4d0afd75e639ab15ecef1c8ac62bf93f6 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 21 Aug 2006 02:09:31 +0000 Subject: (syms_of_keyboard): Docstring of Vunread_post_input_method_events and Vunread_input_method_events fixed. --- src/keyboard.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index e4c17d5d43f..72e6844d841 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11228,14 +11228,16 @@ These events are processed first, before actual keyboard input. */); DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events, doc: /* List of events to be processed as input by input methods. -These events are processed after `unread-command-events', but -before actual keyboard input. */); +These events are processed before `unread-command-events' +and actual keyboard input without given to `input-method-function'. */); Vunread_post_input_method_events = Qnil; DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, doc: /* List of events to be processed as input by input methods. These events are processed after `unread-command-events', but -before actual keyboard input. */); +before actual keyboard input. +If there's an active input method, the events are given to +`input-method-function'. */); Vunread_input_method_events = Qnil; DEFVAR_LISP ("meta-prefix-char", &meta_prefix_char, -- cgit v1.2.1 From 922fd3cb7b382fe0cd5cf48edc2f10f6a31bb0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 21 Aug 2006 12:54:47 +0000 Subject: Clarify difference between in_sighandler and handling_signal. --- src/keyboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 72e6844d841..0d13743f8b5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,7 +100,12 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; -/* Nonzero if we are executing from the SIGIO signal handler. */ +/* Nonzero if we are executing from the SIGIO signal handler. + The difference between in_sighandler and handling_signal is that + in_sighandler is only set when executing in a signal handler. + handling_signal may be set even if not executing in a signal handler, for + example when reinvoke_input_signal is called from UNBLOCK_INPUT, or + when Emacs is compiled with SYNC_INPUT defined. */ int in_sighandler; #ifdef HAVE_WINDOW_SYSTEM -- cgit v1.2.1 From 966949b00f0515e586645cee56d42a14dac4f9fc Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 25 Aug 2006 10:05:50 +0000 Subject: (Fcurrent_idle_time): Simplify. --- src/keyboard.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index 0d13743f8b5..abf57937966 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4570,19 +4570,16 @@ The microsecond count is zero on systems that do not provide resolution finer than a second. */) () { - EMACS_TIME now, idleness_now; - Lisp_Object result[3]; - - EMACS_GET_TIME (now); if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) { - EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); + EMACS_TIME now, idleness_now; - XSETINT (result[0], (EMACS_SECS (idleness_now) >> 16) & 0xffff); - XSETINT (result[1], (EMACS_SECS (idleness_now) >> 0) & 0xffff); - XSETINT (result[2], EMACS_USECS (idleness_now)); + EMACS_GET_TIME (now); + EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); - return Flist (3, result); + return list3 (make_number ((EMACS_SECS (idleness_now) >> 16) & 0xffff), + make_number ((EMACS_SECS (idleness_now) >> 0) & 0xffff), + make_number (EMACS_USECS (idleness_now))); } return Qnil; -- cgit v1.2.1 From cc4d4639cfd7491eafb5e2e815bf3bf6382e3d2f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:06 +0000 Subject: (in_sighandler): Remove variable. (Fcurrent_idle_time): Add missing `doc:'. (input_available_signal, init_keyboard): Undo previous change. --- src/keyboard.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index abf57937966..662aacf91a6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,14 +100,6 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; -/* Nonzero if we are executing from the SIGIO signal handler. - The difference between in_sighandler and handling_signal is that - in_sighandler is only set when executing in a signal handler. - handling_signal may be set even if not executing in a signal handler, for - example when reinvoke_input_signal is called from UNBLOCK_INPUT, or - when Emacs is compiled with SYNC_INPUT defined. */ -int in_sighandler; - #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -4560,7 +4552,7 @@ timer_check (do_it_now) } DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, - /* Return the current length of Emacs idleness. + doc: /* Return the current length of Emacs idleness. The value is returned as a list of three integers. The first has the most significant 16 bits of the seconds, while the second has the least significant 16 bits. The third integer gives the microsecond @@ -6977,8 +6969,6 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif - in_sighandler = 1; - if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6990,7 +6980,6 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; - in_sighandler = 0; } #endif /* SIGIO */ @@ -10858,7 +10847,6 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; - in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ -- cgit v1.2.1