changeset 75178:b01847d9a51b

(battery-linux-proc-acpi): Use ignore-errors around calls to directory-files.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Jan 2007 01:20:10 +0000
parents a94a200dd7e1
children b414cb68e99e
files lisp/battery.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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"))