emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master d3c8028 023/348: ivy.el (ivy--sorted-files): Add a safety


From: Oleh Krehel
Subject: [elpa] master d3c8028 023/348: ivy.el (ivy--sorted-files): Add a safety work-around
Date: Sat, 8 Apr 2017 11:03:16 -0400 (EDT)

branch: master
commit d3c802883f904519bf77c70721f6541957c07967
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy--sorted-files): Add a safety work-around
    
    It can happen that (all-completions "" 'read-file-name-internal) may
    fail on systems with symlinks. I think it's related to the file
    functions trying to compute occupied space. In any case, a plain
    `directory-files' is roughly the equivalent and is less likely to fail.
---
 ivy.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index eb6fe5d..8e03cc1 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1232,7 +1232,10 @@ like.")
   "Return the list of files in DIR.
 Directories come first."
   (let* ((default-directory dir)
-         (seq (all-completions "" 'read-file-name-internal))
+         (seq (condition-case nil
+                  (all-completions "" 'read-file-name-internal)
+                (error
+                 (directory-files dir))))
          sort-fn)
     (if (equal dir "/")
         seq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]