unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Re-enable SIGIO when waiting for events
@ 2015-07-11 11:58 Mike Crowe
  2015-07-17  8:45 ` Alex Bennée
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Crowe @ 2015-07-11 11:58 UTC (permalink / raw)
  To: Emacs Developers; +Cc: Mike Crowe

Pasting a large string into an Emacs tty frame causes
keyboard.c:kbd_buffer_store_buffered_event to call ignore_sigio()
which sets SIGIO to SIG_IGN.

Unfortunately no-one seems to ever re-enable the SIGIO handler.

This leads to timeouts when attempting to paste into an Emacs X11
frame as reported at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16737 .

It appears that keyboard.c:kbd_buffer_get_event used to re-enable the
signal handler but that was removed as part of a large signal-handling
clean up in 4d7e6e51dd4acecff466a28d958c50f34fc130b8.

Reinstating the re-enabling of SIGIO in kbd_buffer_get_event solves
the problems reported in bug 16737 for me.

* src/keyboard.c (kbd_buffer_get_event): Re-enable SIGIO when waiting
  for event.
---
 src/keyboard.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/keyboard.c b/src/keyboard.c
index c5a392f..e710d5a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -316,6 +316,8 @@ static Lisp_Object command_loop (void);
 static void echo_now (void);
 static ptrdiff_t echo_length (void);
 
+static void deliver_input_available_signal (int sig);
+
 /* Incremented whenever a timer is run.  */
 unsigned timers_run;
 
@@ -3849,6 +3851,14 @@ kbd_buffer_get_event (KBOARD **kbp,
       /* Start reading input again because we have processed enough to
          be able to accept new events again.  */
       unhold_keyboard_input ();
+#ifdef USABLE_SIGIO
+      if (!noninteractive)
+       {
+         struct sigaction action;
+         emacs_sigaction_init (&action, deliver_input_available_signal);
+         sigaction (SIGIO, &action, 0);
+       }
+#endif
       start_polling ();
     }
 #endif	/* subprocesses */
-- 
2.1.4




^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-09-13 18:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-11 11:58 [PATCH] Re-enable SIGIO when waiting for events Mike Crowe
2015-07-17  8:45 ` Alex Bennée
2015-07-17  8:50   ` Tassilo Horn
2015-07-17 19:00     ` Paul Eggert
2015-07-21 12:42       ` Mike Crowe
2015-07-30 16:31         ` Mike Crowe
2015-07-30 18:49           ` Tassilo Horn
2015-07-31  6:03             ` Alex Bennée
2015-08-05 14:28               ` Mike Crowe
2015-08-05 17:46                 ` Paul Eggert
2015-09-13 18:57                   ` [PATCH] Re-enable SIGIO when waiting for events (bug# 16737) Alan D. Salewski

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).