GNU bug report logs - #24919
24.5; battery.el not working in FreeBSD

Previous Next

Package: emacs;

Reported by: Ignacio Torres <i <at> itorres.net>

Date: Thu, 10 Nov 2016 16:49:02 UTC

Severity: normal

Tags: patch

Found in version 24.5

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Kangas <stefan <at> marxist.se>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24919: closed (24.5; battery.el not working in FreeBSD)
Date: Mon, 11 Nov 2019 03:27:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Mon, 11 Nov 2019 04:26:13 +0100
with message-id <877e47qeju.fsf <at> marxist.se>
and subject line Re: bug#24919: 24.5; battery.el not working in FreeBSD
has caused the debbugs.gnu.org bug report #24919,
regarding 24.5; battery.el not working in FreeBSD
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24919: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24919
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Ignacio Torres <i <at> itorres.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; battery.el not working in FreeBSD
Date: Sun, 18 Sep 2016 01:17:26 +0200
Running M-x battery in FreeBSD returns:

Power disconnected, battery high (illegal% load, remaining time 0:00)

The battery-bsd-apm function was contributed in [1]. It contains:

(apm-cmd (concat "/usr/sbin/apm -ablm" apm-flag))

The -m flag used in NetBSD[2] and OpenBSD[3] to show the remaining time
in minutes does not exist in FreeBSD[4]. Instead -t should be used to
show the remaining time in seconds.

Also the resulting output is in a different order than that expected by
the parser. battery-bsd-apm expects the order to be:

battery-status
battery-percentage
battery-life
line-status
apm-mode

In FreeBSD it is:

line-status
battery-status
battery-percentage
apm-mode
battery-life

As can be seen in the source of /usr/sbin/apm.c[5]

[1] http://git.savannah.gnu.org/cgit/emacs.git/commit/lisp/battery.el?id=19b748ad448c37d08ae1df1212aec22ee1d55956
[2] http://netbsd.gw.com/cgi-bin/man-cgi?apm++NetBSD-current
[3] http://man.openbsd.org/OpenBSD-current/man8/amd64/apm.8
[4] https://www.freebsd.org/cgi/man.cgi?query=apm&manpath=FreeBSD+10.3-RELEASE+and+Ports
[5] https://svnweb.freebsd.org/base/stable/11/usr.sbin/apm/apm.c?revision=302408&view=markup#l472



In GNU Emacs 24.5.1 (amd64-portbld-freebsd12.0, GTK+ Version 2.24.29)
 of 2016-08-27 on builds.trueos.org
Windowing system distributor `The X.Org Foundation', version 11.0.11804000
Configured using:
 `configure --localstatedir=/var --disable-acl --with-dbus
 --without-file-notification --with-gconf --with-gif --with-gnutls
 --with-gsettings --with-jpeg --with-m17n-flt --with-imagemagick
 --with-libotf --with-png --with-toolkit-scroll-bars --with-rsvg
 --with-tiff --with-x --with-xft --with-xim --with-xml2 --with-xpm
 --with-x-toolkit=gtk2 --with-sound=oss --x-libraries=/usr/local/lib
 --x-includes=/usr/local/include --prefix=/usr/local
 --mandir=/usr/local/man --infodir=/usr/local/share/emacs/info/
 --build=amd64-portbld-freebsd12.0 'CFLAGS=-O2 -pipe -isystem
 /usr/local/include -fstack-protector -fno-strict-aliasing'
 'CPPFLAGS=-isystem /usr/local/include' 'LDFLAGS= -L/usr/local/lib
 -Wl,-rpath=/usr/lib:/usr/local/lib -fstack-protector''

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


[Message part 3 (message/rfc822, inline)]
From: Stefan Kangas <stefan <at> marxist.se>
To: Joseph Mingrone <jrm <at> ftfl.ca>
Cc: Ignacio Torres <i <at> itorres.net>, Alan Third <alan <at> idiocy.org>,
 24919-done <at> debbugs.gnu.org, Joakim Jalap <joakim.jalap <at> fastmail.com>
Subject: Re: bug#24919: 24.5; battery.el not working in FreeBSD
Date: Mon, 11 Nov 2019 04:26:13 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Joseph Mingrone <jrm <at> ftfl.ca> writes:
>
>> I don't see any commits related to this bug/patch, but I just tested M-x
>> battery in an Emacs master branch build (604a985) on FreeBSD 12.0 and
>> the output looks correct.
>>
>> Here is some example output.
>>
>> Power connected, battery high (100% load, remaining time N/A)
>> Power disconnected, battery high (100% load, remaining time 4:21)
>> Power disconnected, battery high (99% load, remaining time 3:30)
>
> Thanks.  Does that mean that the patch is not necessary for FreeBSD?
>
> Is there anyone that could help test this also on OpenBSD?

I re-read the original report, and it seems like I misread: this was
*not* an issue on OpenBSD, and should therefore need no further
testing here.

Since Joseph has helped confirm that things are now working also on
FreeBSD, and no one else has commented in 3.5 weeks, I'll go ahead and
close this bug.

If anyone is still seeing issues with M-x battery on any *BSD system,
please reopen the bug report.

Best regards,
Stefan Kangas


This bug report was last modified 5 years and 246 days ago.

Previous Next


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