]> code.delx.au - gnu-emacs/commitdiff
(battery-linux-proc-apm): Re-use the temporary buffer.
authorRichard M. Stallman <rms@gnu.org>
Mon, 30 Mar 1998 04:39:53 +0000 (04:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 30 Mar 1998 04:39:53 +0000 (04:39 +0000)
(battery-insert-file-contents): Disable code conversion.

lisp/battery.el

index 608ce9cd46fff4d8b8a62f69b22e3545f4517466..a3cc393ea78fe27cca7e3dce2c7f2254d9950c33 100644 (file)
@@ -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