all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Seltenreich <seltenreich@gmx.de>
Subject: Range error in battery.el
Date: Tue, 31 Oct 2006 01:42:13 +0100	[thread overview]
Message-ID: <878xixmi3e.fsf@gate450.dyndns.org> (raw)

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  <uwi7@rz.uni-karlsruhe.de>
+ 
+ 	* 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)))))

             reply	other threads:[~2006-10-31  0:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-31  0:42 Andreas Seltenreich [this message]
2006-11-01  2:13 ` Range error in battery.el Richard Stallman
2006-11-01 14:24   ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878xixmi3e.fsf@gate450.dyndns.org \
    --to=seltenreich@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.