emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix bug in `battery-linux-proc-acpi' %b handling


From: Mario Lang
Subject: [PATCH] Fix bug in `battery-linux-proc-acpi' %b handling
Date: Wed, 10 Sep 2003 13:33:32 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

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  <address@hidden>
+
+       * 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  <address@hidden>
 
        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 <address@hidden>
 ;; 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 address@hidden
        | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44




reply via email to

[Prev in Thread] Current Thread [Next in Thread]