unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* battery.el: Rename display-battery-mode to battery-mode?
@ 2005-08-02 16:15 Reiner Steib
  2005-08-04  6:57 ` Lute Kamstra
  2005-08-06  1:06 ` Juri Linkov
  0 siblings, 2 replies; 6+ messages in thread
From: Reiner Steib @ 2005-08-02 16:15 UTC (permalink / raw)


Hi,

I tried to enable battery-mode on my notebook using `M-x battery- TAB'
but I got "No match".  Eventually I found `display-battery-mode' in
`battery.el'.  Shouldn't the name of the minor mode read
`battery-mode' instead of `display-battery-mode'?

--8<---------------cut here---------------start------------->8---
--- battery.el	17 Jul 2005 19:58:18 +0200	1.28
+++ battery.el	02 Aug 2005 17:59:51 +0200	
@@ -131,7 +131,7 @@
 		  "Battery status not available")))
 
 ;;;###autoload
-(define-minor-mode display-battery-mode
+(define-minor-mode 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'.
@@ -149,6 +149,8 @@
 					    'battery-update-handler))
     (battery-update)))
 
+(define-obsolete-function-alias 'display-battery-mode 'battery-mode "22.1")
+
 (defun battery-update-handler ()
   (battery-update)
   (sit-for 0))
--8<---------------cut here---------------end--------------->8---

Okay to commit?

Shouldn't battery mode be mentioned briefly in (info "(emacs)Optional
Mode Line") as well?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: battery.el: Rename display-battery-mode to battery-mode?
  2005-08-02 16:15 battery.el: Rename display-battery-mode to battery-mode? Reiner Steib
@ 2005-08-04  6:57 ` Lute Kamstra
  2005-08-04 15:54   ` Reiner Steib
  2005-08-06  1:06 ` Juri Linkov
  1 sibling, 1 reply; 6+ messages in thread
From: Lute Kamstra @ 2005-08-04  6:57 UTC (permalink / raw)
  Cc: emacs-devel

Reiner Steib <reinersteib+gmane@imap.cc> writes:

> I tried to enable battery-mode on my notebook using `M-x battery- TAB'
> but I got "No match".  Eventually I found `display-battery-mode' in
> `battery.el'.  Shouldn't the name of the minor mode read
> `battery-mode' instead of `display-battery-mode'?

Agreed.

> --8<---------------cut here---------------start------------->8---
> --- battery.el	17 Jul 2005 19:58:18 +0200	1.28
> +++ battery.el	02 Aug 2005 17:59:51 +0200	
> @@ -131,7 +131,7 @@
>  		  "Battery status not available")))
>  
>  ;;;###autoload
> -(define-minor-mode display-battery-mode
> +(define-minor-mode 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'.
> @@ -149,6 +149,8 @@
>  					    'battery-update-handler))
>      (battery-update)))
>  
> +(define-obsolete-function-alias 'display-battery-mode 'battery-mode "22.1")
> +
>  (defun battery-update-handler ()
>    (battery-update)
>    (sit-for 0))
> --8<---------------cut here---------------end--------------->8---
>
> Okay to commit?

Ok with me.

> Shouldn't battery mode be mentioned briefly in (info "(emacs)Optional
> Mode Line") as well?

Maybe you can write a patch?

Lute.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: battery.el: Rename display-battery-mode to battery-mode?
  2005-08-04  6:57 ` Lute Kamstra
@ 2005-08-04 15:54   ` Reiner Steib
  2005-08-04 16:28     ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Reiner Steib @ 2005-08-04 15:54 UTC (permalink / raw)
  Cc: emacs-devel

On Thu, Aug 04 2005, Lute Kamstra wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>> I tried to enable battery-mode on my notebook using `M-x battery-
>> TAB' but I got "No match".  Eventually I found
>> `display-battery-mode' in `battery.el'.  Shouldn't the name of the
>> minor mode read `battery-mode' instead of `display-battery-mode'?
>
> Agreed.

(In the meantime I saw that there's one similarly named (interactive)
command `display-time-mode'.)

>> +(define-obsolete-function-alias 'display-battery-mode 'battery-mode "22.1")
[...]
>> Okay to commit?
>
> Ok with me.
>
>> Shouldn't battery mode be mentioned briefly in (info "(emacs)Optional
>> Mode Line") as well?
>
> Maybe you can write a patch?

--8<---------------cut here---------------start------------->8---
--- display.texi	17 Jul 2005 17:48:14 +0200	1.98
+++ display.texi	04 Aug 2005 17:54:03 +0200	
@@ -890,6 +890,11 @@
 to specify the directory to check for incoming mail (any nonempty regular
 file in the directory is considered as ``newly arrived mail'').
 
+@findex battery-mode
+On some systems, Emacs can display battery status information in the
+mode line.  To enable this feature, type @kbd{M-x battery-mode} or
+customize the option @code{battery-mode}.
+
 @cindex mode line, 3D appearance
 @cindex attributes of mode line, changing
 @cindex non-integral number of lines in a window
--8<---------------cut here---------------end--------------->8---

Of course one could describe some related variables
(battery-mode-line-format, battery-update-interval, battery-load-low,
battery-load-critical), but IIRC the goal is not to add to much text
to the manual.

Does it make sense to mention `battery-status-function' in the doc
strings of `battery' and `[display-]battery-mode'?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: battery.el: Rename display-battery-mode to battery-mode?
  2005-08-04 15:54   ` Reiner Steib
@ 2005-08-04 16:28     ` Juri Linkov
  0 siblings, 0 replies; 6+ messages in thread
From: Juri Linkov @ 2005-08-04 16:28 UTC (permalink / raw)


>>> I tried to enable battery-mode on my notebook using `M-x battery-
>>> TAB' but I got "No match".  Eventually I found
>>> `display-battery-mode' in `battery.el'.  Shouldn't the name of the
>>> minor mode read `battery-mode' instead of `display-battery-mode'?
>>
>> Agreed.
>
> (In the meantime I saw that there's one similarly named (interactive)
> command `display-time-mode'.)
>
>>> +(define-obsolete-function-alias 'display-battery-mode 'battery-mode "22.1")

I suspect the name `display-battery-mode' was created to be similar to
`display-time-mode' which displays additional information in the mode
line as well.  I suggest to create a valid alias `display-battery-mode'
for renamed `battery-mode' instead of declaring it obsolete
(i.e. to use `defalias' instead of `define-obsolete-function-alias').
Maybe, you also need to create a variable alias `display-battery-mode'
for `battery-mode' because `define-minor-mode' creates a global variable.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: battery.el: Rename display-battery-mode to battery-mode?
  2005-08-02 16:15 battery.el: Rename display-battery-mode to battery-mode? Reiner Steib
  2005-08-04  6:57 ` Lute Kamstra
@ 2005-08-06  1:06 ` Juri Linkov
  2005-08-06 18:36   ` Richard M. Stallman
  1 sibling, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2005-08-06  1:06 UTC (permalink / raw)


> I tried to enable battery-mode on my notebook using `M-x battery- TAB'
> but I got "No match".  Eventually I found `display-battery-mode' in
> `battery.el'.  Shouldn't the name of the minor mode read
> `battery-mode' instead of `display-battery-mode'?

Another change to make it easier to enable battery-mode is to add
a new menu item to the "Show/Hide" menu, next to the `time-mode'.
"Show/Hide" menu is not too big yet.  When it becomes bigger,
mode-line related settings could be moved to a separate submenu.

Index: lisp/menu-bar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.261
diff -c -r1.261 menu-bar.el
*** lisp/menu-bar.el	4 Jul 2005 23:08:56 -0000	1.261
--- lisp/menu-bar.el	5 Aug 2005 20:18:47 -0000
***************
*** 700,705 ****
--- 700,710 ----
  (define-key menu-bar-showhide-menu [linecolumn-separator]
    '("--"))
  
+ (define-key menu-bar-showhide-menu [showhide-battery]
+   (menu-bar-make-mm-toggle display-battery-mode
+ 			   "Battery status"
+ 			   "Display battery status information in mode line"))
+ 
  (define-key menu-bar-showhide-menu [showhide-date-time]
    (menu-bar-make-mm-toggle display-time-mode
  			   "Date, Time and Mail"

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: battery.el: Rename display-battery-mode to battery-mode?
  2005-08-06  1:06 ` Juri Linkov
@ 2005-08-06 18:36   ` Richard M. Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard M. Stallman @ 2005-08-06 18:36 UTC (permalink / raw)
  Cc: emacs-devel

    Another change to make it easier to enable battery-mode is to add
    a new menu item to the "Show/Hide" menu, next to the `time-mode'.
    "Show/Hide" menu is not too big yet.

That seems ok to me.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-06 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-02 16:15 battery.el: Rename display-battery-mode to battery-mode? Reiner Steib
2005-08-04  6:57 ` Lute Kamstra
2005-08-04 15:54   ` Reiner Steib
2005-08-04 16:28     ` Juri Linkov
2005-08-06  1:06 ` Juri Linkov
2005-08-06 18:36   ` Richard M. Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).