GNU bug report logs -
#17349
24.3.50; display-battery-mode stops updating after closing and reopening lid
Previous Next
Full log
Message #50 received at 17349 <at> debbugs.gnu.org (full text, mbox):
On Fri, Jun 27 2014, Peter Münster wrote:
> Do you think, that this will be fixed soon? If not, I'll install a
> workaround with crond and emacsclient.
Works quite nicely since some months:
--8<---------------cut here---------------start------------->8---
(defun pm/start-timer (sym func &rest args)
(cl-pushnew (list sym func args) pm/timer-list)
(apply func args))
(defun pm/gnus-demon-add-handler (sym period idle)
(pm/start-timer sym 'gnus-demon-add-handler sym period idle))
(defun pm/timer-running-p (func)
(dolist (timer (append timer-list timer-idle-list))
(if (or (eq (timer--function timer) func)
(and (eq (timer--function timer) 'gnus-demon-run-callback)
(eq (car (timer--args timer)) func)))
(return (not (timer--triggered timer))))))
(defun pm/check-timers ()
(dolist (e pm/timer-list)
(lexical-let ((entry e) (timer (first e)))
(unless (pm/timer-running-p timer)
(if (display-graphic-p)
(notifications-notify
:title "Timer is dead!"
:body (symbol-name timer)
:timeout (* 55 60 1000)
:actions '("delete" "delete entry" "restart" "restart timer")
:on-action (lambda (id key) (pm/timer-action entry key)))
(message "Timer is dead: %s" timer))))))
--8<---------------cut here---------------end--------------->8---
And once per hour, crond executes "emacsclient -e '(pm/check-timers)'"
When a timer is dead, I just need to restart it with a mouse-click.
--
Peter
This bug report was last modified 3 years and 86 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.