Commit f1cf7a31 authored by Juri Linkov's avatar Juri Linkov
Browse files

* lisp/battery.el (display-battery-mode): If `battery-status-function'

or `battery-mode-line-format' is nil, display the message and set
`display-battery-mode' to nil.

Fixes: debbugs:9363
parent e25be792
2011-08-25 Juri Linkov <juri@jurta.org>
* battery.el (display-battery-mode): If `battery-status-function'
or `battery-mode-line-format' is nil, display the message and set
`display-battery-mode' to nil (bug#9363).
2011-08-25 Eli Zaretskii <eliz@gnu.org>
* buff-menu.el (Buffer-menu-buffer+size): Remove calls to
......
......@@ -173,13 +173,16 @@ seconds."
(setq battery-mode-line-string "")
(or global-mode-string (setq global-mode-string '("")))
(and battery-update-timer (cancel-timer battery-update-timer))
(if (not display-battery-mode)
(setq global-mode-string
(delq 'battery-mode-line-string global-mode-string))
(add-to-list 'global-mode-string 'battery-mode-line-string t)
(setq battery-update-timer (run-at-time nil battery-update-interval
'battery-update-handler))
(battery-update)))
(if (and battery-status-function battery-mode-line-format)
(if (not display-battery-mode)
(setq global-mode-string
(delq 'battery-mode-line-string global-mode-string))
(add-to-list 'global-mode-string 'battery-mode-line-string t)
(setq battery-update-timer (run-at-time nil battery-update-interval
'battery-update-handler))
(battery-update))
(message "Battery status not available")
(setq display-battery-mode nil)))
(defun battery-update-handler ()
(battery-update)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment