; * lisp/battery.el (battery-bsd-apm): No need for `executable-find'.

This commit is contained in:
Manuel Giraud 2022-10-06 16:03:34 +02:00 committed by Stefan Kangas
parent 0c65c9dfb3
commit 8c8a54dd23

View file

@ -938,16 +938,14 @@ The following %-sequences are provided:
%t Remaining time (to charge or discharge) in the form `h:min'"
(let* ((os-name (car (split-string
;; FIXME: Can't we use something like `system-type'?
(battery--call-process-to-string
(executable-find "uname")))))
(battery--call-process-to-string "uname"))))
(apm-flag (pcase os-name
("OpenBSD" "mP")
("FreeBSD" "st")
(_ "ms")))
(apm-args (concat "-abl" apm-flag))
(apm-output (split-string
(battery--call-process-to-string
(executable-find "apm") apm-args)))
(battery--call-process-to-string "apm" apm-args)))
(indices (pcase os-name
;; FreeBSD's manpage documents that multiple
;; outputs are ordered by "the order in which