Permalink
Browse files

provide safe version of directory-files

this should fix #14
  • Loading branch information...
alexott committed Feb 8, 2014
1 parent 0ab8d22 commit 9c9c72ac461718d1bd6ad7c9759c73c93b8c8c97
Showing with 7 additions and 2 deletions.
  1. +7 −2 ecb-common-browser.el
View
@@ -1667,13 +1667,18 @@ function reads them to these hooks."
file-accessible-directory-p
file-name-sans-extension
file-writable-p
- file-name-as-directory
- directory-files))
+ file-name-as-directory))
(fset (intern (format "ecb-%s" f))
`(lambda (file-or-dir-name &rest args)
,(format "Delegate all args to `%s' but call first `ecb-fix-path' for FILE-OR-DIR-NAME." f)
(apply (quote ,f) (ecb-fix-path file-or-dir-name) args))))
+(defun ecb-directory-files (dir &rest args)
+ "Wrapper for directory-files that fixes the file name & catch file errors"
+ (condition-case nil
+ (apply 'directory-files (ecb-fix-path dir) args)
+ (error nil)))
+
(defun ecb-expand-file-name (name &optional default-dir)
"Delegate all args to `expand-file-name' but call first `ecb-fix-path'
for both args."

0 comments on commit 9c9c72a

Please sign in to comment.