/[emacs]/emacs/lisp/battery.el
ViewVC logotype

Diff of /emacs/lisp/battery.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by pj, Wed Aug 8 20:11:46 2001 UTC revision 1.15 by friedman, Mon Dec 10 10:22:02 2001 UTC
# Line 171  The following %-sequences are provided: Line 171  The following %-sequences are provided:
171            (setq buffer (get-buffer-create " *battery*"))            (setq buffer (get-buffer-create " *battery*"))
172            (set-buffer buffer)            (set-buffer buffer)
173            (erase-buffer)            (erase-buffer)
174            (battery-insert-file-contents "/proc/apm")            (insert-file-contents "/proc/apm")
175            (re-search-forward battery-linux-proc-apm-regexp)            (re-search-forward battery-linux-proc-apm-regexp)
176            (setq driver-version (match-string 1))            (setq driver-version (match-string 1))
177            (setq bios-version (match-string 2))            (setq bios-version (match-string 2))
# Line 242  The following %-sequences are provided: Line 242  The following %-sequences are provided:
242          (setq result (concat result "%")))          (setq result (concat result "%")))
243      result))      result))
244    
 (defun battery-insert-file-contents (file-name)  
   "Insert contents of file FILE-NAME after point.  
 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  
       (load file-name nil t t))))  
   
 (defun battery-read-function (&optional stream)  
   "Function for reading expressions from STREAM.  
 Value is always nil."  
   (let (char)  
     (while (not (< (setq char (get-file-char)) 0))  
       (insert char))))  
   
245  (defconst battery-hex-map '((?0 .  0) (?1 .  1) (?2 .  2) (?3 .  3)  (defconst battery-hex-map '((?0 .  0) (?1 .  1) (?2 .  2) (?3 .  3)
246                              (?4 .  4) (?5 .  5) (?6 .  6) (?7 .  7)                              (?4 .  4) (?5 .  5) (?6 .  6) (?7 .  7)
247                              (?8 .  8) (?9 .  9) (?a . 10) (?b . 11)                              (?8 .  8) (?9 .  9) (?a . 10) (?b . 11)

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26