Re: [GNU ELPA] New package: caffeinate-mode

Stéphane Marks <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <CAN+1HbrC7Kz_0aG+3wtzf3NjjQ55C8K3T6crumvnHs45_w_Q1g@mail.gmail.com>
On Mon, Jul 20, 2026 at 1:56 PM Philip Kaludercic <[email protected]>
wrote:

> Lucas Christian <[email protected]> writes:
>
> > Philip Kaludercic <[email protected]> writes:
> >
> > The main challenge here is that I as a user have to remember what
> > setting the mode was last in. E.g. if I last used caffeinate with
> > display sleep blocking, but now I just want system sleep blocking, I
> > would need to run M-x caffeinate-mode followed by M-x
> > caffeinate-toggle-inhibit-display-sleep. Whereas with the separate minor
> > modes, I just call the one I want. Perhaps that's not that big of a deal
> > though--if someone really feels strongly they can add a few trivial
> > functions to their init to turn on caffeinate to the preference value
> > that they want.
>
> I am not familiar with the system-sleep API, do you think it is feasible
> to have the option change the behavior of an existing process?
>

FWIU, caffeinate-mode is not process specific, it's a user-level
all-or-nothing election.  To switch from its global display allowed to
sleep to display not allowed to sleep it has to cancel its sleep token and
request a new one with the display option specified.  I believe it does
that now.  The caffeinate-mode UI for selecting between display sleep or
not is the open question, I think, not the mechanism of action.

For integrations like gnus, it relies only on being notified that the
system has gone to sleep or awakened and does not itself dictate any policy.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.