From 540710130b872195127911237efa17e1bdfc2c5a Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Fri, 20 Apr 2012 15:32:35 +0800 Subject: [PATCH] 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. --- lisp/ChangeLog | 6 ++++++ lisp/battery.el | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 601e4f4f59f..ddd306b98df 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-04-20 Dan Nicolaescu + + * 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 * progmodes/gdb-mi.el (gdb): Revert 2012-04-19 change. diff --git a/lisp/battery.el b/lisp/battery.el index 586be9e8938..5eb22b83f85 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -78,7 +78,7 @@ introduced by a `%' character in a control string." (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 @@ The following %-sequences are provided: "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) -- 2.11.4.GIT