comparison lisp/battery.el @ 21088:ac1673121774

Customized.
author Stephen Eglen <stephen@gnu.org>
date Sat, 07 Mar 1998 18:19:38 +0000
parents dc82196eac58
children 566100bc6eef
comparison
equal deleted inserted replaced
21087:c297faa167f5 21088:ac1673121774
31 ;;; Code: 31 ;;; Code:
32 32
33 (require 'timer) 33 (require 'timer)
34 34
35 35
36 (defvar battery-status-function 36
37 (defgroup battery nil
38 "Display battery status information."
39 :prefix "battery-"
40 :group 'hardware)
41
42 (defcustom battery-status-function
37 (cond ((and (eq system-type 'gnu/linux) 43 (cond ((and (eq system-type 'gnu/linux)
38 (file-readable-p "/proc/apm")) 44 (file-readable-p "/proc/apm"))
39 'battery-linux-proc-apm)) 45 'battery-linux-proc-apm))
40 "*Function for getting battery status information. 46 "*Function for getting battery status information.
41 The function have to return an alist of conversion definitions. 47 The function have to return an alist of conversion definitions.
42 Cons cells are of the form 48 Cons cells are of the form
43 49
44 (CONVERSION . REPLACEMENT-TEXT) 50 (CONVERSION . REPLACEMENT-TEXT)
45 51
46 CONVERSION is the character code of a \"conversion specification\" 52 CONVERSION is the character code of a \"conversion specification\"
47 introduced by a `%' character in a control string.") 53 introduced by a `%' character in a control string."
48 54 :type 'function
49 (defvar battery-echo-area-format 55 :group 'battery)
56
57 (defcustom battery-echo-area-format
50 (cond ((eq battery-status-function 'battery-linux-proc-apm) 58 (cond ((eq battery-status-function 'battery-linux-proc-apm)
51 "Power %L, battery %B (%p%% load, remaining time %t)")) 59 "Power %L, battery %B (%p%% load, remaining time %t)"))
52 "*Control string formatting the string to display in the echo area. 60 "*Control string formatting the string to display in the echo area.
53 Ordinary characters in the control string are printed as-is, while 61 Ordinary characters in the control string are printed as-is, while
54 conversion specifications introduced by a `%' character in the control 62 conversion specifications introduced by a `%' character in the control
55 string are substituted as defined by the current value of the variable 63 string are substituted as defined by the current value of the variable
56 `battery-status-function'.") 64 `battery-status-function'."
65 :type '(choice string (const nil))
66 :group 'battery)
57 67
58 (defvar battery-mode-line-string nil 68 (defvar battery-mode-line-string nil
59 "String to display in the mode line.") 69 "String to display in the mode line.")
60 70
61 (defvar battery-mode-line-format 71 (defcustom battery-mode-line-format
62 (cond ((eq battery-status-function 'battery-linux-proc-apm) 72 (cond ((eq battery-status-function 'battery-linux-proc-apm)
63 " [%b%p%%]")) 73 " [%b%p%%]"))
64 "*Control string formatting the string to display in the mode line. 74 "*Control string formatting the string to display in the mode line.
65 Ordinary characters in the control string are printed as-is, while 75 Ordinary characters in the control string are printed as-is, while
66 conversion specifications introduced by a `%' character in the control 76 conversion specifications introduced by a `%' character in the control
67 string are substituted as defined by the current value of the variable 77 string are substituted as defined by the current value of the variable
68 `battery-status-function'.") 78 `battery-status-function'."
69 79 :type '(choice string (const nil))
70 (defvar battery-update-interval 60 80 :group 'battery)
71 "*Seconds after which the battery status will be updated.") 81
82 (defcustom battery-update-interval 60
83 "*Seconds after which the battery status will be updated."
84 :type 'integer
85 :group 'battery)
72 86
73 (defvar battery-update-timer nil 87 (defvar battery-update-timer nil
74 "Interval timer object.") 88 "Interval timer object.")
75 89
76 ;;;###autoload 90 ;;;###autoload