1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-17 11:20:39 -08:00

(battery-linux-proc-apm): Fix typo in docstring.

Catch errors with ignore-errors.  Use temporary buffer.
(battery-linux-proc-acpi): Fix typo in docstring.  Document `%r'.
This commit is contained in:
Lute Kamstra 2005-07-01 11:03:19 +00:00
parent b97c98ad01
commit 12d6b12433
2 changed files with 43 additions and 42 deletions

View file

@ -1,5 +1,9 @@
2005-07-01 Lute Kamstra <lute@gnu.org> 2005-07-01 Lute Kamstra <lute@gnu.org>
* battery.el (battery-linux-proc-apm): Fix typo in docstring.
Catch errors with ignore-errors. Use temporary buffer.
(battery-linux-proc-acpi): Fix typo in docstring. Document `%r'.
* facemenu.el (facemenu-unlisted-faces): Delete foreground and * facemenu.el (facemenu-unlisted-faces): Delete foreground and
background color faces. background color faces.
(facemenu-set-foreground, facemenu-set-background): Use (facemenu-set-foreground, facemenu-set-background): Use

View file

@ -171,21 +171,17 @@ The following %-sequences are provided:
%B Battery status (verbose) %B Battery status (verbose)
%b Battery status, empty means high, `-' means low, %b Battery status, empty means high, `-' means low,
`!' means critical, and `+' means charging `!' means critical, and `+' means charging
%p battery load percentage %p Battery load percentage
%s Remaining time in seconds %s Remaining time in seconds
%m Remaining time in minutes %m Remaining time in minutes
%h Remaining time in hours %h Remaining time in hours
%t Remaining time in the form `h:min'" %t Remaining time in the form `h:min'"
(let (driver-version bios-version bios-interface line-status (let (driver-version bios-version bios-interface line-status
battery-status battery-status-symbol load-percentage battery-status battery-status-symbol load-percentage
seconds minutes hours remaining-time buffer tem) seconds minutes hours remaining-time tem)
(unwind-protect (with-temp-buffer
(save-excursion (ignore-errors (insert-file-contents "/proc/apm"))
(setq buffer (get-buffer-create " *battery*")) (when (re-search-forward battery-linux-proc-apm-regexp)
(set-buffer buffer)
(erase-buffer)
(insert-file-contents "/proc/apm")
(re-search-forward battery-linux-proc-apm-regexp)
(setq driver-version (match-string 1)) (setq driver-version (match-string 1))
(setq bios-version (match-string 2)) (setq bios-version (match-string 2))
(setq tem (string-to-number (match-string 3) 16)) (setq tem (string-to-number (match-string 3) 16))
@ -240,12 +236,13 @@ in Linux version 2.4.20 and 2.6.0.
The following %-sequences are provided: The following %-sequences are provided:
%c Current capacity (mAh) %c Current capacity (mAh)
%r Current rate
%B Battery status (verbose) %B Battery status (verbose)
%b Battery status, empty means high, `-' means low, %b Battery status, empty means high, `-' means low,
`!' means critical, and `+' means charging `!' means critical, and `+' means charging
%d Temperature (in degrees Celsius) %d Temperature (in degrees Celsius)
%L AC line status (verbose) %L AC line status (verbose)
%p battery load percentage %p Battery load percentage
%m Remaining time in minutes %m Remaining time in minutes
%h Remaining time in hours %h Remaining time in hours
%t Remaining time in the form `h:min'" %t Remaining time in the form `h:min'"