emacs-devel
[Top][All Lists]
Advanced

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

Re: master 6b11687555c: New user option native-comp-async-on-battery-pow


From: Eli Zaretskii
Subject: Re: master 6b11687555c: New user option native-comp-async-on-battery-power
Date: Fri, 02 May 2025 15:01:45 +0300

> branch: master
> commit 6b11687555cdd1d6896bad5eb09af217b28d6076
> Author: Sean Whitton <spwhitton@spwhitton.name>
> Commit: Sean Whitton <spwhitton@spwhitton.name>
> 
>     New user option native-comp-async-on-battery-power
>     
>     * lisp/emacs-lisp/comp-run.el
>     (native-comp-async-on-battery-power): New option.
>     (battery-status-function): Declare.
>     (native--compile-skip-on-battery-p): New function.
>     (comp--run-async-workers): Call it.
>     * etc/NEWS: Announce the new option.

Thanks, but AFAIU this change is not general enough.  It assumes that
when a laptop us plugged in, the %L format descriptor returns a string
"on-line".  But AFAICT this is not always so.  The following
implementations in battery.el seem to return different strings for %L:

  battery-pmset (returns "AC")
  battery-android (returns "on-line SOMETHING")
  battery-bsd-apm (returns "connected")
  battery-linux-sysfs (returns whatever it finds in
    "/sys/class/power_supply/AC/online" and other files)
  battery-linux-proc-acpi (returns whatever it find in
    "/proc/acpi/ac_adapter/*/state" file)

So I think we need a more general solution which will work for all the
supported back-ends of battery.el.



reply via email to

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