# HG changeset patch # User Richard M. Stallman # Date 1168392010 0 # Node ID b01847d9a51ba477e72927653b7fa51624581dca # Parent a94a200dd7e1ddaeb1ce7b0e6884c84ba81eba2b (battery-linux-proc-acpi): Use ignore-errors around calls to directory-files. diff -r a94a200dd7e1 -r b01847d9a51b lisp/battery.el --- a/lisp/battery.el Wed Jan 10 01:17:34 2007 +0000 +++ b/lisp/battery.el Wed Jan 10 01:20:10 2007 +0000 @@ -357,15 +357,17 @@ (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"))