emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 934549e: Extend battery.el to exotic power supply t


From: Eli Zaretskii
Subject: [Emacs-diffs] master 934549e: Extend battery.el to exotic power supply types
Date: Sat, 16 Apr 2016 11:41:05 +0000

branch: master
commit 934549e23d6bda5231375dbfed7b42a966c85d14
Author: Matthew Leach <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Extend battery.el to exotic power supply types
    
    * lisp/battery.el (battery-linux-sysfs-regexp): Rename from
    'battery--linux-sysfs-regexp' and make a defcustom. All users
    changed.  (Bug#23216)
---
 lisp/battery.el |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/battery.el b/lisp/battery.el
index b5e312f..1b58489 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -38,8 +38,12 @@
   :prefix "battery-"
   :group 'hardware)
 
-;; Either BATn or yeeloong-bat, basically.
-(defconst battery--linux-sysfs-regexp "[bB][aA][tT][0-9]?$")
+(defcustom battery-linux-sysfs-regexp "[bB][aA][tT][0-9]?$"
+  "Regexp for folder names to be searched under
+  /sys/class/power_supply/ that contain battery information."
+  :version "25.2"
+  :type 'regexp
+  :group 'battery)
 
 (defcustom battery-status-function
   (cond ((and (eq system-type 'gnu/linux)
@@ -51,7 +55,7 @@
        ((and (eq system-type 'gnu/linux)
              (file-directory-p "/sys/class/power_supply/")
              (directory-files "/sys/class/power_supply/" nil
-                               battery--linux-sysfs-regexp))
+                               battery-linux-sysfs-regexp))
         #'battery-linux-sysfs)
        ((and (eq system-type 'berkeley-unix)
              (file-executable-p "/usr/sbin/apm"))
@@ -445,7 +449,7 @@ The following %-sequences are provided:
       (dolist (dir (ignore-errors
                    (directory-files
                     "/sys/class/power_supply/" t
-                     battery--linux-sysfs-regexp)))
+                     battery-linux-sysfs-regexp)))
        (erase-buffer)
        (ignore-errors (insert-file-contents
                        (expand-file-name "uevent" dir)))



reply via email to

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