emacs-diffs
[Top][All Lists]
Advanced

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

master 4180429: project--files-in-directory: Handle errors reported by '


From: Dmitry Gutov
Subject: master 4180429: project--files-in-directory: Handle errors reported by 'find'
Date: Thu, 15 Apr 2021 20:39:29 -0400 (EDT)

branch: master
commit 4180429d5d40908b443b03a35cbf0f41100c580f
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    project--files-in-directory: Handle errors reported by 'find'
    
    * lisp/progmodes/project.el (project--files-in-directory):
    Handle errors reported by 'find' (bug#47799).
---
 lisp/progmodes/project.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index fdca446..1edbe06 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -312,9 +312,15 @@ to find the list of ignores for each directory."
                                        (concat " -o " find-name-arg " "))
                                       " "
                                       (shell-quote-argument ")"))
-                            ""))))
+                            "")))
+         (output (with-output-to-string
+                   (with-current-buffer standard-output
+                     (let ((status
+                            (process-file-shell-command command nil t)))
+                       (unless (zerop status)
+                         (error "File listing failed: %s" 
(buffer-string))))))))
     (project--remote-file-names
-     (sort (split-string (shell-command-to-string command) "\0" t)
+     (sort (split-string output "\0" t)
            #'string<))))
 
 (defun project--remote-file-names (local-files)



reply via email to

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