GNU bug report logs - #17349
24.3.50; display-battery-mode stops updating after closing and reopening lid

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Sat, 26 Apr 2014 11:20:02 UTC

Severity: normal

Tags: moreinfo

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Peter Münster <pmlists <at> free.fr>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>, Eli Zaretskii <eliz <at> gnu.org>, gundaetiapo <at> gmail.com, 17349 <at> debbugs.gnu.org
Subject: bug#17349: 24.3.50; display-battery-mode stops updating after closing and reopening lid
Date: Thu, 22 Jan 2015 10:43:31 +0100
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.