Mercurial > emacs
comparison src/keyboard.c @ 83252:6e0f153725ab
Fix compilation error with GTK, fix issues with double C-g on controlling tty. (Reported by Friedrich Delgado Friedrichs, Yoshiaki Kasahara.)
* src/keyboard.c (interrupt_signal, handle_interrupt): Move thread check
to interrupt_signal. Check for frame on controlling tty instead of
current selected frame in handle_interrupt.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-292
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 12 Feb 2005 15:11:25 +0000 |
parents | 3dcba0bc766b |
children | c0215e820840 |
comparison
equal
deleted
inserted
replaced
83251:de637975e99a | 83252:6e0f153725ab |
---|---|
10305 input_available_clear_time = 0; | 10305 input_available_clear_time = 0; |
10306 } | 10306 } |
10307 | 10307 |
10308 /* The SIGINT handler. | 10308 /* The SIGINT handler. |
10309 | 10309 |
10310 If we have a frame on the controlling tty, the SIGINT was generated | 10310 If we have a frame on the controlling tty, we assume that the |
10311 by C-g, so we call handle_interrupt. Otherwise, the handler kills | 10311 SIGINT was generated by C-g, so we call handle_interrupt. |
10312 Emacs. */ | 10312 Otherwise, the handler kills Emacs. */ |
10313 | 10313 |
10314 static SIGTYPE | 10314 static SIGTYPE |
10315 interrupt_signal (signalnum) /* If we don't have an argument, */ | 10315 interrupt_signal (signalnum) /* If we don't have an argument, */ |
10316 int signalnum; /* some compilers complain in signal calls. */ | 10316 int signalnum; /* some compilers complain in signal calls. */ |
10317 { | 10317 { |
10324 must reestablish each time */ | 10324 must reestablish each time */ |
10325 signal (SIGINT, interrupt_signal); | 10325 signal (SIGINT, interrupt_signal); |
10326 signal (SIGQUIT, interrupt_signal); | 10326 signal (SIGQUIT, interrupt_signal); |
10327 #endif /* USG */ | 10327 #endif /* USG */ |
10328 | 10328 |
10329 SIGNAL_THREAD_CHECK (signalnum); | |
10330 | |
10329 /* See if we have an active display on our controlling terminal. */ | 10331 /* See if we have an active display on our controlling terminal. */ |
10330 display = get_named_tty_display (NULL); | 10332 display = get_named_tty_display (NULL); |
10331 if (!display) | 10333 if (!display) |
10332 { | 10334 { |
10333 /* If there are no frames there, let's pretend that we are a | 10335 /* If there are no frames there, let's pretend that we are a |
10363 | 10365 |
10364 static void | 10366 static void |
10365 handle_interrupt () | 10367 handle_interrupt () |
10366 { | 10368 { |
10367 char c; | 10369 char c; |
10368 struct frame *sf = SELECTED_FRAME (); | 10370 |
10369 | |
10370 SIGNAL_THREAD_CHECK (signalnum); | |
10371 cancel_echoing (); | 10371 cancel_echoing (); |
10372 | 10372 |
10373 /* XXX This code needs to be revised for multi-tty support. */ | 10373 /* XXX This code needs to be revised for multi-tty support. */ |
10374 if (!NILP (Vquit_flag) | 10374 if (!NILP (Vquit_flag) |
10375 && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))) | 10375 #ifndef MSDOS |
10376 && get_named_tty_display (NULL) | |
10377 #endif | |
10378 ) | |
10376 { | 10379 { |
10377 /* If SIGINT isn't blocked, don't let us be interrupted by | 10380 /* If SIGINT isn't blocked, don't let us be interrupted by |
10378 another SIGINT, it might be harmful due to non-reentrancy | 10381 another SIGINT, it might be harmful due to non-reentrancy |
10379 in I/O functions. */ | 10382 in I/O functions. */ |
10380 sigblock (sigmask (SIGINT)); | 10383 sigblock (sigmask (SIGINT)); |