[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: X11 signal to emacs
From: |
raman |
Subject: |
Re: X11 signal to emacs |
Date: |
Sat, 01 Apr 2017 21:09:48 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Emanuel Berg <moasen@zoho.com> writes:
This is nice. Is there some X magic that will let me combine
special-event-map with something else that then lets me bind an action
to a simple press of say the ctrl-key?
Today, ctrl is a modifier -- but pressing ctrl by itself does nothing
in emacs. If I could achieve the above, then I'd get 3 more keys: ctrl,
alt, and the windows key.
> 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)
--
- Re: X11 signal to emacs,
raman <=