From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 18 02:38:07 2012 Received: (at submit) by debbugs.gnu.org; 18 Apr 2012 06:38:07 +0000 Received: from localhost ([127.0.0.1]:39189 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKOWY-0006Zt-0X for submit@debbugs.gnu.org; Wed, 18 Apr 2012 02:37:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35007) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SKOWS-0006ZY-DG for submit@debbugs.gnu.org; Wed, 18 Apr 2012 02:37:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKOW5-0008SV-JA for submit@debbugs.gnu.org; Wed, 18 Apr 2012 02:37:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:36188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKOW5-0008SO-Fm for submit@debbugs.gnu.org; Wed, 18 Apr 2012 02:37:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKOW3-0005Cj-Sn for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 02:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SKOW2-0008Rv-4w for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 02:37:23 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:43245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SKOW2-0008Rr-1t for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 02:37:22 -0400 Received: from dann by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SKOW1-0006oJ-E0 for bug-gnu-emacs@gnu.org; Wed, 18 Apr 2012 02:37:21 -0400 From: Dan Nicolaescu To: bug-gnu-emacs@gnu.org Subject: battery.el does not display remaining time when using sysfs Date: Wed, 18 Apr 2012 02:37:21 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) After a kernel upgrade battery.el on a machine started using the sysfs backend instead of the acpi backend. That info displayed by default now is not very useful because it does not include "remaining time" like all the other backends do. I think this might be considered a regression, the display was more useful in the previous version than it is now. Here's a fix for that, and fix for the charge in a system with 2 batteries, when one of them is not in use. Please check this in the appropriate place. * battery.el (battery-echo-area-format): Display remaining time for the sysfs backend too. (battery-linux-sysfs): Fix conditional for the charge. === modified file 'lisp/battery.el' --- lisp/battery.el 2012-04-12 02:04:29 +0000 +++ lisp/battery.el 2012-04-16 16:29:43 +0000 @@ -78,7 +78,7 @@ introduced by a `%' character in a contr (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)") (battery-status-function @@ -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) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 20 03:33:13 2012 Received: (at 11269) by debbugs.gnu.org; 20 Apr 2012 07:33:13 +0000 Received: from localhost ([127.0.0.1]:43383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL8LB-0003wJ-2g for submit@debbugs.gnu.org; Fri, 20 Apr 2012 03:33:13 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:49386 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL8L8-0003wA-W2 for 11269@debbugs.gnu.org; Fri, 20 Apr 2012 03:33:11 -0400 Received: from [155.69.18.143] (port=50404 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SL8Kk-0005iE-CT; Fri, 20 Apr 2012 03:32:46 -0400 From: Chong Yidong To: Dan Nicolaescu Subject: Re: bug#11269: battery.el does not display remaining time when using sysfs References: Date: Fri, 20 Apr 2012 15:32:39 +0800 In-Reply-To: (Dan Nicolaescu's message of "Wed, 18 Apr 2012 02:37:21 -0400") Message-ID: <87ty0eeu3s.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11269 Cc: 11269@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) Dan Nicolaescu writes: > That info displayed by default now is not very useful because it does > not include "remaining time" like all the other backends do. > I think this might be considered a regression, the display was more > useful in the previous version than it is now. > > Here's a fix for that, and fix for the charge in a system with 2 > batteries, when one of them is not in use. > Please check this in the appropriate place. Thanks, committed to emacs-24. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 20 03:33:27 2012 Received: (at control) by debbugs.gnu.org; 20 Apr 2012 07:33:27 +0000 Received: from localhost ([127.0.0.1]:43386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL8LN-0003wi-Fs for submit@debbugs.gnu.org; Fri, 20 Apr 2012 03:33:26 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:49400 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SL8LK-0003wb-L9 for control@debbugs.gnu.org; Fri, 20 Apr 2012 03:33:23 -0400 Received: from [155.69.18.143] (port=50405 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SL8Kw-0005if-6M for control@debbugs.gnu.org; Fri, 20 Apr 2012 03:32:58 -0400 From: Chong Yidong To: control@debbugs.gnu.org Subject: close 11269 Date: Fri, 20 Apr 2012 15:32:52 +0800 Message-ID: <87lilqyi1n.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) close 11269 thanks From unknown Tue Jun 17 01:47:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 May 2012 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator