aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1998-03-30 04:39:53 +0000
committerRichard M. Stallman <[email protected]>1998-03-30 04:39:53 +0000
commit3691e056ac4ad491b0be2074703f6298e87430cb (patch)
treeb41878d2d67ba57dbff0b8d164908fbc861aa5d6 /lisp
parent608b9ed2e4a0c51a69ba3b770e61353079d194c6 (diff)
(battery-linux-proc-apm): Re-use the temporary buffer.
(battery-insert-file-contents): Disable code conversion.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/battery.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index 608ce9cd46..a3cc393ea7 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -169,9 +169,9 @@ The following %-sequences are provided:
seconds minutes hours remaining-time buffer tem)
(unwind-protect
(save-excursion
- (setq buffer (generate-new-buffer " *battery*"))
- (buffer-disable-undo buffer)
+ (setq buffer (get-buffer-create " *battery*"))
(set-buffer buffer)
+ (erase-buffer)
(battery-insert-file-contents "/proc/apm")
(re-search-forward battery-linux-proc-apm-regexp)
(setq driver-version (match-string 1))
@@ -205,8 +205,7 @@ The following %-sequences are provided:
(setq minutes (/ seconds 60)
hours (/ seconds 3600))
(setq remaining-time
- (format "%d:%02d" hours (- minutes (* 60 hours)))))))
- (and buffer (kill-buffer buffer)))
+ (format "%d:%02d" hours (- minutes (* 60 hours))))))))
(list (cons ?v (or driver-version "N/A"))
(cons ?V (or bios-version "N/A"))
(cons ?I (or bios-interface "N/A"))
@@ -249,6 +248,7 @@ The following %-sequences are provided:
FILE-NAME can be a non-ordinary file, for example, a named pipe.
Return t if file exists."
(let ((load-read-function 'battery-read-function)
+ (load-source-file-function nil)
(load-path '("."))
(load-history nil))
(save-excursion