bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17349: 24.3.50; display-battery-mode stops updating after closing an


From: Nicolas Richard
Subject: bug#17349: 24.3.50; display-battery-mode stops updating after closing and reopening lid
Date: Sun, 27 Apr 2014 09:59:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Peter Münster <address@hidden> writes:
>> (I'm now running a piece of advice to check whether timer-event-handler
>> is run when the problem appears, but I did not use my laptop a lot the
>> last few hours.)
>
> Could you send it please? Perhaps it would make sense to use this advice
> here on my emacs too.

Sure ; although it's less useful that what its description promises.

(defun yf/checktimer-after (timer)
  (when (eq battery-update-timer timer)
    (message "Ran battery update timer. current time: %s triggered-p: %s"
             (decode-time) (timer--triggered timer))))
(defun yf/checktimer-before (timer)
  (when (eq battery-update-timer timer)
    (message "Running battery update timer. current time: %s triggered-p: %s"
             (decode-time) (timer--triggered timer))))
(advice-add 'timer-event-handler :before 'yf/checktimer-before)
(advice-add 'timer-event-handler :after 'yf/checktimer-after)

(defun yf/checktimer-warn ()
  (when (timer--triggered battery-update-timer)
    (warn "battery-update-timer has trigger flag to t.")))
(add-hook 'post-command-hook 'yf/checktimer-warn)

-- 
Nico.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]