From: Chong Yidong Date: Wed, 1 Nov 2006 14:24:37 +0000 (+0000) Subject: * battery.el (battery-linux-proc-acpi): Prevent range error when X-Git-Tag: emacs-pretest-22.0.91~418 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5c79f850e1a1d90b1b3aa96ce3d523d7fa80774a;p=emacs.git * battery.el (battery-linux-proc-acpi): Prevent range error when `full-capacity' is 0. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 83c082df439..85adffd97c3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2006-10-31 Andreas Seltenreich + + * battery.el (battery-linux-proc-acpi): Prevent range error when + `full-capacity' is 0. + 2006-10-31 Yoni Rabkin Katzenell (tiny change) * lisp/faces.el (faces-sample-overlay): New defvar. diff --git a/lisp/battery.el b/lisp/battery.el index 50edc8dde8a..ec35e04e1ab 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -408,6 +408,7 @@ The following %-sequences are provided: (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)))))