[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lispref/commands.texi,v
From: |
Kim F. Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lispref/commands.texi,v |
Date: |
Tue, 19 Dec 2006 15:38:08 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Changes by: Kim F. Storm <kfstorm> 06/12/19 15:38:08
Index: commands.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/lispref/commands.texi,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- commands.texi 4 Dec 2006 12:30:20 -0000 1.97
+++ commands.texi 19 Dec 2006 15:38:08 -0000 1.98
@@ -1586,14 +1586,33 @@
parameters are used to display the help-echo text are described in
@ref{Text help-echo}.
address@hidden @code{signal usr1} event
address@hidden @code{signal usr2} event
address@hidden @code{sigusr1} event
address@hidden @code{sigusr2} event
@cindex user signals
address@hidden signal usr1
address@hidden signal usr2
-These event sequences are generated when the Emacs process receives
address@hidden sigusr1
address@hidden sigusr2
+These events are generated when the Emacs process receives
the signals @code{SIGUSR1} and @code{SIGUSR2}. They contain no
additional data because signals do not carry additional information.
+
+To catch a user signal, bind the corresponding event to an interactive
+command in the @code{special-event-map} (@pxref{Active Keymaps}).
+The command is called with no arguments, and the specific signal event is
+available in @code{last-input-event}. For example:
+
address@hidden
+(defun sigusr-handler ()
+ (interactive)
+ (message "Caught signal %S" last-input-event))
+
+(define-key special-event-map [sigusr1] 'sigusr-handler)
address@hidden example
+
+To test the signal handler, you can make Emacs send a signal to itself:
+
address@hidden
+(signal-process (emacs-pid) 'sigusr1)
address@hidden example
@end table
If one of these events arrives in the middle of a key sequence---that
@@ -2634,8 +2653,9 @@
after they are read, and this is the way for the event's definition to
find the actual event.
-The events types @code{iconify-frame}, @code{make-frame-visible} and
address@hidden are normally handled in this way. The keymap which
+The events types @code{iconify-frame}, @code{make-frame-visible},
address@hidden, @code{drag-n-drop}, and user signals like
address@hidden are normally handled in this way. The keymap which
defines how to handle special events---and which events are special---is
in the variable @code{special-event-map} (@pxref{Active Keymaps}).