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

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

[nongnu] elpa/go-mode e184d60 070/495: Replace go--directory-dirs with f


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode e184d60 070/495: Replace go--directory-dirs with find-lisp-find-files-internal
Date: Sat, 7 Aug 2021 09:04:45 -0400 (EDT)

branch: elpa/go-mode
commit e184d60acbe6c9715bc71bcc685e8b310924e46c
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    Replace go--directory-dirs with find-lisp-find-files-internal
    
    This serves two purposes:
    
    1) There is no point in implementing this ourselves if it already exists
    2) find-lisp ignores symlinks, so this avoids getting confused by symlink 
loops
    
    This might be a possible fix for gh-18
---
 go-mode.el | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index b45fd8a..b04c4e5 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -15,6 +15,7 @@
   (require 'cl))
 
 (require 'ffap)
+(require 'find-lisp)
 
 (defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]")
 (defconst gofmt-stdin-tag "<standard input>")
@@ -616,21 +617,6 @@ uncommented, otherwise a new import will be added."
           ('single (insert "import " line "\n"))
           ('none (insert "\nimport (\n\t" line "\n)\n")))))))
 
-(defun go--directory-dirs (dir)
-  (if (file-directory-p dir)
-      (let ((dir (directory-file-name dir))
-            (dirs '())
-            (files (directory-files dir nil nil t)))
-        (dolist (file files)
-          (unless (member file '("." ".."))
-            (let ((file (concat dir "/" file)))
-              (when (file-directory-p file)
-                (setq dirs (append (cons file
-                                         (go--directory-dirs file))
-                                   dirs))))))
-        dirs)
-    '()))
-
 (defun go--flatten (lst)
   (if (atom lst)
       (list lst)
@@ -673,7 +659,7 @@ uncommented, otherwise a new import will be added."
                                 ))
                             (if (file-directory-p dir)
                                 (directory-files dir t "\\.a$"))))
-                  (go--directory-dirs pkgdir))))
+                  (find-lisp-find-files-internal pkgdir 
'find-lisp-file-predicate-is-directory 
'find-lisp-default-directory-predicate))))
       (go-root-and-paths)))) 'string<))
 
 (defun go-unused-imports-lines ()



reply via email to

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