Re: [GNU ELPA] New package: caffeinate-mode
Stéphane Marks <[email protected]>
| Newsgroups | gmane.emacs.devel |
|---|---|
| Message-ID | <CAN+1Hbr6zKsoKSpt84HqOVw9auvybd_HZEPtyfSiAdJhEDPynw@mail.gmail.com> |
+ list On Sun, Jul 19, 2026 at 2:49 PM Lucas Christian <[email protected]> wrote: > Stéphane Marks <[email protected]> writes: > > > As the author of system-sleep, I specifically didn't add such a mode > > because the intention was never to replace O/S utility calls that > > affect the entire system but to allow long-running Emacs operations to > > declare (via hooks or other in-built policies) they want the system to > > remain awake. e.g., when running M-x compile, one could in a > > compilation-mode-hook declare a stay-awake policy. > > I am curious how you see these integrations developing over time. My > first use case (before writing this mode), was actually to hook it into > gnus (similar use case to what the gnus manual previously suggested > people do with the dbus package). Would system-sleep just be there and the user would be expected to wire > it up themselves (using advices, hooks, etc.)? Or would you expect > packages begin to ship built-in integrations as a standard feature? > > There are many cases where it might be a nice bit of "batteries > included", but I imagine some could be controversial, e.g. I may not > want every workflow I run in M-x compile today to block sleep. > One integration has already been done. Take a look at https://github.com/emacs-mirror/emacs/blob/0f086c307c12b74aeedfba07cfe5b57ef2f99808/lisp/gnus/gnus-start.el#L817 to see how it should look for other integrations. > > Separately, an optional mode-line system sleep indicator could be > > useful but that seems separate to your package and would provide a > > touch more utility across system-sleep estate that doesn't leverage > > caffeinate. > > The goal of this would be to indicate any time some system-sleep > consumer within Emacs is blocking sleep? > Yes. A visual indication that sleep is inhibited by one or more blockers would be a good first start.