From a7414f18598bab861f3fef307efd0b8e15cb6ebe Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 24 May 2026 11:46:47 +0100 Subject: [PATCH] native--compile-skip-on-battery-p: Try to fix ?b, ?B conditions * lisp/emacs-lisp/comp-run.el (native--compile-skip-on-battery-p): Don't skip charging because the battery is charging, and don't look for "discharging", at least for now (bug#80922). Thanks to David Koppelman for the report. --- lisp/emacs-lisp/comp-run.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/comp-run.el b/lisp/emacs-lisp/comp-run.el index f329d627392..64e20327906 100644 --- a/lisp/emacs-lisp/comp-run.el +++ b/lisp/emacs-lisp/comp-run.el @@ -203,9 +203,10 @@ LOAD and SELECTOR work as described in `native--compile-async'." ;; because power users often configure their batteries ;; to stop charging at less than 100% as a way to ;; extend the lifetime of their battery hardware. - (string= (cdr (assq ?b res)) "+") - (member (cdr (assq ?B res)) '("charging" "pending-charge")) - (not (string= (cdr (assq ?B res)) "discharging"))))))) + ;; Further discussion in bug#80922. + (and (not (equal (cdr (assq ?b res)) "+")) + (not (member (cdr (assq ?B res)) + '("charging" "pending-charge"))))))))) (defvar comp-files-queue () "List of Emacs Lisp files to be compiled.")