GNU bug report logs - #39491
28.0.50; two bugs in battery-upower

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: rms@HIDDEN; dated Fri, 7 Feb 2020 20:16:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added indication that bug 39491 blocks39202 Request was from Noam Postavsky <npostavs@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 39491 <at> debbugs.gnu.org:


Received: (at 39491) by debbugs.gnu.org; 8 Feb 2020 08:10:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 03:10:56 2020
Received: from localhost ([127.0.0.1]:50580 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j0LCa-0001R4-3i
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2020 03:10:56 -0500
Received: from mail-lf1-f45.google.com ([209.85.167.45]:44809)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lg.zevlg@HIDDEN>) id 1j0LCY-0001Qr-B5
 for 39491 <at> debbugs.gnu.org; Sat, 08 Feb 2020 03:10:54 -0500
Received: by mail-lf1-f45.google.com with SMTP id v201so877018lfa.11
 for <39491 <at> debbugs.gnu.org>; Sat, 08 Feb 2020 00:10:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=content-transfer-encoding:from:mime-version:subject:date:message-id
 :references:cc:in-reply-to:to;
 bh=fW4zy5lDz6+VT99UyeCqmvA95hOKYSCt8GrHVaRkfp0=;
 b=K5FkHoaFHr6iXdoV1tT9Ya5Gl8jfM2oCKBbDIIHv8XC1dt68pwHK38e6Gw41/iLOhC
 XMMvTJOHXbD02BiLhe/azXgoh11tSPg0mU8T1bIpB9Mbi76b5ZCOPpoHhY26B543+tw0
 X1Ozolm7yjv4CVGAvnV+5OUPDRItqmnw4e/gCJ5oJjibFJpoE1zvzfDRDaS66+ahQuxx
 IwFLipy5MSfp4BvVfdPgqY+JNPRkHU6F772CXNTJUjBBnVxpC24xi+znwGEq3R7ABA7n
 yOzec4HHrE4eCNmZQB01rGqwJpkA2gBHvhtYrOV6XfU0OrEjxQYHVafEVXN5HJAePV4y
 Neew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:content-transfer-encoding:from:mime-version
 :subject:date:message-id:references:cc:in-reply-to:to;
 bh=fW4zy5lDz6+VT99UyeCqmvA95hOKYSCt8GrHVaRkfp0=;
 b=tJ/Q4De0OPf2b2fxsMKcEudIk7Kl8b6LT4aNjv59OI47MtFGzvBp3+Fcy12h2XiZdD
 tDRRAceTTttSgxMoYzioB+UogYbwM/j38VCB+sQxMx/hA5ufiy9DcOUKYwE/VPpAJg4l
 GUSIBhGQH/r3PzTM8gpxGTDM8czsqQjDvWEdMeGv5z0lkys9sdOZIrlwT7dOi6TCa7h+
 7m8M8wtJmcnzB486mSM7UduUHrROiElA3c1QL6Vf5vUlRHEGjRfsinVkK+U5u1N6QXkS
 2ZDl/L+GxskF1sNOIraV4thNUWq5u/B73TAg+8/oREfyXgcJumi7m/EhWL5YwZrUL30E
 K7mA==
X-Gm-Message-State: APjAAAXLOC7qiYFJDnrcSp4Z8C3WEtJ1l2frASuCdQEYwRh2oqis3jyq
 D/YT+5y+99/0JiflETPt08E=
X-Google-Smtp-Source: APXvYqzq0QZ43vmQhSHL3421TfsaKvlvzDBPlP6QWMlqm/DP8UszUALMXiqIunq7BRPtvIcMPStcOQ==
X-Received: by 2002:ac2:42ca:: with SMTP id n10mr1502421lfl.215.1581149448349; 
 Sat, 08 Feb 2020 00:10:48 -0800 (PST)
Received: from [192.168.1.21] (5f44a299.dynamic.mv.ru. [95.68.162.153])
 by smtp.gmail.com with ESMTPSA id o69sm2238919lff.14.2020.02.08.00.10.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 08 Feb 2020 00:10:47 -0800 (PST)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: lg.zevlg@HIDDEN
Mime-Version: 1.0 (1.0)
Subject: Re: bug#39491: 28.0.50; two bugs in battery-upower
Date: Sat, 8 Feb 2020 12:10:46 +0400
Message-Id: <5A4C6466-FB4B-484F-BF29-91762AFB46F3@HIDDEN>
References: <83mu9tedsh.fsf@HIDDEN>
In-Reply-To: <83mu9tedsh.fsf@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
X-Mailer: iPad Mail (17D50)
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 39491
Cc: 39491 <at> debbugs.gnu.org, rms@HIDDEN,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


> 8 =D1=84=D0=B5=D0=B2=D1=80. 2020 =D0=B3., =D0=B2 11:31, Eli Zaretskii <eli=
z@HIDDEN> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0=B0):
>=20
> =EF=BB=BF
>>=20
>> From: Richard Stallman <rms@HIDDEN>
>> Date: Fri, 07 Feb 2020 15:14:57 -0500
>>=20
>>=20
>> battery-upower crashes on my laptop because there is no BatteryLevel prop=
erty.
>> This code
>>=20
>>          (cons ?b (cond ((=3D level 3) "-")
>>                         ((=3D level 4) "!")
>>                         (online-p "+")
>>                         (t "")))
>>=20
>> needs to handle nil.  I don't know what value it should return for that c=
ase.
>>=20

If level is unavailable and AC is off-line/unknown, then it should be empty s=
tring I think.  User could see the battery level is low/critical by percenta=
ge

>> However, that function has a design flaw: it reports on just the first
>> battery in the list.  battery-upower-device-list correctly returns a
>> list with an element for each battery, but battery-upower finds only one
>> of them (the first one in the list) and ignores the others.
>>=20
>> The old code handle all the batteries and added the energy quantities
>> so as to report accurately the total power available and overall
>> fraction of charge.  I wrote that code myself, around 10 years ago.
>>=20
>> Please restore the lost functionality.
>=20
> Evgeny, could you please look into fixing this?
>=20

OK, we should generalize multi-battery code then, so each status func won=E2=
=80=99t reimplement multi battery handling.

I=E2=80=99ll look at it tomorrow

> TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39491; Package emacs. Full text available.

Message received at 39491 <at> debbugs.gnu.org:


Received: (at 39491) by debbugs.gnu.org; 8 Feb 2020 07:31:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 08 02:31:29 2020
Received: from localhost ([127.0.0.1]:50571 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j0KaP-0000YA-O7
	for submit <at> debbugs.gnu.org; Sat, 08 Feb 2020 02:31:29 -0500
Received: from eggs.gnu.org ([209.51.188.92]:56771)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1j0KaN-0000Xx-GQ
 for 39491 <at> debbugs.gnu.org; Sat, 08 Feb 2020 02:31:27 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:42640)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1j0KaI-0004oX-2K; Sat, 08 Feb 2020 02:31:22 -0500
Received: from [176.228.60.248] (port=3500 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1j0KaA-0006Cm-2e; Sat, 08 Feb 2020 02:31:14 -0500
Date: Sat, 08 Feb 2020 09:30:54 +0200
Message-Id: <83mu9tedsh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Evgeny Zajcev <lg.zevlg@HIDDEN>
In-reply-to: <E1j0A1h-0000y8-MG@HIDDEN> (message from Richard
 Stallman on Fri, 07 Feb 2020 15:14:57 -0500)
Subject: Re: bug#39491: 28.0.50; two bugs in battery-upower
References: <E1j0A1h-0000y8-MG@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 39491
Cc: 39491 <at> debbugs.gnu.org, rms@HIDDEN,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> From: Richard Stallman <rms@HIDDEN>
> Date: Fri, 07 Feb 2020 15:14:57 -0500
> 
> 
> battery-upower crashes on my laptop because there is no BatteryLevel property.
> This code
> 
>           (cons ?b (cond ((= level 3) "-")
>                          ((= level 4) "!")
>                          (online-p "+")
>                          (t "")))
> 
> needs to handle nil.  I don't know what value it should return for that case.
> 
> However, that function has a design flaw: it reports on just the first
> battery in the list.  battery-upower-device-list correctly returns a
> list with an element for each battery, but battery-upower finds only one
> of them (the first one in the list) and ignores the others.
> 
> The old code handle all the batteries and added the energy quantities
> so as to report accurately the total power available and overall
> fraction of charge.  I wrote that code myself, around 10 years ago.
> 
> Please restore the lost functionality.

Evgeny, could you please look into fixing this?

TIA




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#39491; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Feb 2020 20:15:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 07 15:15:03 2020
Received: from localhost ([127.0.0.1]:50286 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1j0A1n-0005WE-C6
	for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 15:15:03 -0500
Received: from lists.gnu.org ([209.51.188.17]:49802)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1j0A1l-0005VQ-29
 for submit <at> debbugs.gnu.org; Fri, 07 Feb 2020 15:15:01 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:53971)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>) id 1j0A1j-0004dj-BF
 for bug-gnu-emacs@HIDDEN; Fri, 07 Feb 2020 15:15:00 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED,BAYES_50,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59326)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rms@HIDDEN>)
 id 1j0A1j-0004m8-71
 for bug-gnu-emacs@HIDDEN; Fri, 07 Feb 2020 15:14:59 -0500
Received: from rms by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rms@HIDDEN>)
 id 1j0A1h-0000y8-MG; Fri, 07 Feb 2020 15:14:57 -0500
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.0.50; two bugs in battery-upower
Message-Id: <E1j0A1h-0000y8-MG@HIDDEN>
Date: Fri, 07 Feb 2020 15:14:57 -0500
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


battery-upower crashes on my laptop because there is no BatteryLevel property.
This code

          (cons ?b (cond ((= level 3) "-")
                         ((= level 4) "!")
                         (online-p "+")
                         (t "")))

needs to handle nil.  I don't know what value it should return for that case.

However, that function has a design flaw: it reports on just the first
battery in the list.  battery-upower-device-list correctly returns a
list with an element for each battery, but battery-upower finds only one
of them (the first one in the list) and ignores the others.

The old code handle all the batteries and added the energy quantities
so as to report accurately the total power available and overall
fraction of charge.  I wrote that code myself, around 10 years ago.

Please restore the lost functionality.



In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.30, cairo version 1.14.6)
 of 2020-02-06 built on softly
Repository revision: c4be80112556e06bd7e92138e44051cc8c62e709
Repository branch: master
System Description: Trisquel GNU/Linux Flidas (8.0)

Recent messages:
(("NativePath" . "BAT0") ("Vendor" . "SANYO") ("Model" . "42T4832") ("Serial" . "19849") ("UpdateTime" . 1581079789) ("Type" . 2) ("PowerSupply" . t) ("HasHistory" . t) ("HasStatistics" . t) ("Online") ("Energy" . 35.21) ("EnergyEmpty" . 0.0) ("EnergyFull" . 35.21) ("EnergyFullDesign" . 43.29) ("EnergyRate" . 2.237) ("Voltage" . 12.504) ("Luminosity" . 0.0) ("TimeToEmpty" . 0) ("TimeToFull" . 0) ("Percentage" . 100.0) ("Temperature" . 0.0) ("IsPresent" . t) ("State" . 4) ("IsRechargeable" . t) ("Capacity" . 81.33518133518135) ("Technology" . 1) ("WarningLevel" . 1) ("IconName" . "battery-full-charged-symbolic"))
Back to top level
battery-upower
Saving file /home/rms/emacs-git/build-feb-6/lisp/battery.el...
Wrote /home/rms/emacs-git/build-feb-6/lisp/battery.el
Quit
Power on-line, battery fully-charged (100% load, remaining time 0:00)
Mark set [2 times]
(("line_power_AC" . :line-power) ("battery_BAT0" . :battery) ("battery_BAT1" . :battery))
completing-read-default: Command attempted to use minibuffer while in minibuffer
Quit
Configured using:
 'configure 'CFLAGS=-g -O0' --with-gnutls=no'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK2 X11 XDBE XIM MODULES THREADS PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  bug-reference-prog-mode: t
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow mailalias emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml mml-sec epa epg epg-config gnus-util rmail
rmail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils misearch
multi-isearch vc-git diff-mode easy-mmode bug-reference help-fns
radix-tree cl-print debug backtrace help-mode find-func battery dbus
xml t-mouse term/linux view derived paren cus-start cus-load advice
finder-inf package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese composite charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 84673 5995)
 (symbols 48 9669 1)
 (strings 32 27252 1051)
 (string-bytes 1 856458)
 (vectors 16 15529)
 (vector-slots 8 554003 72566)
 (floats 8 45 242)
 (intervals 56 545 268)
 (buffers 1000 12)
 (heap 1024 9701 932))
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]


-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Acknowledgement sent to rms@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#39491; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 26 Feb 2020 21:00:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.