diff options
| author | Eli Zaretskii | 2008-09-30 12:52:46 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-09-30 12:52:46 +0000 |
| commit | a03c5807a3b781f963c249ee2c7d55ef1633eac6 (patch) | |
| tree | e889af976c1ab679fd0498b1579d906517004167 | |
| parent | f45de83bf8fd3d3a475e77afff4dee434400187e (diff) | |
| download | emacs-a03c5807a3b781f963c249ee2c7d55ef1633eac6.tar.gz emacs-a03c5807a3b781f963c249ee2c7d55ef1633eac6.zip | |
(locate-dominating-file): Wrap directory-files with condition-case, instead
of calling file-directory-p, which stats the directory one more time.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/files.el | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0cc37745e43..844fff225ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2008-09-30 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-09-30 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (locate-dominating-file): Wrap directory-files with | ||
| 4 | condition-case, instead of calling file-directory-p, which stats | ||
| 5 | the directory one more time. | ||
| 6 | |||
| 3 | * mail/mail-utils.el (mail-unquote-printable-region): Use | 7 | * mail/mail-utils.el (mail-unquote-printable-region): Use |
| 4 | insert-byte instead of insert-char, when the UNIBYTE arg is | 8 | insert-byte instead of insert-char, when the UNIBYTE arg is |
| 5 | non-nil. | 9 | non-nil. |
diff --git a/lisp/files.el b/lisp/files.el index f00c265ed6e..090556663e6 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -734,8 +734,9 @@ PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." | |||
| 734 | (let ((prev-user user)) | 734 | (let ((prev-user user)) |
| 735 | (setq user (nth 2 (file-attributes dir))) | 735 | (setq user (nth 2 (file-attributes dir))) |
| 736 | (or (null prev-user) (equal user prev-user)))) | 736 | (or (null prev-user) (equal user prev-user)))) |
| 737 | (if (setq files (and (file-directory-p dir) | 737 | (if (setq files (condition-case nil |
| 738 | (directory-files dir 'full regexp))) | 738 | (directory-files dir 'full regexp) |
| 739 | (error nil))) | ||
| 739 | (throw 'found (car files)) | 740 | (throw 'found (car files)) |
| 740 | (if (equal dir | 741 | (if (equal dir |
| 741 | (setq dir (file-name-directory | 742 | (setq dir (file-name-directory |