Debian Emacs Devel Commit: rev 55 - in emacs21/pkg/trunk/debian: . patches
Jerome Marant
jerome@quantz.debian.org
Sat, 28 Feb 2004 15:27:03 +0100
Author: jerome
Date: 2004-02-28 15:27:03 +0100 (Sat, 28 Feb 2004)
New Revision: 55
Modified:
emacs21/pkg/trunk/debian/changelog
emacs21/pkg/trunk/debian/patches/battery-acpi-support.dpatch
Log:
Added support for linux 2.6 to ACPI in lisp/battery.el (#228658)
Modified: emacs21/pkg/trunk/debian/changelog
===================================================================
--- emacs21/pkg/trunk/debian/changelog 2004-02-27 23:13:48 UTC (rev 54)
+++ emacs21/pkg/trunk/debian/changelog 2004-02-28 14:27:03 UTC (rev 55)
@@ -9,33 +9,33 @@
* Apply patch allowing emacsclient to handle ALTERNATE_EDITOR properly
when the command is run without any parameter [Jérôme Marant]
(closes: #219658)
- - debian/patches/emacsclient-alternate-editor.dpatch: new
+ - debian/patches/emacsclient-alternate-editor.dpatch: new file.
* Provide the `editor' virtual package. [Jérôme Marant]
(closes: #66243, #90154)
- debian/control.in: emacs and emacs-nox now provide the `editor'
virtual package.
- - debian/control: synchronized with debian/control.in
+ - debian/control: synchronized with debian/control.in.
- debian/emacs.postinst: adding an `editor' alternative with a priority
of 0 as discussed in
http://lists.debian.org/debian-policy/2000/debian-policy-200006/msg00122.html
- debian/emacs.prerm: removing the `editor' alternative on package
- removal
+ removal.
* Added automatic switching to UTF-8 encoding when editing the debian
changelog file. [Jérôme Marant]
- debian/changelog: added Emacs local variables forcing coding
- to UTF-8
+ to UTF-8.
* Fix handling of menu entry for text version of Emacs [Jérôme Marant]
(closes: #221171)
- debian/menu.in: call the text version of emacs with the `-nw'
- parameter
+ parameter.
* Install the emacsclient manpage [Jérôme Marant] (closes: #222767)
- debian/build-common-pkg: install missing emacsclient manpage.
- debian/emacs-common.postinst: install alternative for emacsclient
- manpage
+ manpage.
* Install .desktop entry in order to make Emacs easy to start in
both GNOME and KDE. Thanks to Adam C Powell IV <hazelsct@debian.org>
@@ -78,6 +78,10 @@
- debian/fix-debian-scripts: deleted - no longer used.
- debian/build-binary-pkg: adjusted to handle more of the common code.
+ * Added support for linux 2.6 to ACPI in lisp/battery.el. Thanks to
+ Mario Lang <mlang@debian.org> [Jérôme Marant] (closes: #228658)
+ - debian/patches/battery-acpi-support.dpatch: updated.
+
-- Rob Browning <rlb@defaultvalue.org> Thu, 26 Feb 2004 12:13:50 -0600
emacs21 (21.3+1-4) unstable; urgency=medium
Modified: emacs21/pkg/trunk/debian/patches/battery-acpi-support.dpatch
===================================================================
--- emacs21/pkg/trunk/debian/patches/battery-acpi-support.dpatch 2004-02-27 23:13:48 UTC (rev 54)
+++ emacs21/pkg/trunk/debian/patches/battery-acpi-support.dpatch 2004-02-28 14:27:03 UTC (rev 55)
@@ -47,7 +47,7 @@
- "Power %L, battery %B (%p%% load, remaining time %t)"))
+ "Power %L, battery %B (%p%% load, remaining time %t)")
+ ((eq battery-status-function 'battery-linux-proc-acpi)
-+ "Power %L, battery %B at %r mA (%p%% load, remaining time %t)"))
++ "Power %L, battery %B at %r (%p%% load, remaining time %t)"))
"*Control string formatting the string to display in the echo area.
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
@@ -62,7 +62,7 @@
"*Control string formatting the string to display in the mode line.
Ordinary characters in the control string are printed as-is, while
conversion specifications introduced by a `%' character in the control
-@@ -217,6 +224,103 @@
+@@ -217,6 +224,114 @@
(cons ?h (or (and hours (number-to-string hours)) "N/A"))
(cons ?t (or remaining-time "N/A")))))
@@ -85,7 +85,8 @@
+%m Remaining time in minutes
+%h Remaining time in hours
+%t Remaining time in the form `h:min'"
-+ (let (capacity design-capacity rate charging-state warn low minutes hours)
++ (let (capacity design-capacity rate rate-type charging-state warn low
++ minutes hours)
+ ;; ACPI provides information about each battery present in the system in
+ ;; a separate subdirectory. We are going to merge the available
+ ;; information together since displaying for a variable amount of
@@ -102,32 +103,41 @@
+ ;; battery is "charging"/"discharging", the others are
+ ;; "unknown".
+ (setq charging-state (match-string 1)))
-+ (when (re-search-forward "present rate: +\\([0-9]+\\) mA$" nil t)
-+ (setq rate (+ (or rate 0) (string-to-int (match-string 1)))))
-+ (when (re-search-forward "remaining capacity: +\\([0-9]+\\) mAh$"
++ (when (re-search-forward "present rate: +\\([0-9]+\\) \\(m[AW]\\)$"
+ nil t)
++ (setq rate (+ (or rate 0) (string-to-int (match-string 1)))
++ rate-type (or (and rate-type
++ (if (string= rate-type (match-string 2))
++ rate-type
++ (error
++ "Inconsistent rate types (%s vs. %s)"
++ rate-type (match-string 2))))
++ (match-string 2))))
++ (when (re-search-forward "remaining capacity: +\\([0-9]+\\) m[AW]h$"
++ nil t)
+ (setq capacity
+ (+ (or capacity 0) (string-to-int (match-string 1))))))
+ (goto-char (point-max))
+ (battery-insert-file-contents (expand-file-name "info" dir))
+ (when (re-search-forward "present: +yes$" nil t)
-+ (when (re-search-forward "design capacity: +\\([0-9]+\\) mAh$"
++ (when (re-search-forward "design capacity: +\\([0-9]+\\) m[AW]h$"
+ nil t)
+ (setq design-capacity (+ (or design-capacity 0)
+ (string-to-int (match-string 1)))))
-+ (when (re-search-forward "design capacity warning: +\\([0-9]+\\) mAh$"
++ (when (re-search-forward "design capacity warning: +\\([0-9]+\\) m[AW]h$"
+ nil t)
+ (setq warn (+ (or warn 0) (string-to-int (match-string 1)))))
-+ (when (re-search-forward "design capacity low: +\\([0-9]+\\) mAh$"
++ (when (re-search-forward "design capacity low: +\\([0-9]+\\) m[AW]h$"
+ nil t)
+ (setq low (+ (or low 0)
+ (string-to-int (match-string 1))))))))
+ (directory-files "/proc/acpi/battery/" t "BAT"))
+ (and capacity rate
-+ (setq minutes (floor (* (/ (float (if (string= charging-state
-+ "charging")
-+ (- design-capacity capacity)
-+ capacity)) rate) 60))
++ (setq minutes (if (zerop rate) 0
++ (floor (* (/ (float (if (string= charging-state
++ "charging")
++ (- design-capacity capacity)
++ capacity)) rate) 60)))
+ hours (/ minutes 60)))
+ (list (cons ?c (or (and capacity (number-to-string capacity)) "N/A"))
+ (cons ?L (or (when (file-exists-p "/proc/acpi/ac_adapter/AC/state")
@@ -146,7 +156,8 @@
+ "temperature: +\\([0-9]+\\) C$" nil t)
+ (match-string 1))))
+ "N/A"))
-+ (cons ?r (or (and rate (number-to-string rate)) "N/A"))
++ (cons ?r (or (and rate (concat (number-to-string rate) " "
++ rate-type)) "N/A"))
+ (cons ?B (or charging-state "N/A"))
+ (cons ?b (or (and (string= charging-state "charging") "+")
+ (and low (< capacity low) "!")