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

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

Re: X11 signal to emacs


From: Emanuel Berg
Subject: Re: X11 signal to emacs
Date: Thu, 30 Mar 2017 20:21:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Perry Smith wrote:

> Is there a way to send a signal to emacs that
> emacs will catch and get out of whatever loop
> it might be in at the time? So far, I have
> not been able to find a method to do that.

Evaluate these, then evaluate the commented-out
in-Emacs test or run the shell command. (If you
are a bash user syntax may vary slightly.)

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

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

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

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 69 Blogomatic articles -                   
                with: #moasen @ irc.freenode.net 6667                    




reply via email to

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