diff options
| author | Richard M. Stallman | 2006-03-11 15:08:42 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2006-03-11 15:08:42 +0000 |
| commit | 76815b2a6df7ae69ddb2f34e4db409ed180e96af (patch) | |
| tree | 7ca43d3170394ce27630926465dbe24087242d2f | |
| parent | 55faab0a19c18ed34bd85a3f89c7bc1acf12c47b (diff) | |
| download | emacs-76815b2a6df7ae69ddb2f34e4db409ed180e96af.tar.gz emacs-76815b2a6df7ae69ddb2f34e4db409ed180e96af.zip | |
(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".
| -rw-r--r-- | lisp/battery.el | 42 |
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." | |||
| 77 | Ordinary characters in the control string are printed as-is, while | 77 | Ordinary characters in the control string are printed as-is, while |
| 78 | conversion specifications introduced by a `%' character in the control | 78 | conversion specifications introduced by a `%' character in the control |
| 79 | string are substituted as defined by the current value of the variable | 79 | string are substituted as defined by the current value of the variable |
| 80 | `battery-status-function'." | 80 | `battery-status-function'. Here are the ones generally available: |
| 81 | %c Current capacity (mAh or mWh) | ||
| 82 | %r Current rate of charge or discharge | ||
| 83 | %B Battery status (verbose) | ||
| 84 | %b Battery status: empty means high, `-' means low, | ||
| 85 | `!' means critical, and `+' means charging | ||
| 86 | %d Temperature (in degrees Celsius) | ||
| 87 | %L AC line status (verbose) | ||
| 88 | %p Battery load percentage | ||
| 89 | %m Remaining time (to charge or discharge) in minutes | ||
| 90 | %h Remaining time (to charge or discharge) in hours | ||
| 91 | %t Remaining time (to charge or discharge) in the form `h:min'" | ||
| 81 | :type '(choice string (const nil)) | 92 | :type '(choice string (const nil)) |
| 82 | :group 'battery) | 93 | :group 'battery) |
| 83 | 94 | ||
| @@ -96,7 +107,18 @@ string are substituted as defined by the current value of the variable | |||
| 96 | Ordinary characters in the control string are printed as-is, while | 107 | Ordinary characters in the control string are printed as-is, while |
| 97 | conversion specifications introduced by a `%' character in the control | 108 | conversion specifications introduced by a `%' character in the control |
| 98 | string are substituted as defined by the current value of the variable | 109 | string are substituted as defined by the current value of the variable |
| 99 | `battery-status-function'." | 110 | `battery-status-function'. Here are the ones generally available: |
| 111 | %c Current capacity (mAh or mWh) | ||
| 112 | %r Current rate of charge or discharge | ||
| 113 | %B Battery status (verbose) | ||
| 114 | %b Battery status: empty means high, `-' means low, | ||
| 115 | `!' means critical, and `+' means charging | ||
| 116 | %d Temperature (in degrees Celsius) | ||
| 117 | %L AC line status (verbose) | ||
| 118 | %p Battery load percentage | ||
| 119 | %m Remaining time (to charge or discharge) in minutes | ||
| 120 | %h Remaining time (to charge or discharge) in hours | ||
| 121 | %t Remaining time (to charge or discharge) in the form `h:min'" | ||
| 100 | :type '(choice string (const nil)) | 122 | :type '(choice string (const nil)) |
| 101 | :group 'battery) | 123 | :group 'battery) |
| 102 | 124 | ||
| @@ -196,10 +218,10 @@ The following %-sequences are provided: | |||
| 196 | %b Battery status, empty means high, `-' means low, | 218 | %b Battery status, empty means high, `-' means low, |
| 197 | `!' means critical, and `+' means charging | 219 | `!' means critical, and `+' means charging |
| 198 | %p Battery load percentage | 220 | %p Battery load percentage |
| 199 | %s Remaining time in seconds | 221 | %s Remaining time (to charge or discharge) in seconds |
| 200 | %m Remaining time in minutes | 222 | %m Remaining time (to charge or discharge) in minutes |
| 201 | %h Remaining time in hours | 223 | %h Remaining time (to charge or discharge) in hours |
| 202 | %t Remaining time in the form `h:min'" | 224 | %t Remaining time (to charge or discharge) in the form `h:min'" |
| 203 | (let (driver-version bios-version bios-interface line-status | 225 | (let (driver-version bios-version bios-interface line-status |
| 204 | battery-status battery-status-symbol load-percentage | 226 | battery-status battery-status-symbol load-percentage |
| 205 | seconds minutes hours remaining-time tem) | 227 | seconds minutes hours remaining-time tem) |
| @@ -267,9 +289,9 @@ The following %-sequences are provided: | |||
| 267 | %d Temperature (in degrees Celsius) | 289 | %d Temperature (in degrees Celsius) |
| 268 | %L AC line status (verbose) | 290 | %L AC line status (verbose) |
| 269 | %p Battery load percentage | 291 | %p Battery load percentage |
| 270 | %m Remaining time in minutes | 292 | %m Remaining time (to charge or discharge) in minutes |
| 271 | %h Remaining time in hours | 293 | %h Remaining time (to charge or discharge) in hours |
| 272 | %t Remaining time in the form `h:min'" | 294 | %t Remaining time (to charge or discharge) in the form `h:min'" |
| 273 | (let ((design-capacity 0) | 295 | (let ((design-capacity 0) |
| 274 | (last-full-capacity 0) | 296 | (last-full-capacity 0) |
| 275 | full-capacity | 297 | full-capacity |
| @@ -287,7 +309,7 @@ The following %-sequences are provided: | |||
| 287 | (ignore-errors (insert-file-contents (expand-file-name "state" dir))) | 309 | (ignore-errors (insert-file-contents (expand-file-name "state" dir))) |
| 288 | (when (re-search-forward "present: +yes$" nil t) | 310 | (when (re-search-forward "present: +yes$" nil t) |
| 289 | (and (re-search-forward "charging state: +\\(.*\\)$" nil t) | 311 | (and (re-search-forward "charging state: +\\(.*\\)$" nil t) |
| 290 | (member charging-state '("unknown" nil)) | 312 | (member charging-state '("unknown" "charged" nil)) |
| 291 | ;; On most multi-battery systems, most of the time only one | 313 | ;; On most multi-battery systems, most of the time only one |
| 292 | ;; battery is "charging"/"discharging", the others are | 314 | ;; battery is "charging"/"discharging", the others are |
| 293 | ;; "unknown". | 315 | ;; "unknown". |