]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compatibility with macOS 10.12 pmset (bug#24537)
authorAlan Third <alan@idiocy.org>
Thu, 29 Sep 2016 19:22:00 +0000 (20:22 +0100)
committerAlan Third <alan@idiocy.org>
Fri, 30 Sep 2016 20:43:38 +0000 (21:43 +0100)
* lisp/battery.el (battery-pmset): Recognise and ignore battery id if
present in output.

lisp/battery.el

index 1b58489161e9dd995940aad5535748b8794cf543..e6e79b06bab4eab294db026e9060a5a19ec454ba 100644 (file)
@@ -625,7 +625,7 @@ The following %-sequences are provided:
       (goto-char (point-min))
       (when (re-search-forward "\\(?:Currentl?y\\|Now\\) drawing from '\\(AC\\|Battery\\) Power'" nil t)
        (setq power-source (match-string 1))
-       (when (re-search-forward "^ -InternalBattery-0[ \t]+" nil t)
+       (when (re-search-forward "^ -InternalBattery-0\\([ \t]+(id=[0-9]+)\\)*[ \t]+" nil t)
          (when (looking-at "\\([0-9]\\{1,3\\}\\)%")
            (setq load-percentage (match-string 1))
            (goto-char (match-end 0))