gnu: emacs: Strip double wrap.
[jackhill/guix/guix.git] / guix / discovery.scm
index 468b6c5..b84b9ff 100644 (file)
@@ -51,13 +51,15 @@ DIRECTORY is not accessible."
       ((? symbol? type)
        type)))
 
+  (define (dot-prefixed? file)
+    (string-prefix? "." file))
+
   ;; Use 'scandir*' so we can avoid an extra 'lstat' for each entry, as
   ;; opposed to Guile's 'scandir' or 'file-system-fold'.
   (fold-right (lambda (entry result)
                 (match entry
-                  (("." . _)
-                   result)
-                  ((".." . _)
+                  (((? dot-prefixed?) . _)
+                   ;; Exclude ".", "..", and hidden files such as backups.
                    result)
                   ((name . properties)
                    (let ((absolute (string-append directory "/" name)))
@@ -151,9 +153,9 @@ SUB-DIRECTORY. Modules are listed in the order they appear on the path."
   (reverse (fold-modules cons '() path #:warn warn)))
 
 (define (fold-module-public-variables* proc init modules)
-  "Call (PROC MODULE SYMBOL VARIABLE) for each variable exported by one of MODULES,
-using INIT as the initial value of RESULT.  It is guaranteed to never traverse
-the same object twice."
+  "Call (PROC MODULE SYMBOL VARIABLE RESULT) for each variable exported by one
+of MODULES, using INIT as the initial value of RESULT.  It is guaranteed to
+never traverse the same object twice."
   ;; Here SEEN is populated by variables; if two different variables refer to
   ;; the same object, we still let them through.
   (identity                                       ;discard second return value