[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Range error in battery.el
From: |
Andreas Seltenreich |
Subject: |
Range error in battery.el |
Date: |
Tue, 31 Oct 2006 01:42:13 +0100 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.90 (gnu/linux) |
Hi,
the attached patch prevents a range error that causes
battery-mode-line-string to get stale when batteries are unplugged.
regards,
andreas
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10234
diff -c -0 -r1.10234 ChangeLog
*** ChangeLog 30 Oct 2006 23:24:18 -0000 1.10234
--- ChangeLog 30 Oct 2006 23:49:07 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2006-10-31 Andreas Seltenreich <address@hidden>
+
+ * battery.el (battery-linux-proc-acpi): Prevent range error when
+ `full-capacity' is 0.
+
Index: battery.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/battery.el,v
retrieving revision 1.36
diff -c -r1.36 battery.el
*** battery.el 9 May 2006 22:43:35 -0000 1.36
--- battery.el 30 Oct 2006 23:49:09 -0000
***************
*** 408,413 ****
--- 408,414 ----
(format "%d:%02d" hours (- minutes (* 60 hours))))
"N/A"))
(cons ?p (or (and full-capacity capacity
+ (> full-capacity 0)
(number-to-string
(floor (/ capacity
(/ (float full-capacity) 100)))))
- Range error in battery.el,
Andreas Seltenreich <=