/[emacs]/emacs/lisp/battery.el
ViewVC logotype

Diff of /emacs/lisp/battery.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by monnier, Sat Sep 18 21:33:44 2004 UTC revision 1.23 by rms, Mon Dec 27 16:40:50 2004 UTC
# Line 73  string are substituted as defined by the Line 73  string are substituted as defined by the
73    
74  (defvar battery-mode-line-string nil  (defvar battery-mode-line-string nil
75    "String to display in the mode line.")    "String to display in the mode line.")
76    ;;;###autoload (put 'battery-mode-line-string 'risky-local-variable t)
77    
78  (defcustom battery-mode-line-format  (defcustom battery-mode-line-format
79    (cond ((eq battery-status-function 'battery-linux-proc-apm)    (cond ((eq battery-status-function 'battery-linux-proc-apm)
80           " [%b%p%%]")           "[%b%p%%]")
81          ((eq battery-status-function 'battery-linux-proc-acpi)          ((eq battery-status-function 'battery-linux-proc-acpi)
82           " [%b%p%%,%d°C]"))           "[%b%p%%,%d°C]"))
83    "*Control string formatting the string to display in the mode line.    "*Control string formatting the string to display in the mode line.
84  Ordinary characters in the control string are printed as-is, while  Ordinary characters in the control string are printed as-is, while
85  conversion specifications introduced by a `%' character in the control  conversion specifications introduced by a `%' character in the control
# Line 128  seconds." Line 129  seconds."
129    
130  (defun battery-update ()  (defun battery-update ()
131    "Update battery status information in the mode line."    "Update battery status information in the mode line."
132    (setq battery-mode-line-string (propertize (if (and battery-mode-line-format    (setq battery-mode-line-string
133                                                        battery-status-function)          (propertize (if (and battery-mode-line-format
134                                                   (battery-format                               battery-status-function)
135                                                    battery-mode-line-format                          (battery-format
136                                                    (funcall battery-status-function))                           battery-mode-line-format
137                                                 "")                           (funcall battery-status-function))
138                                               'help-echo "Battery status information"))                        "")
139                        'help-echo "Battery status information"))
140    (force-mode-line-update))    (force-mode-line-update))
141    
142    

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26