unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: raman <raman@google.com>
To: help-gnu-emacs@gnu.org
Subject: Re: X11 signal to emacs
Date: Sat, 01 Apr 2017 21:09:48 -0700	[thread overview]
Message-ID: <p91wpb330xf.fsf@raman-glaptop2> (raw)
In-Reply-To: yw.86o9wizkv6.fsf@zoho.com

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)

-- 




  reply	other threads:[~2017-04-02  4:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 20:19 X11 signal to emacs Perry Smith
2017-03-23 21:14 ` Dmitry Gutov
2017-03-23 21:32 ` John Mastro
2017-03-30 18:21 ` Emanuel Berg
2017-04-02  4:09   ` raman [this message]
2017-04-04  4:12     ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p91wpb330xf.fsf@raman-glaptop2 \
    --to=raman@google.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).