Commit 43d5bf84 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

Implement battery-mode-line-limit option.

parent d31fd9ac
2011-06-27 Richard Stallman <>
* battery.el (battery-mode-line-limit): New variable.
(battery-update): Handle it.
* mail/rmailmm.el (rmail-mime-process-multipart):
Handle truncated messages.
......@@ -102,6 +102,11 @@ string are substituted as defined by the current value of the variable
"String to display in the mode line.")
;;;###autoload (put 'battery-mode-line-string 'risky-local-variable t)
(defcustom battery-mode-line-limit 100
"Percentage of full battery load below which display battery status"
:type 'integer
:group 'battery)
(defcustom battery-mode-line-format
(cond ((eq battery-status-function 'battery-linux-proc-acpi)
......@@ -182,16 +187,21 @@ seconds."
(defun battery-update ()
"Update battery status information in the mode line."
(setq battery-mode-line-string
(propertize (if (and battery-mode-line-format
(funcall battery-status-function))
'help-echo "Battery status information"))
(let ((data (and battery-status-function (funcall battery-status-function))))
(setq battery-mode-line-string
(propertize (if (and battery-mode-line-format
(<= (car (read-from-string (cdr (assq ?p data))))
(and (<= (car (read-from-string (cdr (assq ?p data))))
'help-echo "Battery status information")))
;;; `/proc/apm' interface for Linux.
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