One can now prevent the system from sleeping and/or the display blanking in Emacs 31 using the new library system-sleep. This may be useful to integrate or at least mention in the documentation for people who expect long-running sessions to continue working without sleep interruption. It does not prevent "hard sleeping" i.e., closing the lid on your laptop but it does have a hook you can use to know when the system is about to sleep and after it has woken up and take an appropriate action to suspend/resume things.
One can now prevent the system from sleeping and/or the display blanking in Emacs 31 using the new library
system-sleep. This may be useful to integrate or at least mention in the documentation for people who expect long-running sessions to continue working without sleep interruption. It does not prevent "hard sleeping" i.e., closing the lid on your laptop but it does have a hook you can use to know when the system is about to sleep and after it has woken up and take an appropriate action to suspend/resume things.