help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: execute defun on reception of signal


From: Emanuel Berg
Subject: Re: execute defun on reception of signal
Date: Tue, 14 Jul 2015 04:07:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Emanuel Berg <embe8573@student.uu.se> writes:

> Oh, yeah? And what is the ratio for questions asked
> and replies bounced back on this list?

Regardless of whatever, here is the code (and some
testers) to solve the original problem, mentioned in
the original post, by the original poster (yours
truly):

    (defun signal-usr1-f ()
      (interactive)
      (message "Got signal: USR1") )

    (define-key special-event-map [sigusr1] 'signal-usr1-f)

    ;; test:   (signal-process (emacs-pid) 'sigusr1)
    ;;
    ;; shell:  kill -s usr1 `ps -e | grep emacs | cut -d " " -f 2`

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]