From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#39491: 28.0.50; two bugs in battery-upower Date: Fri, 07 Feb 2020 15:14:57 -0500 Message-ID: Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="80899"; mail-complaints-to="usenet@ciao.gmane.io" To: 39491@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 07 21:17:32 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0A4C-000KtT-Ky for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Feb 2020 21:17:32 +0100 Original-Received: from localhost ([::1]:34806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0A4B-0007Hx-I5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Feb 2020 15:17:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0A2p-0005NZ-Nu for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:16:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0A2k-0006IF-Pu for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:16:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0A2k-0006I3-Hg for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j0A2k-0006KL-By for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Feb 2020 20:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39491 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158110650321333 (code B ref -1); Fri, 07 Feb 2020 20:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Feb 2020 20:15:03 +0000 Original-Received: from localhost ([127.0.0.1]:50286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0A1n-0005WE-C6 for submit@debbugs.gnu.org; Fri, 07 Feb 2020 15:15:03 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0A1l-0005VQ-29 for submit@debbugs.gnu.org; Fri, 07 Feb 2020 15:15:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53971) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0A1j-0004dj-BF for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:15:00 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:59326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j0A1j-0004m8-71 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 15:14:59 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1j0A1h-0000y8-MG; 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175757 Archived-At: 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)