emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r107866: Fix sysfs battery display


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r107866: Fix sysfs battery display.
Date: Fri, 20 Apr 2012 15:32:35 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107866
fixes bug(s): http://debbugs.gnu.org/11269
author: Dan Nicolaescu <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: emacs-24
timestamp: Fri 2012-04-20 15:32:35 +0800
message:
  Fix sysfs battery display.
  
  * battery.el (battery-echo-area-format): Display remaining time
  for sysfs backend too (Bug#11269).
  (battery-linux-sysfs): Fix conditional for the charge.
modified:
  lisp/ChangeLog
  lisp/battery.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-20 06:39:29 +0000
+++ b/lisp/ChangeLog    2012-04-20 07:32:35 +0000
@@ -1,3 +1,9 @@
+2012-04-20  Dan Nicolaescu  <address@hidden>
+
+       * battery.el (battery-echo-area-format): Display remaining time
+       for sysfs backend too (Bug#11269).
+       (battery-linux-sysfs): Fix conditional for the charge.
+
 2012-04-20  Chong Yidong  <address@hidden>
 
        * progmodes/gdb-mi.el (gdb): Revert 2012-04-19 change.

=== modified file 'lisp/battery.el'
--- a/lisp/battery.el   2012-02-11 22:13:29 +0000
+++ b/lisp/battery.el   2012-04-20 07:32:35 +0000
@@ -78,7 +78,7 @@
   (cond ((eq battery-status-function 'battery-linux-proc-acpi)
         "Power %L, battery %B at %r (%p%% load, remaining time %t)")
        ((eq battery-status-function 'battery-linux-sysfs)
-        "Power %L, battery %B (%p%% load)")
+        "Power %L, battery %B (%p%% load, remaining time %t)")
        ((eq battery-status-function 'battery-pmset)
         "%L power, battery %B (%p%% load, remaining time %t)")
        ((eq battery-status-function 'battery-yeeloong-sysfs)
@@ -509,7 +509,7 @@
                     "N/A"))
          (cons ?d (or temperature "N/A"))
          (cons ?B (or charging-state "N/A"))
-         (cons ?p (cond ((> charge-full 0)
+         (cons ?p (cond ((and (> charge-full 0) (> charge-now 0))
                          (format "%.1f"
                                  (/ (* 100 charge-now) charge-full)))
                         ((> energy-full 0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]