Subject: 24.4.50; battery-pmset fails to report critical battery state

From: Sebastian Wiesner <[email-masked]>
Date: Thu, 31 Jul 2014 15:16:44 +0200

`battery-pmset' fails to correctly report critical battery state:  Even
if the battery charge level is below `battery-load-critical', it reports
"low" battery state only.

The culprit is the `cond' expression in the body of `battery-pmset'
which compares the reported `load-percentage' against `battery-load-low'
first, and then against `battery-load-critical'.

Since the latter is typically lower, it will never be reached, because
`cond' already returns after the former succeeded.

To fix this issue, `batter-pmset' needs to check `battery-load-critical'
*first*, and then `battery-load-low'.