]> git.eshelyaron.com Git - emacs.git/commitdiff
(battery-linux-proc-acpi): Use ignore-errors around calls to directory-files.
authorRichard M. Stallman <rms@gnu.org>
Wed, 10 Jan 2007 01:20:10 +0000 (01:20 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 10 Jan 2007 01:20:10 +0000 (01:20 +0000)
lisp/battery.el

index 1b1b77ec8e34cf59d3b81f4478e3df8e977f7b49..aec6865dc066734fdeba4d74cd8e4babe5d27e6f 100644 (file)
@@ -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"))