+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
(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)