Mercurial > emacs
comparison lisp/battery.el @ 59132:38f1d5865861
(battery-mode-line-format): Remove initial spaces.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 27 Dec 2004 16:40:50 +0000 |
parents | b628e08b0230 |
children | 9120644ff426 95879cc1ed20 |
comparison
equal
deleted
inserted
replaced
59131:52e7defa0669 | 59132:38f1d5865861 |
---|---|
71 :type '(choice string (const nil)) | 71 :type '(choice string (const nil)) |
72 :group 'battery) | 72 :group 'battery) |
73 | 73 |
74 (defvar battery-mode-line-string nil | 74 (defvar battery-mode-line-string nil |
75 "String to display in the mode line.") | 75 "String to display in the mode line.") |
76 ;;;###autoload (put 'battery-mode-line-string 'risky-local-variable t) | |
76 | 77 |
77 (defcustom battery-mode-line-format | 78 (defcustom battery-mode-line-format |
78 (cond ((eq battery-status-function 'battery-linux-proc-apm) | 79 (cond ((eq battery-status-function 'battery-linux-proc-apm) |
79 " [%b%p%%]") | 80 "[%b%p%%]") |
80 ((eq battery-status-function 'battery-linux-proc-acpi) | 81 ((eq battery-status-function 'battery-linux-proc-acpi) |
81 " [%b%p%%,%d°C]")) | 82 "[%b%p%%,%d°C]")) |
82 "*Control string formatting the string to display in the mode line. | 83 "*Control string formatting the string to display in the mode line. |
83 Ordinary characters in the control string are printed as-is, while | 84 Ordinary characters in the control string are printed as-is, while |
84 conversion specifications introduced by a `%' character in the control | 85 conversion specifications introduced by a `%' character in the control |
85 string are substituted as defined by the current value of the variable | 86 string are substituted as defined by the current value of the variable |
86 `battery-status-function'." | 87 `battery-status-function'." |
126 (battery-update) | 127 (battery-update) |
127 (sit-for 0)) | 128 (sit-for 0)) |
128 | 129 |
129 (defun battery-update () | 130 (defun battery-update () |
130 "Update battery status information in the mode line." | 131 "Update battery status information in the mode line." |
131 (setq battery-mode-line-string (propertize (if (and battery-mode-line-format | 132 (setq battery-mode-line-string |
132 battery-status-function) | 133 (propertize (if (and battery-mode-line-format |
133 (battery-format | 134 battery-status-function) |
134 battery-mode-line-format | 135 (battery-format |
135 (funcall battery-status-function)) | 136 battery-mode-line-format |
136 "") | 137 (funcall battery-status-function)) |
137 'help-echo "Battery status information")) | 138 "") |
139 'help-echo "Battery status information")) | |
138 (force-mode-line-update)) | 140 (force-mode-line-update)) |
139 | 141 |
140 | 142 |
141 ;;; `/proc/apm' interface for Linux. | 143 ;;; `/proc/apm' interface for Linux. |
142 | 144 |