(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"))