unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Peter Münster" <pmlists@free.fr>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Nicolas Richard <theonewiththeevillook@yahoo.fr>,
	gundaetiapo@gmail.com, 17349@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	[thread overview]
Message-ID: <87sif3kv5o.fsf@roche-blanche.net> (raw)
In-Reply-To: <87mwcybqah.fsf@micropit.roche-blanche.homenet.org> ("Peter Münster"'s message of "Fri, 27 Jun 2014 12:27:50 +0200")

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





  parent reply	other threads:[~2015-01-22  9:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 11:19 bug#17349: 24.3.50; display-battery-mode stops updating after closing and reopening lid Nicolas Richard
2014-04-26 14:49 ` Barry OReilly
2014-04-26 20:35   ` Nicolas Richard
2014-04-26 20:49 ` Peter Münster
2014-04-27  7:59   ` Nicolas Richard
2014-05-01 13:56     ` Peter Münster
2014-05-01 17:02       ` Peter Münster
2014-05-02 11:05         ` Nicolas Richard
2014-05-02 12:13           ` Eli Zaretskii
2014-06-17 13:33             ` Stefan Monnier
2014-06-27 10:27               ` Peter Münster
2014-06-27 12:06                 ` Nicolas Richard
2015-01-22  9:43                 ` Peter Münster [this message]
2014-05-02 13:24           ` Stefan Monnier
2015-01-22 15:33             ` Nicolas Richard
2014-05-02 11:24 ` Peter Münster
2014-06-15  9:42 ` bug#17349: timer vanishes Peter Münster
2022-04-17 11:06 ` bug#17349: 24.3.50; display-battery-mode stops updating after closing and reopening lid Lars Ingebrigtsen
2022-04-17 20:45   ` Nicolas Richard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-18  9:07     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sif3kv5o.fsf@roche-blanche.net \
    --to=pmlists@free.fr \
    --cc=17349@debbugs.gnu.org \
    --cc=gundaetiapo@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=theonewiththeevillook@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).