From: Mike Crowe <mac@mcrowe.com>
To: Emacs Developers <emacs-devel@gnu.org>
Cc: Mike Crowe <mac@mcrowe.com>
Subject: [PATCH] Re-enable SIGIO when waiting for events
Date: Sat, 11 Jul 2015 12:58:00 +0100 [thread overview]
Message-ID: <1436615880-1719-1-git-send-email-mac@mcrowe.com> (raw)
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
next reply other threads:[~2015-07-11 11:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-11 11:58 Mike Crowe [this message]
2015-07-17 8:45 ` [PATCH] Re-enable SIGIO when waiting for events 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
2015-09-13 19:14 ` bug#16737: " Alan D. Salewski
2015-07-31 6:03 ` bug#16737: [PATCH] Re-enable SIGIO when waiting for events Alex Bennée
2015-07-30 18:49 ` Tassilo Horn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436615880-1719-1-git-send-email-mac@mcrowe.com \
--to=mac@mcrowe.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.