Mercurial > emacs
diff src/keyboard.c @ 83237:4ee39d9428b0
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-726
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-727
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-728
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-729
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-730
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-731
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733
Update from CVS: man/calc.texi: Fix some TeX definitions.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-735
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-736
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-737
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-738
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-739
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-740
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-741
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-742
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-743
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-744
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-745
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-746
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-277
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Thu, 23 Dec 2004 16:43:51 +0000 |
parents | 5e454dd0d649 e108ef5b9044 |
children | 223c12363c0c |
line wrap: on
line diff
--- a/src/keyboard.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/keyboard.c Thu Dec 23 16:43:51 2004 +0000 @@ -3038,6 +3038,7 @@ /* Save the echo status. */ int saved_immediate_echo = current_kboard->immediate_echo; struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; + Lisp_Object saved_echo_string = current_kboard->echo_string; int saved_echo_after_prompt = current_kboard->echo_after_prompt; #if 0 @@ -3092,6 +3093,7 @@ cancel_echoing (); ok_to_echo_at_next_pause = saved_ok_to_echo; + current_kboard->echo_string = saved_echo_string; current_kboard->echo_after_prompt = saved_echo_after_prompt; if (saved_immediate_echo) echo_now (); @@ -3574,6 +3576,9 @@ } #endif + +Lisp_Object Vthrow_on_input; + /* Store an event obtained at interrupt level into kbd_buffer, fifo */ void @@ -3699,6 +3704,24 @@ *kbd_store_ptr = *event; ++kbd_store_ptr; } + + /* If we're inside while-no-input, and this event qualifies + as input, set quit-flag to cause an interrupt. */ + if (!NILP (Vthrow_on_input) + && event->kind != FOCUS_IN_EVENT + && event->kind != HELP_EVENT + && event->kind != DEICONIFY_EVENT) + { + Vquit_flag = Vthrow_on_input; + /* If we're inside a function that wants immediate quits, + do it now. */ + if (immediate_quit && NILP (Vinhibit_quit)) + { + immediate_quit = 0; + sigfree (); + QUIT; + } + } } @@ -6849,24 +6872,6 @@ #ifdef BSD4_1 extern int select_alarmed; #endif -#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) - extern pthread_t main_thread; - if (pthread_self () != main_thread) - { - /* POSIX says any thread can receive the signal. On GNU/Linux that is - not true, but for other systems (FreeBSD at least) it is. So direct - the signal to the correct thread and block it from this thread. */ -#ifdef SIGIO - sigset_t new_mask; - - sigemptyset (&new_mask); - sigaddset (&new_mask, SIGIO); - pthread_sigmask (SIG_BLOCK, &new_mask, 0); - pthread_kill (main_thread, SIGIO); -#endif - return; - } -#endif interrupt_input_pending = 0; @@ -6895,22 +6900,6 @@ { /* Must preserve main program's value of errno. */ int old_errno = errno; -#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) - extern pthread_t main_thread; - if (pthread_self () != main_thread) - { - /* POSIX says any thread can receive the signal. On GNU/Linux that is - not true, but for other systems (FreeBSD at least) it is. So direct - the signal to the correct thread and block it from this thread. */ - sigset_t new_mask; - - sigemptyset (&new_mask); - sigaddset (&new_mask, SIGIO); - pthread_sigmask (SIG_BLOCK, &new_mask, 0); - pthread_kill (main_thread, SIGIO); - return; - } -#endif /* HAVE_GTK_AND_PTHREAD */ #if defined (USG) && !defined (POSIX_SIGNALS) /* USG systems forget handlers when they are used; must reestablish each time */ @@ -6927,6 +6916,8 @@ #ifdef SYNC_INPUT interrupt_input_pending = 1; #else + + SIGNAL_THREAD_CHECK (signo); handle_async_input (); #endif @@ -10379,6 +10370,7 @@ char c; struct frame *sf = SELECTED_FRAME (); + SIGNAL_THREAD_CHECK (signalnum); cancel_echoing (); /* XXX This code needs to be revised for multi-tty support. */ @@ -11525,6 +11517,12 @@ doc: /* *How long to display an echo-area message when the minibuffer is active. If the value is not a number, such messages don't time out. */); Vminibuffer_message_timeout = make_number (2); + + DEFVAR_LISP ("throw-on-input", &Vthrow_on_input, + doc: /* If non-nil, any keyboard input throws to this symbol. +The value of that variable is passed to `quit-flag' and later causes a +peculiar kind of quitting. */); + Vthrow_on_input = Qnil; } void