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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrew Cohen <acohen <at> ust.hk>
Cc: 63620 <at> debbugs.gnu.org, michael.albinus <at> gmx.de, shipmints <at> gmail.com, monnier <at> iro.umontreal.ca
Subject: bug#63620: 30.0.50; [Feature Request] run hooks on sleep/wake
Date: Fri, 07 Feb 2025 14:18:20 +0200
> Date: Fri, 7 Feb 2025 19:43:32 +0800 (GMT+08:00)
> From: Andrew Cohen <acohen <at> ust.hk>
> Cc: 63620 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
> 	Eli Zaretskii <eliz <at> gnu.org>, michael.albinus <at> gmx.de
> 
> Having thought a bit more I am convinced that starting the block 
> before the sleep notification is the right thing

This sounds strange to me.  Are you absolutely sure?  Did you try this
on some system?  Why would an application need to proactively block
sleep mode before the system announces its intention to sleep?  Won't
doing that prevent sleep, including one due to system idleness,
altogether?

> I think that with logind putting the block on AFTER the notification
> is actually not allowed (at least it seems that way in my testing.

We don't need to block sleep, we only need to delay it for a short
while.

> Can I get any feedback about the file descriptor closure issue? From what 
> I can tell without exposing it in lisp the way I did I won't be able to 
> use blocking anyway.

Emacs has no way of manipulating handles or file descriptors.  If this
is required in this case, we must expose it to Lisp in the form of
some primitive.

But since there could be only one such descriptor at any given time,
why would any Lisp program need to know its value?  It sounds like we
need to record the descriptor internally, and then close it in C, no?
Maybe some D-Bus related primitive could do that?




This bug report was last modified 131 days ago.

Previous Next


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