diff options
| author | Jim Blandy | 1992-05-18 08:14:41 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-05-18 08:14:41 +0000 |
| commit | ffd56f97cf56501f7a6981c184192e9043e4eafd (patch) | |
| tree | d463f4585c85fa76b33d3663271bbb4126d7b116 /src/keyboard.c | |
| parent | 502ddf238f0ed280a301426804b2ed16ec1c49cc (diff) | |
| download | emacs-ffd56f97cf56501f7a6981c184192e9043e4eafd.tar.gz emacs-ffd56f97cf56501f7a6981c184192e9043e4eafd.zip | |
*** empty log message ***
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index e6139cfaf11..5b0d5facfc6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -43,6 +43,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 43 | 43 | ||
| 44 | #include "syssignal.h" | 44 | #include "syssignal.h" |
| 45 | #include "systerm.h" | 45 | #include "systerm.h" |
| 46 | #include "systime.h" | ||
| 46 | 47 | ||
| 47 | extern int errno; | 48 | extern int errno; |
| 48 | 49 | ||
| @@ -311,8 +312,9 @@ Lisp_Object Qmode_line; | |||
| 311 | Lisp_Object Qvertical_split; | 312 | Lisp_Object Qvertical_split; |
| 312 | 313 | ||
| 313 | 314 | ||
| 314 | /* Address (if not 0) of word to zero out if a SIGIO interrupt happens. */ | 315 | /* Address (if not 0) of EMACS_TIME to zero out if a SIGIO interrupt |
| 315 | long *input_available_clear_word; | 316 | happens. */ |
| 317 | EMACS_TIME *input_available_clear_time; | ||
| 316 | 318 | ||
| 317 | /* Nonzero means use SIGIO interrupts; zero means use CBREAK mode. | 319 | /* Nonzero means use SIGIO interrupts; zero means use CBREAK mode. |
| 318 | Default is 1 if INTERRUPT_INPUT is defined. */ | 320 | Default is 1 if INTERRUPT_INPUT is defined. */ |
| @@ -1160,8 +1162,7 @@ read_char (commandflag) | |||
| 1160 | XSET (Vlast_event_screen, Lisp_Screen, selected_screen); | 1162 | XSET (Vlast_event_screen, Lisp_Screen, selected_screen); |
| 1161 | #endif | 1163 | #endif |
| 1162 | 1164 | ||
| 1163 | waiting_for_input = 0; | 1165 | clear_waiting_for_input (); |
| 1164 | input_available_clear_word = 0; | ||
| 1165 | 1166 | ||
| 1166 | goto non_reread; | 1167 | goto non_reread; |
| 1167 | } | 1168 | } |
| @@ -1491,7 +1492,7 @@ kbd_buffer_store_event (event) | |||
| 1491 | will set Vlast_event_screen again, so this is safe to do. */ | 1492 | will set Vlast_event_screen again, so this is safe to do. */ |
| 1492 | extern SIGTYPE interrupt_signal (); | 1493 | extern SIGTYPE interrupt_signal (); |
| 1493 | XSET (Vlast_event_screen, Lisp_Screen, event->screen); | 1494 | XSET (Vlast_event_screen, Lisp_Screen, event->screen); |
| 1494 | last_event_timestamp = XINT (event->timestamp); | 1495 | last_event_timestamp = event->timestamp; |
| 1495 | interrupt_signal (); | 1496 | interrupt_signal (); |
| 1496 | return; | 1497 | return; |
| 1497 | } | 1498 | } |
| @@ -2237,8 +2238,8 @@ input_available_signal (signo) | |||
| 2237 | sigisheld (SIGIO); | 2238 | sigisheld (SIGIO); |
| 2238 | #endif | 2239 | #endif |
| 2239 | 2240 | ||
| 2240 | if (input_available_clear_word) | 2241 | if (input_available_clear_time) |
| 2241 | *input_available_clear_word = 0; | 2242 | EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); |
| 2242 | 2243 | ||
| 2243 | while (1) | 2244 | while (1) |
| 2244 | { | 2245 | { |
| @@ -2793,13 +2794,7 @@ Otherwise, that is done only if an arg is read using the minibuffer.") | |||
| 2793 | 2794 | ||
| 2794 | while (1) | 2795 | while (1) |
| 2795 | { | 2796 | { |
| 2796 | final = cmd; | 2797 | final = Findirect_function (cmd); |
| 2797 | while (XTYPE (final) == Lisp_Symbol) | ||
| 2798 | { | ||
| 2799 | if (EQ (Qunbound, XSYMBOL (final)->function)) | ||
| 2800 | Fsymbol_function (final); /* Get an error! */ | ||
| 2801 | final = XSYMBOL (final)->function; | ||
| 2802 | } | ||
| 2803 | 2798 | ||
| 2804 | if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload))) | 2799 | if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload))) |
| 2805 | do_autoload (final, cmd); | 2800 | do_autoload (final, cmd); |
| @@ -3012,6 +3007,14 @@ detect_input_pending () | |||
| 3012 | return input_pending; | 3007 | return input_pending; |
| 3013 | } | 3008 | } |
| 3014 | 3009 | ||
| 3010 | /* This is called in some cases before a possible quit. | ||
| 3011 | It cases the next call to detect_input_pending to recompute input_pending. | ||
| 3012 | So calling this function unnecessarily can't do any harm. */ | ||
| 3013 | clear_input_pending () | ||
| 3014 | { | ||
| 3015 | input_pending = 0; | ||
| 3016 | } | ||
| 3017 | |||
| 3015 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0, | 3018 | DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0, |
| 3016 | "T if command input is currently available with no waiting.\n\ | 3019 | "T if command input is currently available with no waiting.\n\ |
| 3017 | Actually, the value is nil only if we can be sure that no input is available.") | 3020 | Actually, the value is nil only if we can be sure that no input is available.") |
| @@ -3194,10 +3197,10 @@ stuff_buffered_input (stuffstring) | |||
| 3194 | #endif /* BSD and not BSD4_1 */ | 3197 | #endif /* BSD and not BSD4_1 */ |
| 3195 | } | 3198 | } |
| 3196 | 3199 | ||
| 3197 | set_waiting_for_input (word_to_clear) | 3200 | set_waiting_for_input (time_to_clear) |
| 3198 | long *word_to_clear; | 3201 | EMACS_TIME *time_to_clear; |
| 3199 | { | 3202 | { |
| 3200 | input_available_clear_word = word_to_clear; | 3203 | input_available_clear_time = time_to_clear; |
| 3201 | 3204 | ||
| 3202 | /* Tell interrupt_signal to throw back to read_char, */ | 3205 | /* Tell interrupt_signal to throw back to read_char, */ |
| 3203 | waiting_for_input = 1; | 3206 | waiting_for_input = 1; |
| @@ -3219,7 +3222,7 @@ clear_waiting_for_input () | |||
| 3219 | { | 3222 | { |
| 3220 | /* Tell interrupt_signal not to throw back to read_char, */ | 3223 | /* Tell interrupt_signal not to throw back to read_char, */ |
| 3221 | waiting_for_input = 0; | 3224 | waiting_for_input = 0; |
| 3222 | input_available_clear_word = 0; | 3225 | input_available_clear_time = 0; |
| 3223 | } | 3226 | } |
| 3224 | 3227 | ||
| 3225 | /* This routine is called at interrupt level in response to C-G. | 3228 | /* This routine is called at interrupt level in response to C-G. |