all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* X11 signal to emacs
@ 2017-03-23 20:19 Perry Smith
  2017-03-23 21:14 ` Dmitry Gutov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Perry Smith @ 2017-03-23 20:19 UTC (permalink / raw)
  To: Emacs Help

I'm on AIX but lets assume I'm on a "normal" platform because I'm hoping it
will be the same.

I'm using emacs (25.1) as an X11 client.

Right now, for some reason, my emacs gets stuck.  What I'd like to do is
send it a signal from a separate terminal.  I can do that but in all cases,
emacs just exits.  I've tried SIGHUP, SIGINT, and SIGTERM.

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.

Thank you,
Perry


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: X11 signal to emacs
  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
  2 siblings, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2017-03-23 21:14 UTC (permalink / raw)
  To: Perry Smith, Emacs Help

On 23.03.2017 22:19, Perry Smith wrote:

> Right now, for some reason, my emacs gets stuck.  What I'd like to do is
> send it a signal from a separate terminal.  I can do that but in all cases,
> emacs just exits.  I've tried SIGHUP, SIGINT, and SIGTERM.

SIGUSR2 should do it. See also its mention in etc/DEBUG.

Not sure what "X11 signal" means; I send signals with 'kill': 
http://emacs.stackexchange.com/questions/506/debugging-a-frozen-emacs/649#649



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: X11 signal to emacs
  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
  2 siblings, 0 replies; 6+ messages in thread
From: John Mastro @ 2017-03-23 21:32 UTC (permalink / raw)
  To: Emacs Help; +Cc: Perry Smith

Perry Smith <pedz@easesoftware.com> wrote:
> I'm on AIX but lets assume I'm on a "normal" platform because I'm hoping it
> will be the same.
>
> I'm using emacs (25.1) as an X11 client.
>
> Right now, for some reason, my emacs gets stuck.  What I'd like to do is
> send it a signal from a separate terminal.  I can do that but in all cases,
> emacs just exits.  I've tried SIGHUP, SIGINT, and SIGTERM.
>
> 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.

Try sending SIGUSR2, which instructs Emacs to try to break out of its
current loop and into the Lisp debugger.

        John



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: X11 signal to emacs
  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
  2 siblings, 1 reply; 6+ messages in thread
From: Emanuel Berg @ 2017-03-30 18:21 UTC (permalink / raw)
  To: help-gnu-emacs

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                    




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: X11 signal to emacs
  2017-03-30 18:21 ` Emanuel Berg
@ 2017-04-02  4:09   ` raman
  2017-04-04  4:12     ` Emanuel Berg
  0 siblings, 1 reply; 6+ messages in thread
From: raman @ 2017-04-02  4:09 UTC (permalink / raw)
  To: help-gnu-emacs

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)

-- 




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: X11 signal to emacs
  2017-04-02  4:09   ` raman
@ 2017-04-04  4:12     ` Emanuel Berg
  0 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2017-04-04  4:12 UTC (permalink / raw)
  To: help-gnu-emacs

raman wrote:

> 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?

Hang on a second, X? Now I see, it even says
X11 in the subject. X11 is the protocol for X.
Do they have signals of their own?!

My answer has nothing to do with X or X11, it
is plain Unix IPC, just two processes
signalling each other...

> 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.

Cool idea, cred if you succeed. But in general,
one doesn't need more keys. It is doing
something sensible with the ones you got that's
the trick :)

-- 
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                    




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-04  4:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2017-04-04  4:12     ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.