diff options
| author | Richard M. Stallman | 1998-03-30 04:39:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-30 04:39:53 +0000 |
| commit | 3691e056ac4ad491b0be2074703f6298e87430cb (patch) | |
| tree | b41878d2d67ba57dbff0b8d164908fbc861aa5d6 | |
| parent | 608b9ed2e4a0c51a69ba3b770e61353079d194c6 (diff) | |
| download | emacs-3691e056ac4ad491b0be2074703f6298e87430cb.tar.gz emacs-3691e056ac4ad491b0be2074703f6298e87430cb.zip | |
(battery-linux-proc-apm): Re-use the temporary buffer.
(battery-insert-file-contents): Disable code conversion.
| -rw-r--r-- | lisp/battery.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/battery.el b/lisp/battery.el index 608ce9cd46f..a3cc393ea78 100644 --- a/lisp/battery.el +++ b/lisp/battery.el | |||
| @@ -169,9 +169,9 @@ The following %-sequences are provided: | |||
| 169 | seconds minutes hours remaining-time buffer tem) | 169 | seconds minutes hours remaining-time buffer tem) |
| 170 | (unwind-protect | 170 | (unwind-protect |
| 171 | (save-excursion | 171 | (save-excursion |
| 172 | (setq buffer (generate-new-buffer " *battery*")) | 172 | (setq buffer (get-buffer-create " *battery*")) |
| 173 | (buffer-disable-undo buffer) | ||
| 174 | (set-buffer buffer) | 173 | (set-buffer buffer) |
| 174 | (erase-buffer) | ||
| 175 | (battery-insert-file-contents "/proc/apm") | 175 | (battery-insert-file-contents "/proc/apm") |
| 176 | (re-search-forward battery-linux-proc-apm-regexp) | 176 | (re-search-forward battery-linux-proc-apm-regexp) |
| 177 | (setq driver-version (match-string 1)) | 177 | (setq driver-version (match-string 1)) |
| @@ -205,8 +205,7 @@ The following %-sequences are provided: | |||
| 205 | (setq minutes (/ seconds 60) | 205 | (setq minutes (/ seconds 60) |
| 206 | hours (/ seconds 3600)) | 206 | hours (/ seconds 3600)) |
| 207 | (setq remaining-time | 207 | (setq remaining-time |
| 208 | (format "%d:%02d" hours (- minutes (* 60 hours))))))) | 208 | (format "%d:%02d" hours (- minutes (* 60 hours)))))))) |
| 209 | (and buffer (kill-buffer buffer))) | ||
| 210 | (list (cons ?v (or driver-version "N/A")) | 209 | (list (cons ?v (or driver-version "N/A")) |
| 211 | (cons ?V (or bios-version "N/A")) | 210 | (cons ?V (or bios-version "N/A")) |
| 212 | (cons ?I (or bios-interface "N/A")) | 211 | (cons ?I (or bios-interface "N/A")) |
| @@ -249,6 +248,7 @@ The following %-sequences are provided: | |||
| 249 | FILE-NAME can be a non-ordinary file, for example, a named pipe. | 248 | FILE-NAME can be a non-ordinary file, for example, a named pipe. |
| 250 | Return t if file exists." | 249 | Return t if file exists." |
| 251 | (let ((load-read-function 'battery-read-function) | 250 | (let ((load-read-function 'battery-read-function) |
| 251 | (load-source-file-function nil) | ||
| 252 | (load-path '(".")) | 252 | (load-path '(".")) |
| 253 | (load-history nil)) | 253 | (load-history nil)) |
| 254 | (save-excursion | 254 | (save-excursion |