comparison src/keyboard.c @ 90054:f2ebccfa87d4

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-74 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-709 Update from CVS: src/indent.c (Fvertical_motion): Fix last change. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-710 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-715 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-74 Update from CVS
author Miles Bader <miles@gnu.org>
date Wed, 08 Dec 2004 05:02:30 +0000
parents b637c617432f 9f7c2511d457
children fb79180b618d
comparison
equal deleted inserted replaced
90053:fff5f1a61d92 90054:f2ebccfa87d4
43 #include "systime.h" 43 #include "systime.h"
44 #include "atimer.h" 44 #include "atimer.h"
45 #include <setjmp.h> 45 #include <setjmp.h>
46 #include <errno.h> 46 #include <errno.h>
47 47
48 #ifdef HAVE_GTK_AND_PTHREAD
49 #include <pthread.h>
50 #endif
48 #ifdef MSDOS 51 #ifdef MSDOS
49 #include "msdos.h" 52 #include "msdos.h"
50 #include <time.h> 53 #include <time.h>
51 #else /* not MSDOS */ 54 #else /* not MSDOS */
52 #ifndef VMS 55 #ifndef VMS
605 #undef FIONREAD 608 #undef FIONREAD
606 #endif 609 #endif
607 610
608 /* We are unable to use interrupts if FIONREAD is not available, 611 /* We are unable to use interrupts if FIONREAD is not available,
609 so flush SIGIO so we won't try. */ 612 so flush SIGIO so we won't try. */
610 #if !defined (FIONREAD) || defined(HAVE_CARBON) 613 #if !defined (FIONREAD)
611 #ifdef SIGIO 614 #ifdef SIGIO
612 #undef SIGIO 615 #undef SIGIO
613 #endif 616 #endif
614 #endif 617 #endif
615 618
1616 already_adjusted = 0; 1619 already_adjusted = 0;
1617 1620
1618 if (NILP (Vthis_command)) 1621 if (NILP (Vthis_command))
1619 { 1622 {
1620 /* nil means key is undefined. */ 1623 /* nil means key is undefined. */
1624 Lisp_Object keys = Fvector (i, keybuf);
1625 keys = Fkey_description (keys, Qnil);
1621 bitch_at_user (); 1626 bitch_at_user ();
1627 message_with_string ("%s is undefined", keys, 0);
1622 current_kboard->defining_kbd_macro = Qnil; 1628 current_kboard->defining_kbd_macro = Qnil;
1623 update_mode_lines = 1; 1629 update_mode_lines = 1;
1624 current_kboard->Vprefix_arg = Qnil; 1630 current_kboard->Vprefix_arg = Qnil;
1625 } 1631 }
1626 else 1632 else
6771 handle_async_input () 6777 handle_async_input ()
6772 { 6778 {
6773 #ifdef BSD4_1 6779 #ifdef BSD4_1
6774 extern int select_alarmed; 6780 extern int select_alarmed;
6775 #endif 6781 #endif
6782 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
6783 extern pthread_t main_thread;
6784 if (pthread_self () != main_thread)
6785 {
6786 /* POSIX says any thread can receive the signal. On GNU/Linux that is
6787 not true, but for other systems (FreeBSD at least) it is. So direct
6788 the signal to the correct thread and block it from this thread. */
6789 #ifdef SIGIO
6790 sigset_t new_mask;
6791
6792 sigemptyset (&new_mask);
6793 sigaddset (&new_mask, SIGIO);
6794 pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6795 pthread_kill (main_thread, SIGIO);
6796 #endif
6797 return;
6798 }
6799 #endif
6800
6776 interrupt_input_pending = 0; 6801 interrupt_input_pending = 0;
6777 6802
6778 while (1) 6803 while (1)
6779 { 6804 {
6780 int nread; 6805 int nread;
6798 input_available_signal (signo) 6823 input_available_signal (signo)
6799 int signo; 6824 int signo;
6800 { 6825 {
6801 /* Must preserve main program's value of errno. */ 6826 /* Must preserve main program's value of errno. */
6802 int old_errno = errno; 6827 int old_errno = errno;
6803 6828 #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
6829 extern pthread_t main_thread;
6830 if (pthread_self () != main_thread)
6831 {
6832 /* POSIX says any thread can receive the signal. On GNU/Linux that is
6833 not true, but for other systems (FreeBSD at least) it is. So direct
6834 the signal to the correct thread and block it from this thread. */
6835 sigset_t new_mask;
6836
6837 sigemptyset (&new_mask);
6838 sigaddset (&new_mask, SIGIO);
6839 pthread_sigmask (SIG_BLOCK, &new_mask, 0);
6840 pthread_kill (main_thread, SIGIO);
6841 return;
6842 }
6843 #endif /* HAVE_GTK_AND_PTHREAD */
6804 #if defined (USG) && !defined (POSIX_SIGNALS) 6844 #if defined (USG) && !defined (POSIX_SIGNALS)
6805 /* USG systems forget handlers when they are used; 6845 /* USG systems forget handlers when they are used;
6806 must reestablish each time */ 6846 must reestablish each time */
6807 signal (signo, input_available_signal); 6847 signal (signo, input_available_signal);
6808 #endif /* USG */ 6848 #endif /* USG */