]> git.eshelyaron.com Git - emacs.git/commitdiff
(display-battery-mode): Rename from display-battery.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jan 2005 21:15:09 +0000 (21:15 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Jan 2005 21:15:09 +0000 (21:15 +0000)
Handle the case where it gets turned off.

etc/NEWS
lisp/ChangeLog
lisp/battery.el

index e100cf8caacb4e90fbca3795e0838e2ef5ae469c..b1f29619a2acf7aeb5d6ff6e5f746ba34a4e4288 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1,5 +1,6 @@
 GNU Emacs NEWS -- history of user-visible changes.  2003-05-21
-Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+          Free Software Foundation, Inc.
 See the end for copying conditions.
 
 Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
@@ -98,6 +99,7 @@ types any more.  Add -DUSE_LISP_UNION_TYPE if you want union types.
 \f
 * Changes in Emacs 21.4
 
+** display-battery has been replaced by display-battery-mode.
 ** calculator.el now has radix grouping mode, which is available when
 `calculator-output-radix' is non-nil.  In this mode a separator
 character is used every few digits, making it easier to see byte
index c72040211ce18ae5cf2e5f33b30c294c8b12e940..4f395c61ea3e7ccb118155f6a7c6106df5c6f834 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * battery.el (display-battery-mode): Rename from display-battery.
+       Handle the case where it gets turned off.
+
 2005-01-04  Richard M. Stallman  <rms@gnu.org>
 
        * add-log.el (change-log-font-lock-keywords): Don't match just "From".
@@ -5,8 +10,7 @@
 2005-01-04  Andreas Schwab  <schwab@suse.de>
 
        * files.el (insert-directory): Only look for error lines in
-       inserted text.  Don't move too far after processing --dired
-       markers.
+       inserted text.  Don't move too far after processing --dired markers.
 
 2005-01-04  Richard M. Stallman  <rms@gnu.org>
 
@@ -29,7 +33,7 @@
        * isearch.el (lazy-highlight): Group renamed from isearch-lazy-...
        (lazy-highlight-cleanup, lazy-highlight-initial-delay)
        (lazy-highlight-interval, lazy-highlight-max-at-a-time)
-       (lazy-highlight-face): Renamed from isearch-lazy-...
+       (lazy-highlight-face): Rename from isearch-lazy-...
        Change all references to them.
 
 2005-01-03  Luc Teirlinck  <teirllm@auburn.edu>
index b87904507356977dd2d7cb67da6c75f27de31c67..69bd68bb0b91c17a9f758e3f852fb95bf47d335e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; battery.el --- display battery status information
 
-;; Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004
+;; Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005
 ;;           Free Software Foundation, Inc.
 
 ;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org>
@@ -108,20 +108,23 @@ The text being displayed in the echo area is controlled by the variables
                  "Battery status not available")))
 
 ;;;###autoload
-(defun display-battery ()
+(define-minor-mode display-battery-mode
   "Display battery status information in the mode line.
 The text being displayed in the mode line is controlled by the variables
 `battery-mode-line-format' and `battery-status-function'.
 The mode line will be updated automatically every `battery-update-interval'
 seconds."
-  (interactive)
+  :global t
   (setq battery-mode-line-string "")
   (or global-mode-string (setq global-mode-string '("")))
-  (add-to-list 'global-mode-string 'battery-mode-line-string t)
   (and battery-update-timer (cancel-timer battery-update-timer))
-  (setq battery-update-timer (run-at-time nil battery-update-interval
-                                         'battery-update-handler))
-  (battery-update))
+  (if (not display-battery-mode)
+      (setq global-mode-string
+           (delq 'battery-mode-line-string global-mode-string))
+    (add-to-list 'global-mode-string 'battery-mode-line-string t)
+    (setq battery-update-timer (run-at-time nil battery-update-interval
+                                           'battery-update-handler))
+    (battery-update)))
 
 (defun battery-update-handler ()
   (battery-update)