2

The documentation quoted in this answer mentions two different way of installing a handler for a SIGUSR1 signal, namely:

(define-key special-event-map [sigusr1] 'sigusr1-handler)

and

(global-set-key [signal usr1] 'sigusr1-handler)

(I changed the names of the handlers in the snippets above to make them both the same.)

Could someone explain when and why one would choose one of these approaches over the other?

kjo
  • 3,247
  • 17
  • 48

1 Answers1

2

Could someone explain when and why one would choose one of these approaches over the other?

Use the 1st one.

See bug#65577:

Eli Zaretskii:

Stefan, it sounds like the ... example is some left-over from old handling of signals?

Stefan Monnier:

Something like that, yes.

Eli Zaretskii:

I removed this example from the manual.

shynur
  • 5,253
  • 1
  • 4
  • 25