summaryrefslogtreecommitdiff
path: root/lisp/battery.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2007-01-10 01:20:10 +0000
committerRichard M. Stallman <rms@gnu.org>2007-01-10 01:20:10 +0000
commitb8e3d88f5836dcecd1ac93fcb67a99ed2369b3d5 (patch)
treef8ec9e1081f76652e43244750baeb3253f11f78e /lisp/battery.el
parent271fffd98764a8355c96069e0f362fcd4bdf7c84 (diff)
downloademacs-b8e3d88f5836dcecd1ac93fcb67a99ed2369b3d5.tar.gz
(battery-linux-proc-acpi): Use ignore-errors around calls to directory-files.
Diffstat (limited to 'lisp/battery.el')
-rw-r--r--lisp/battery.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/battery.el b/lisp/battery.el
index 1b1b77ec8e3..aec6865dc06 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -357,15 +357,17 @@ The following %-sequences are provided:
(list (cons ?c (or (and capacity (number-to-string capacity)) "N/A"))
(cons ?L (or (battery-search-for-one-match-in-files
(mapcar (lambda (e) (concat e "/state"))
- (directory-files "/proc/acpi/ac_adapter/"
- t "\\`[^.]"))
+ (ignore-errors
+ (directory-files "/proc/acpi/ac_adapter/"
+ t "\\`[^.]")))
"state: +\\(.*\\)$" 1)
"N/A"))
(cons ?d (or (battery-search-for-one-match-in-files
(mapcar (lambda (e) (concat e "/temperature"))
- (directory-files "/proc/acpi/thermal_zone/"
- t "\\`[^.]"))
+ (ignore-errors
+ (directory-files "/proc/acpi/thermal_zone/"
+ t "\\`[^.]")))
"temperature: +\\([0-9]+\\) C$" 1)
"N/A"))