Emacs’ battery.el on FreeBSD fixed

enzu.ru
1 min readMar 13, 2019

--

A prefer FreeBSD to Linux due to anecdotal stability

I noticed on my FreeBSD -CURRENT laptop that display-battery-mode and fancy-battery-mode on Emacs were not working correctly.

I dug into the Lisp and determined that according to the man pages, the code was making some incorrect presumptions about FreeBSD’s apm command, assuming that it was much more like OpenBSD’s or NetBSD’s than it in fact was. Particularly, passing the non-existent -m flag was causing the apm call to fail altogether.

I submitted a patch to the emacs-devel@gnu.org mailing list that was gracefully critiqued and then committed by Stefan Monnier. If you’re using Emacs on a FreeBSD laptop, the latest master branch of Emacs should now have this battery functionality fixed.

--

--

enzu.ru
enzu.ru

Written by enzu.ru

Learning content for the GNU operating system and Lisp user space. (https://enzu.ru)

No responses yet