unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: lg.zevlg@gmail.com
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39491@debbugs.gnu.org, rms@gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#39491: 28.0.50; two bugs in battery-upower
Date: Sat, 8 Feb 2020 12:10:46 +0400	[thread overview]
Message-ID: <5A4C6466-FB4B-484F-BF29-91762AFB46F3@gmail.com> (raw)
In-Reply-To: <83mu9tedsh.fsf@gnu.org>


> 8 февр. 2020 г., в 11:31, Eli Zaretskii <eliz@gnu.org> написал(а):
> 
> 
>> 
>> From: Richard Stallman <rms@gnu.org>
>> 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.
>> 

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

>> 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?
> 

OK, we should generalize multi-battery code then, so each status func won’t reimplement multi battery handling.

I’ll look at it tomorrow

> TIA





  reply	other threads:[~2020-02-08  8:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 20:14 bug#39491: 28.0.50; two bugs in battery-upower Richard Stallman
2020-02-08  7:30 ` Eli Zaretskii
2020-02-08  8:10   ` lg.zevlg [this message]
2020-03-21 10:45     ` Nicolas Richard
2020-04-26 14:47     ` Eli Zaretskii
2020-04-26 15:44       ` Evgeny Zajcev
2020-04-26 16:53         ` Eli Zaretskii
2020-05-26 16:23           ` Eli Zaretskii
2020-05-26 16:42             ` Evgeny Zajcev
2020-05-26 16:45               ` Eli Zaretskii
2020-05-26 17:42                 ` Stefan Monnier
2020-05-26 17:47                   ` lg.zevlg
2020-05-27  3:19                     ` Richard Stallman
2020-05-27  3:19                   ` Richard Stallman
2020-05-27 13:59                     ` Stefan Monnier
2020-05-28  3:15                       ` Richard Stallman
2020-06-11 15:58                         ` Basil L. Contovounesios
2020-06-11 18:17                           ` Michael Albinus
2020-06-11 19:41                             ` Basil L. Contovounesios
2020-06-18 15:48                           ` Basil L. Contovounesios

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=5A4C6466-FB4B-484F-BF29-91762AFB46F3@gmail.com \
    --to=lg.zevlg@gmail.com \
    --cc=39491@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).