Subject: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake

From: Michael Albinus <[email-masked]>
Date: Thu, 06 Feb 2025 15:05:27 +0100

Andrew Cohen <[email-masked]> writes:

Hi Andrew,

> I would change the initial special-event-map binding to 'ignore, so that
> nothing happens until sleep-wake-mode is activated. My current iteration
> installs the handler in the keymap when the mode is activated and
> sets it to 'ignore when its disabled.

Good idea, I change the patch accordingly.

> I think the remaining big question is how to handle inhibiting sleep
> until the sleep-wake code is finished. With dbus.el its straightforward
> (although I still don't know how to close the file descriptor returned
> from the dbus method in lisp; any help?) but I'm not sure what to do
> with other systems. Somehow  sleep-wake-mode needs to communicate that
> it is OK to release inhibition. I guess one way might be to mimic the
> D-Bus method and include a file descriptor in the sleep-event that
> blocks sleep until the fd is closed. But this seems kind of contrived.

I haven't checked this yet. We will do it once the special-event based
approach is accepted.

> Best,
> Andy

Best regards, Michael.