From: YAMAMOTO Mitsuharu Date: Thu, 31 Dec 2015 02:17:35 +0000 (+0900) Subject: Add handle_user_signal_hook X-Git-Tag: emacs-25.0.90~310 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/6ee327d8a10047c1717358cc179ed8d1fb3389eb Add handle_user_signal_hook * src/keyboard.h (handle_user_signal_hook): New declaration. * src/keyboard.c (handle_user_signal_hook): New variable. (handle_user_signal): Call it. --- diff --git a/src/keyboard.c b/src/keyboard.c index 9ebd86b535..b0fe328dbd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -7124,6 +7124,9 @@ struct user_signal_info /* List of user signals. */ static struct user_signal_info *user_signals = NULL; +/* Function called when handling user signals. */ +void (*handle_user_signal_hook) (int); + void add_user_signal (int sig, const char *name) { @@ -7172,6 +7175,8 @@ handle_user_signal (int sig) } p->npending++; + if (handle_user_signal_hook) + (*handle_user_signal_hook) (sig); #ifdef USABLE_SIGIO if (interrupt_input) handle_input_available_signal (sig); diff --git a/src/keyboard.h b/src/keyboard.h index 890d24eb2d..4558bd6141 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -415,6 +415,8 @@ extern void unuse_menu_items (void); #define EVENT_HEAD_KIND(event_head) \ (Fget ((event_head), Qevent_kind)) +extern void (*handle_user_signal_hook) (int); + /* True while doing kbd input. */ extern bool waiting_for_input;