GNU bug report logs - #63620
30.0.50; [Feature Request] run hooks on sleep/wake

Previous Next

Package: emacs;

Reported by: Andrew Cohen <acohen <at> ust.hk>

Date: Sat, 20 May 2023 23:25:02 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Full log


Message #133 received at 63620 <at> debbugs.gnu.org (full text, mbox):

From: Ship Mints <shipmints <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Andrew Cohen <acohen <at> ust.hk>, 63620 <at> debbugs.gnu.org, eliz <at> gnu.org,
 monnier <at> iro.umontreal.ca
Subject: Re: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake
Date: Thu, 6 Feb 2025 09:11:36 -0500
[Message part 1 (text/plain, inline)]
The flow, as I understand it looks like it will be:

1 OS reports about to sleep
2 C code posts an event
3 sleep-wake-mode processes the event
3a Tell the OS to prevent sleep (has to be done in C)
3b Call hooks
3c Tell the OS it's now okay to sleep (ditto in C)

It's 3a and 3c that I was referring to.

On Thu, Feb 6, 2025 at 9:09 AM Michael Albinus <michael.albinus <at> gmx.de>
wrote:

> Ship Mints <shipmints <at> gmail.com> writes:
>
> Hi Ship,
>
> > The API on macOS would expose a pair of C functions to lisp, one would
> > inhibit sleep, perhaps returning an opaque "cookie", the second to
> > revoke the inhibition. The same API can be used to prevent macOS from
> > ever sleeping, if the user wanted that.
>
> Why that? If we have the special event sleep-event, you can call
> kbd_buffer_store_event directly in your C source.
>
> The arguments for the sleep-event can be extended as we like, as API.
>
> Best regards, Michael.
>
[Message part 2 (text/html, inline)]

This bug report was last modified 130 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.