changeset 74409:b3bb05fc3e6a

(Misc Events): Update signal events. (Event Examples): Add signal example.
author Kim F. Storm <storm@cua.dk>
date Mon, 04 Dec 2006 12:30:20 +0000
parents 4c44b86a628e
children ae98808fc6e4
files lispref/commands.texi
diffstat 1 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lispref/commands.texi	Mon Dec 04 12:27:09 2006 +0000
+++ b/lispref/commands.texi	Mon Dec 04 12:30:20 2006 +0000
@@ -1586,13 +1586,14 @@
 parameters are used to display the help-echo text are described in
 @ref{Text help-echo}.
 
-@cindex @code{usr1-signal} event
-@cindex @code{usr2-signal} event
-@item usr1-signal
-@itemx usr2-signal
-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.
+@cindex @code{signal usr1} event
+@cindex @code{signal usr2} event
+@cindex user signals
+@item signal usr1
+@itemx signal usr2
+These event sequences 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.
 @end table
 
   If one of these events arrives in the middle of a key sequence---that
@@ -1632,6 +1633,16 @@
                    -453816))
 @end smallexample
 
+To handle a SIGUSR1 signal, define an interactive function, and
+bind it to the @code{signal usr1} event sequence:
+
+@smallexample
+(defun usr1-handler ()
+  (interactive)
+  (message "Got USR1 signal"))
+(global-set-key [signal usr1] 'usr1-handler)
+@end smallexample
+
 @node Classifying Events
 @subsection Classifying Events
 @cindex event type