GNU bug report logs -
#24537
25.1; battery.el on macOS Sierra 10.12
Previous Next
Reported by: Kevin Lin <lin.kevin.k <at> gmail.com>
Date: Sun, 25 Sep 2016 06:31:02 UTC
Severity: normal
Tags: patch
Found in version 25.1
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24537 in the body.
You can then email your comments to 24537 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Sun, 25 Sep 2016 06:31:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kevin Lin <lin.kevin.k <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 25 Sep 2016 06:31:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
display-battery-mode stopped working when I upgraded
from macOS 10.11 to 10.12. It appears the output of
`pmset -g ps` has changed, breaking pattern matching
in battery-pmset. Changing the line
(looking-at "\\([0-9]\\{1,3\\}\\)%")
in battery-pmset to
(re-search-forward "\\([0-9]\\{1,3\\}\\)%")
fixes the problem, at least on my machine.
Cheers,
Kevin
In GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F1911))
of 2016-09-17 built on builder10-9.porkrind.org
Windowing system distributor 'Apple', version 10.3.1504
Configured using:
'configure --with-ns
'--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp''
Configured features:
NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix
Major mode: Org-Agenda 28 days Ddl Grid
Minor modes in effect:
shell-dirtrack-mode: t
display-battery-mode: t
display-time-mode: t
iswitchb-mode: t
tooltip-mode: t
global-eldoc-mode: t
mouse-wheel-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Recent messages:
Warning: symbolic link to Git-controlled source file
Word wrapping enabled
Warning: symbolic link to Git-controlled source file
Word wrapping enabled
Warning: symbolic link to Git-controlled source file
Word wrapping enabled [2 times]
‘working-revision’ not found: using the old ‘workfile-version’ instead
Word wrapping enabled
‘working-revision’ not found: using the old ‘workfile-version’ instead
For information about GNU Emacs and the GNU system, type C-h C-a.
Load-path shadows:
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-view
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-view
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-util
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-util
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-tools
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-tools
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-sync
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-sync
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-outline
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-outline
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-occur
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-occur
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-misc
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-misc
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-links
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-links
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-isearch
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-isearch
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-info
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-info
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-history
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-history
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-dev
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-dev
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-cache
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-cache
/Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.60/elpa/pdf-annot
hides /Applications/Emacs.app/Contents/Resources/site-lisp/pdf-tools/0.70/share/emacs/site-lisp/pdf-tools/pdf-annot
~/elisp/vc-git hides /Applications/Emacs.app/Contents/Resources/lisp/vc/vc-git
~/elisp/iswitchb hides
/Applications/Emacs.app/Contents/Resources/lisp/obsolete/iswitchb
Features:
(shadow sort mail-extr emacsbug message rfc822 mml
mml-sec epg mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mail-utils diary-lib
diary-loaddefs cal-iso org-indent vc-git org-element
org-rmail org-mhe org-irc org-info org-gnus
org-docview doc-view subr-x dired org-bibtex bibtex
org-bbdb org-w3m org-agenda pdf-tools cus-edit
cus-start cus-load wid-edit pdf-view jka-compr
pdf-cache pdf-info tq pdf-util image-mode julia-mode
derived ert pp ewoc debug rx ido ess-toolbar ess-mouse
mouseme thingatpt browse-url ess-menu ess-swv
ess-noweb ess-noweb-font-lock-mode ess-bugs-l essd-els
ess-sas-d ess-sas-l ess-sas-a ess-sta-d ess-sta-l
cc-vars cc-defs make-regexp ess-sp6-d ess-sp3-d
ess-julia ess-r-d ess-r-completion ess-tracebug
compile tramp tramp-compat auth-source cl-seq eieio
eieio-core gnus-util mm-util help-fns mail-prsvr
password-cache tramp-loaddefs trampver shell ess-roxy
advice hideshow ess-help info reporter ess-developer
ess-s-l speedbar sb-image ezimage dframe ess ess-inf
cl-macs ess-mode ess-noweb-mode edmacro kmacro
ess-utils cl ess-custom executable ess-compat ess-site
battery time iswitchb org org-macro org-footnote
org-pcomplete pcomplete org-list org-faces
org-entities noutline outline easy-mmode org-version
ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-src ob-keys ob-comint ob-core ob-eval
org-compat org-macs org-loaddefs format-spec find-func
cal-menu calendar cal-loaddefs cmuscheme comint
ansi-color ring scheme server finder-inf package
epg-config seq byte-opt gv bytecomp byte-compile
cl-extra help-mode easymenu cconv cl-loaddefs pcase
cl-lib time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel
ns-win ucs-normalize term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list
newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese
eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote kqueue cocoa ns
multi-tty make-network-process emacs)
Memory information:
((conses 16 505649 23267)
(symbols 48 38900 0)
(miscs 40 6194 3745)
(strings 32 79704 13110)
(string-bytes 1 2519115)
(vectors 16 49906)
(vector-slots 8 854589 2388)
(floats 8 399 18)
(intervals 56 3640 0)
(buffers 976 75))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Wed, 28 Sep 2016 21:37:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 24537 <at> debbugs.gnu.org (full text, mbox):
Kevin Lin <lin.kevin.k <at> gmail.com> writes:
> display-battery-mode stopped working when I upgraded
> from macOS 10.11 to 10.12. It appears the output of
> `pmset -g ps` has changed, breaking pattern matching
> in battery-pmset.
Hi, could you perhaps provide an example of the output of that command
in 10.12? I'm still on 10.11 and would like to compare it.
--
Alan Third
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Thu, 29 Sep 2016 06:51:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 24537 <at> debbugs.gnu.org (full text, mbox):
Hi Alan,
Of course! Here it is from my machine running 10.12:
% pmset -g ps
Now drawing from 'Battery Power'
-InternalBattery-0 (id=3997795) 54%; discharging; 1:27 remaining present: true
And from another machine still on 10.11:
Now drawing from 'Battery Power'
-InternalBattery-0 36%; discharging; 1:00 remaining present: true
Cheers,
Kevin
On Wed, Sep 28, 2016 at 2:36 PM, Alan Third <alan <at> idiocy.org> wrote:
> Kevin Lin <lin.kevin.k <at> gmail.com> writes:
>
>> display-battery-mode stopped working when I upgraded
>> from macOS 10.11 to 10.12. It appears the output of
>> `pmset -g ps` has changed, breaking pattern matching
>> in battery-pmset.
>
> Hi, could you perhaps provide an example of the output of that command
> in 10.12? I'm still on 10.11 and would like to compare it.
> --
> Alan Third
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Thu, 29 Sep 2016 19:32:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 24537 <at> debbugs.gnu.org (full text, mbox):
* lisp/battery.el (battery-pmset): Recognise and ignore battery id if
present in output.
---
lisp/battery.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/battery.el b/lisp/battery.el
index 1b58489..90e4f5a 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -625,7 +625,7 @@ battery-pmset
(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))
--
Hi Kevin,
Can you give this patch a go?
--
Alan Third
Added tag(s) patch.
Request was from
Alan Third <alan <at> idiocy.org>
to
control <at> debbugs.gnu.org
.
(Thu, 29 Sep 2016 19:32:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Thu, 29 Sep 2016 22:03:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 24537 <at> debbugs.gnu.org (full text, mbox):
On Thu, Sep 29, 2016 at 3:31 PM, Alan Third <alan <at> idiocy.org> wrote:
> + (when (re-search-forward "^ -InternalBattery-0\\([ \t]+\(id\=[0-9]+\)\\)*[ \t]+" nil t)
Using "\(id\=[0-9]+\)" instead of the equivalent "(id=[0-9]+)" is a
bit confusing.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Thu, 29 Sep 2016 22:10:01 GMT)
Full text and
rfc822 format available.
Message #22 received at 24537 <at> debbugs.gnu.org (full text, mbox):
On Thu, Sep 29, 2016 at 06:02:36PM -0400, Noam Postavsky wrote:
> On Thu, Sep 29, 2016 at 3:31 PM, Alan Third <alan <at> idiocy.org> wrote:
> > + (when (re-search-forward "^ -InternalBattery-0\\([ \t]+\(id\=[0-9]+\)\\)*[ \t]+" nil t)
>
> Using "\(id\=[0-9]+\)" instead of the equivalent "(id=[0-9]+)" is a
> bit confusing.
Ah, I thought they had to be escaped because they’re special
characters. It seems I was wrong. Thanks. :)
I’ve removed the three extra slashes, do you want me to repost the
patch?
--
Alan Third
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Thu, 29 Sep 2016 22:18:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 24537 <at> debbugs.gnu.org (full text, mbox):
On Thu, Sep 29, 2016 at 6:09 PM, Alan Third <alan <at> idiocy.org> wrote:
> I’ve removed the three extra slashes, do you want me to repost the
> patch?
I don't have any more comments for you. Apart from the slashes, it
looks okay (I don't run OSX, so I can't confirm if it works).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#24537
; Package
emacs
.
(Fri, 30 Sep 2016 03:31:01 GMT)
Full text and
rfc822 format available.
Message #28 received at 24537 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Yup it works. Thank you both!
-Kevin
On Thursday, September 29, 2016, Noam Postavsky <
npostavs <at> users.sourceforge.net> wrote:
> On Thu, Sep 29, 2016 at 6:09 PM, Alan Third <alan <at> idiocy.org
> <javascript:;>> wrote:
> > I’ve removed the three extra slashes, do you want me to repost the
> > patch?
>
> I don't have any more comments for you. Apart from the slashes, it
> looks okay (I don't run OSX, so I can't confirm if it works).
>
[Message part 2 (text/html, inline)]
Reply sent
to
Alan Third <alan <at> idiocy.org>
:
You have taken responsibility.
(Fri, 30 Sep 2016 21:43:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Kevin Lin <lin.kevin.k <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 30 Sep 2016 21:43:01 GMT)
Full text and
rfc822 format available.
Message #33 received at 24537-done <at> debbugs.gnu.org (full text, mbox):
On Thu, Sep 29, 2016 at 08:30:02PM -0700, Kevin Lin wrote:
> Yup it works. Thank you both!
> -Kevin
>
> On Thursday, September 29, 2016, Noam Postavsky <
> npostavs <at> users.sourceforge.net> wrote:
>
> > On Thu, Sep 29, 2016 at 6:09 PM, Alan Third <alan <at> idiocy.org
> > <javascript:;>> wrote:
> > > I’ve removed the three extra slashes, do you want me to repost the
> > > patch?
> >
> > I don't have any more comments for you. Apart from the slashes, it
> > looks okay (I don't run OSX, so I can't confirm if it works).
> >
Pushed to master.
--
Alan Third
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 29 Oct 2016 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 291 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.