Skip to content

Commit cf14fa0

Browse files
committed
* lisp/battery.el: Use lexical-binding. Drop Redundant :groups.
1 parent d8f4317 commit cf14fa0

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

lisp/battery.el

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
;;; battery.el --- display battery status information
1+
;;; battery.el --- display battery status information -*- lexical-binding:t -*-
22

33
;; Copyright (C) 1997-1998, 2000-2020 Free Software Foundation, Inc.
44

55
;; Author: Ralph Schleicher <[email protected]>
6+
;; Maintainer: [email protected]
67
;; Keywords: hardware
78

89
;; This file is part of GNU Emacs.
@@ -22,12 +23,14 @@
2223

2324
;;; Commentary:
2425

25-
;; There is at present support for GNU/Linux, macOS and Windows. This
26-
;; library supports UPower (https://upower.freedesktop.org) via D-Bus
27-
;; API or the `/proc/apm' file format of Linux version 1.3.58 or newer
28-
;; and the `/proc/acpi/' directory structure of Linux 2.4.20 and 2.6.
29-
;; Darwin (macOS) is supported by using the `pmset' program. Windows
30-
;; is supported by the GetSystemPowerStatus API call.
26+
;; There is at present support for GNU/Linux, macOS, and Windows.
27+
;; This library supports:
28+
;; - UPower (https://upower.freedesktop.org) via D-Bus API.
29+
;; - the `/sys/class/power_supply/' files of Linux >= 2.6.39.
30+
;; - the `/proc/acpi/' directory structure of Linux 2.4.20 and 2.6.
31+
;; - the `/proc/apm' file format of Linux version 1.3.58 or newer.
32+
;; - Darwin (macOS) by using the `pmset' program.
33+
;; - Windows via the GetSystemPowerStatus API call.
3134

3235
;;; Code:
3336

@@ -45,16 +48,14 @@
4548
Use `battery-upower-device-list' to list all available UPower devices.
4649
If set to nil, then autodetect `:battery' device."
4750
:version "28.1"
48-
:type '(choice string (const :tag "Autodetect" nil))
49-
:group 'battery)
51+
:type '(choice string (const :tag "Autodetect" nil)))
5052

5153
(defcustom battery-upower-line-power-device nil
5254
"UPower device of the `:line-power' type.
5355
Use `battery-upower-device-list' to list all available UPower devices.
5456
If set to nil, then autodetect `:battery' device."
5557
:version "28.1"
56-
:type '(choice string (const :tag "Autodetect" nil))
57-
:group 'battery)
58+
:type '(choice string (const :tag "Autodetect" nil)))
5859

5960
(defconst battery-upower-dbus-service "org.freedesktop.UPower"
6061
"Well-known UPower service name for the D-Bus system.")
@@ -101,8 +102,7 @@ Its cons cells are of the form
101102
102103
CONVERSION is the character code of a \"conversion specification\"
103104
introduced by a `%' character in a control string."
104-
:type '(choice (const nil) function)
105-
:group 'battery)
105+
:type '(choice (const nil) function))
106106

107107
(defcustom battery-echo-area-format
108108
"Power %L, battery %B (%p%% load, remaining time %t)"
@@ -122,8 +122,7 @@ string are substituted as defined by the current value of the variable
122122
%m Remaining time (to charge or discharge) in minutes
123123
%h Remaining time (to charge or discharge) in hours
124124
%t Remaining time (to charge or discharge) in the form `h:min'"
125-
:type '(choice string (const nil))
126-
:group 'battery)
125+
:type '(choice string (const nil)))
127126

128127
(defvar battery-mode-line-string nil
129128
"String to display in the mode line.")
@@ -132,8 +131,7 @@ string are substituted as defined by the current value of the variable
132131
(defcustom battery-mode-line-limit 100
133132
"Percentage of full battery load below which display battery status."
134133
:version "24.1"
135-
:type 'integer
136-
:group 'battery)
134+
:type 'integer)
137135

138136
(defcustom battery-mode-line-format
139137
(cond ((eq battery-status-function 'battery-linux-proc-acpi)
@@ -156,25 +154,21 @@ string are substituted as defined by the current value of the variable
156154
%m Remaining time (to charge or discharge) in minutes
157155
%h Remaining time (to charge or discharge) in hours
158156
%t Remaining time (to charge or discharge) in the form `h:min'"
159-
:type '(choice string (const nil))
160-
:group 'battery)
157+
:type '(choice string (const nil)))
161158

162159
(defcustom battery-update-interval 60
163160
"Seconds after which the battery status will be updated."
164-
:type 'integer
165-
:group 'battery)
161+
:type 'integer)
166162

167163
(defcustom battery-load-low 25
168164
"Upper bound of low battery load percentage.
169165
A battery load percentage below this number is considered low."
170-
:type 'integer
171-
:group 'battery)
166+
:type 'integer)
172167

173168
(defcustom battery-load-critical 10
174169
"Upper bound of critical battery load percentage.
175170
A battery load percentage below this number is considered critical."
176-
:type 'integer
177-
:group 'battery)
171+
:type 'integer)
178172

179173
(defvar battery-update-timer nil
180174
"Interval timer object.")
@@ -198,7 +192,7 @@ The text displayed in the mode line is controlled by
198192
`battery-mode-line-format' and `battery-status-function'.
199193
The mode line is be updated every `battery-update-interval'
200194
seconds."
201-
:global t :group 'battery
195+
:global t
202196
(setq battery-mode-line-string "")
203197
(or global-mode-string (setq global-mode-string '("")))
204198
(and battery-update-timer (cancel-timer battery-update-timer))

0 commit comments

Comments
 (0)