aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1999-02-19 01:34:48 +0000
committerRichard M. Stallman1999-02-19 01:34:48 +0000
commit5bda49c640132d7eb25c4aa047b895622f3a4ff0 (patch)
tree77ebd737cb06047c8b834e57daac6930858ffc76 /src
parent7cc45a35b1aea566175263f16924a4304536810a (diff)
downloademacs-5bda49c640132d7eb25c4aa047b895622f3a4ff0.tar.gz
emacs-5bda49c640132d7eb25c4aa047b895622f3a4ff0.zip
(Qusr1_signal, Qusr2_signal): New variables.
(syms_of_emacs): Init and staticpro them. (handle_USR1_signal): Don't run any code, just queue up an event. (handle_USR2_signal): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 885b7c8d6fd..bda8070fa5d 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA. */
45#include "blockinput.h" 45#include "blockinput.h"
46#include "syssignal.h" 46#include "syssignal.h"
47#include "process.h" 47#include "process.h"
48#include "termhooks.h"
48#include "keyboard.h" 49#include "keyboard.h"
49 50
50#ifdef HAVE_SETRLIMIT 51#ifdef HAVE_SETRLIMIT
@@ -116,6 +117,8 @@ Lisp_Object Vsystem_configuration_options;
116 117
117Lisp_Object Qfile_name_handler_alist; 118Lisp_Object Qfile_name_handler_alist;
118 119
120Lisp_Object Qusr1_signal, Qusr2_signal;
121
119/* If non-zero, emacs should not attempt to use an window-specific code, 122/* If non-zero, emacs should not attempt to use an window-specific code,
120 but instead should use the virtual terminal under which it was started */ 123 but instead should use the virtual terminal under which it was started */
121int inhibit_window_system; 124int inhibit_window_system;
@@ -180,40 +183,38 @@ int fatal_error_code;
180int fatal_error_in_progress; 183int fatal_error_in_progress;
181 184
182#ifdef SIGUSR1 185#ifdef SIGUSR1
183int SIGUSR1_in_progress=0;
184SIGTYPE 186SIGTYPE
185handle_USR1_signal (sig) 187handle_USR1_signal (sig)
186 int sig; 188 int sig;
187{ 189{
188 if (! SIGUSR1_in_progress) 190 struct input_event buf;
189 { 191
190 SIGUSR1_in_progress = 1; 192 buf.kind = non_ascii_keystroke;
191 193 buf.code = Qusr1_signal;
192 if (!NILP (Vrun_hooks) && !noninteractive) 194 buf.frame_or_window = Fselected_frame ();
193 call1 (Vrun_hooks, intern ("signal-USR1-hook")); 195 buf.modifiers = 0;
194 196 buf.timestamp = 0;
195 SIGUSR1_in_progress = 0; 197
196 } 198 kbd_buffer_store_event (&buf);
197} 199}
200#endif /* SIGUSR1 */
198 201
199#ifdef SIGUSR2 202#ifdef SIGUSR2
200int SIGUSR2_in_progress=0;
201SIGTYPE 203SIGTYPE
202handle_USR2_signal (sig) 204handle_USR2_signal (sig)
203 int sig; 205 int sig;
204{ 206{
205 if (! SIGUSR2_in_progress) 207 struct input_event buf;
206 { 208
207 SIGUSR2_in_progress = 1; 209 buf.kind = non_ascii_keystroke;
208 210 buf.code = Qusr2_signal;
209 if (!NILP (Vrun_hooks) && !noninteractive) 211 buf.frame_or_window = Fselected_frame ();
210 call1 (Vrun_hooks, intern ("signal-USR2-hook")); 212 buf.modifiers = 0;
211 213 buf.timestamp = 0;
212 SIGUSR2_in_progress = 0; 214
213 } 215 kbd_buffer_store_event (&buf);
214} 216}
215#endif 217#endif /* SIGUSR2 */
216#endif
217 218
218/* Handle bus errors, illegal instruction, etc. */ 219/* Handle bus errors, illegal instruction, etc. */
219SIGTYPE 220SIGTYPE
@@ -1859,6 +1860,11 @@ syms_of_emacs ()
1859 Qfile_name_handler_alist = intern ("file-name-handler-alist"); 1860 Qfile_name_handler_alist = intern ("file-name-handler-alist");
1860 staticpro (&Qfile_name_handler_alist); 1861 staticpro (&Qfile_name_handler_alist);
1861 1862
1863 Qusr1_signal = intern ("usr1-signal");
1864 staticpro (&Qusr1_signal);
1865 Qusr2_signal = intern ("usr2-signal");
1866 staticpro (&Qusr2_signal);
1867
1862#ifndef CANNOT_DUMP 1868#ifndef CANNOT_DUMP
1863#ifdef HAVE_SHM 1869#ifdef HAVE_SHM
1864 defsubr (&Sdump_emacs_data); 1870 defsubr (&Sdump_emacs_data);