* [PATCH] Fix bug in `battery-linux-proc-acpi' %b handling
@ 2003-09-10 11:33 Mario Lang
2003-09-10 20:11 ` Alex Schroeder
0 siblings, 1 reply; 2+ messages in thread
From: Mario Lang @ 2003-09-10 11:33 UTC (permalink / raw)
Hi.
I just noticed a bug in my acpi handling code for battery.el. The "!" did
never show up because I ordered the expressions in the `or' wrong.
Please apply the attached patch.
Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.5382
diff -u -r1.5382 ChangeLog
--- lisp/ChangeLog 8 Sep 2003 19:01:57 -0000 1.5382
+++ lisp/ChangeLog 10 Sep 2003 11:26:13 -0000
@@ -1,3 +1,9 @@
+2003-09-10 Mario Lang <mlang@delysid.org>
+
+ * battery.el: Update Commentary and Copyright.
+ (battery-linux-proc-acpi): Fix a bug in %b which made "!" never
+ appear due to wrong ordering of the expressions in `or'.
+
2003-09-08 David Ponce <david@dponce.com>
Ensure that recentf correctly update the menu bar.
Index: lisp/battery.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/battery.el,v
retrieving revision 1.17
diff -u -r1.17 battery.el
--- lisp/battery.el 6 Sep 2003 19:28:08 -0000 1.17
+++ lisp/battery.el 10 Sep 2003 11:26:14 -0000
@@ -1,6 +1,6 @@
;;; battery.el --- display battery status information
-;; Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org>
;; Keywords: hardware
@@ -24,9 +24,9 @@
;;; Commentary:
-;; There is at present only a function interpreting the new `/proc/apm'
-;; file format of Linux version 1.3.58 or newer. That is, what a lucky
-;; coincidence, exactly the interface provided by the author's laptop.
+;; There is at present support for interpreting the new `/proc/apm'
+;; file format of Linux version 1.3.58 or newer and for the `/proc/acpi/'
+;; directory structure of Linux 2.4.20 and 2.6.
;;; Code:
@@ -308,8 +308,8 @@
(cons ?r (or (and rate (number-to-string rate)) "N/A"))
(cons ?B (or charging-state "N/A"))
(cons ?b (or (and (string= charging-state "charging") "+")
- (and warn (< capacity warn) "-")
(and low (< capacity low) "!")
+ (and warn (< capacity warn) "-")
""))
(cons ?h (or (and hours (number-to-string hours)) "N/A"))
(cons ?m (or (and minutes (number-to-string minutes)) "N/A"))
--
Thanks,
Mario | Debian Developer <URL:http://debian.org/>
| Get my public key via finger mlang@db.debian.org
| 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix bug in `battery-linux-proc-acpi' %b handling
2003-09-10 11:33 [PATCH] Fix bug in `battery-linux-proc-acpi' %b handling Mario Lang
@ 2003-09-10 20:11 ` Alex Schroeder
0 siblings, 0 replies; 2+ messages in thread
From: Alex Schroeder @ 2003-09-10 20:11 UTC (permalink / raw)
Cc: emacs-devel
Mario Lang <mlang@delysid.org> writes:
> I just noticed a bug in my acpi handling code for battery.el. The "!" did
> never show up because I ordered the expressions in the `or' wrong.
> Please apply the attached patch.
Applied.
Alex.
--
http://www.emacswiki.org/alex/
There is no substitute for experience.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-10 20:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-10 11:33 [PATCH] Fix bug in `battery-linux-proc-acpi' %b handling Mario Lang
2003-09-10 20:11 ` Alex Schroeder
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).