summaryrefslogtreecommitdiff
path: root/lisp/battery.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2006-03-11 15:08:42 +0000
committerRichard M. Stallman <rms@gnu.org>2006-03-11 15:08:42 +0000
commit76815b2a6df7ae69ddb2f34e4db409ed180e96af (patch)
tree7ca43d3170394ce27630926465dbe24087242d2f /lisp/battery.el
parent55faab0a19c18ed34bd85a3f89c7bc1acf12c47b (diff)
downloademacs-76815b2a6df7ae69ddb2f34e4db409ed180e96af.tar.gz
(battery-echo-area-format): Doc fix.
(battery-mode-line-format): Likewise. (battery-linux-proc-apm, battery-linux-proc-acpi): Likewise. (battery-linux-proc-acpi): Ignore batteries that say "charged".
Diffstat (limited to 'lisp/battery.el')
-rw-r--r--lisp/battery.el42
1 files changed, 32 insertions, 10 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index fa816c585b4..65b8baff66c 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -77,7 +77,18 @@ introduced by a `%' character in a control string."
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
string are substituted as defined by the current value of the variable
-`battery-status-function'."
+`battery-status-function'. Here are the ones generally available:
+%c Current capacity (mAh or mWh)
+%r Current rate of charge or discharge
+%B Battery status (verbose)
+%b Battery status: empty means high, `-' means low,
+ `!' means critical, and `+' means charging
+%d Temperature (in degrees Celsius)
+%L AC line status (verbose)
+%p Battery load percentage
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
:type '(choice string (const nil))
:group 'battery)
@@ -96,7 +107,18 @@ string are substituted as defined by the current value of the variable
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
string are substituted as defined by the current value of the variable
-`battery-status-function'."
+`battery-status-function'. Here are the ones generally available:
+%c Current capacity (mAh or mWh)
+%r Current rate of charge or discharge
+%B Battery status (verbose)
+%b Battery status: empty means high, `-' means low,
+ `!' means critical, and `+' means charging
+%d Temperature (in degrees Celsius)
+%L AC line status (verbose)
+%p Battery load percentage
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
:type '(choice string (const nil))
:group 'battery)
@@ -196,10 +218,10 @@ The following %-sequences are provided:
%b Battery status, empty means high, `-' means low,
`!' means critical, and `+' means charging
%p Battery load percentage
-%s Remaining time in seconds
-%m Remaining time in minutes
-%h Remaining time in hours
-%t Remaining time in the form `h:min'"
+%s Remaining time (to charge or discharge) in seconds
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
(let (driver-version bios-version bios-interface line-status
battery-status battery-status-symbol load-percentage
seconds minutes hours remaining-time tem)
@@ -267,9 +289,9 @@ The following %-sequences are provided:
%d Temperature (in degrees Celsius)
%L AC line status (verbose)
%p Battery load percentage
-%m Remaining time in minutes
-%h Remaining time in hours
-%t Remaining time in the form `h:min'"
+%m Remaining time (to charge or discharge) in minutes
+%h Remaining time (to charge or discharge) in hours
+%t Remaining time (to charge or discharge) in the form `h:min'"
(let ((design-capacity 0)
(last-full-capacity 0)
full-capacity
@@ -287,7 +309,7 @@ The following %-sequences are provided:
(ignore-errors (insert-file-contents (expand-file-name "state" dir)))
(when (re-search-forward "present: +yes$" nil t)
(and (re-search-forward "charging state: +\\(.*\\)$" nil t)
- (member charging-state '("unknown" nil))
+ (member charging-state '("unknown" "charged" nil))
;; On most multi-battery systems, most of the time only one
;; battery is "charging"/"discharging", the others are
;; "unknown".