emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix battery information on FreeBSD


From: Stefan Monnier
Subject: Re: [PATCH] Fix battery information on FreeBSD
Date: Mon, 11 Mar 2019 22:48:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>    (let* ((os-name (car (split-string
>              (shell-command-to-string "/usr/bin/uname"))))
> -     (apm-flag (if (equal os-name "OpenBSD") "P" "s"))
> -     (apm-cmd (concat "/usr/sbin/apm -ablm" apm-flag))
> +     (apm-flag (if (equal os-name "OpenBSD") "Pm"))
> +     (apm-flag (if (equal os-name "NetBSD") "sm"))
> +     (apm-flag (if (equal os-name "FreeBSD") "st"))

This can't be right: with the above apm-flag will be nil except on
FreeBSD (since the last apm-flag hides the previous ones).

You probably want

        (apm-flag (pcase os-name
                    ("OpenBSD" "Pm")
                    ("FreeBSD" "st")
                    (_         "sm")))

instead.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]