From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Moreton Newsgroups: gmane.emacs.help Subject: Re: execute defun on reception of signal Date: Sun, 12 Jul 2015 11:27:24 +0100 Message-ID: <86r3odvfg3.fsf@gmail.com> References: <871tgedtkv.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1436696880 30420 80.91.229.3 (12 Jul 2015 10:28:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2015 10:28:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 12 12:27:51 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZEEUA-0001k8-Sn for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Jul 2015 12:27:51 +0200 Original-Received: from localhost ([::1]:50172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEEUA-0003tV-0W for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Jul 2015 06:27:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEETz-0003tP-T5 for help-gnu-emacs@gnu.org; Sun, 12 Jul 2015 06:27:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEETs-0004y1-Rh for help-gnu-emacs@gnu.org; Sun, 12 Jul 2015 06:27:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEETs-0004xu-Kv for help-gnu-emacs@gnu.org; Sun, 12 Jul 2015 06:27:32 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZEETr-0001bi-6M for help-gnu-emacs@gnu.org; Sun, 12 Jul 2015 12:27:31 +0200 Original-Received: from 82-69-64-228.dsl.in-addr.zen.co.uk ([82.69.64.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 12 Jul 2015 12:27:31 +0200 Original-Received: from andrewjmoreton by 82-69-64-228.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 12 Jul 2015 12:27:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 82-69-64-228.dsl.in-addr.zen.co.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) Cancel-Lock: sha1:6FzBbqE2HLlgnHzKRyBavz/nKTk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105626 Archived-At: On Sun 12 Jul 2015, Emanuel Berg wrote: > I read somewhere you can do it like this: > > (defun usr1-handler () > (interactive) > (message "Got usr1 signal.")) > > (global-set-key [signal usr1] 'usr1-handler) > > However if the Emacs PID is 2592, > > $ kill -s usr1 2592 > > doesn't do it. This is documented in the info "(elisp) Misc Events" node, which you could have easily found yourself. The documentation includes an example which shows you are using the wrong keymap. AndyM