]> git.eshelyaron.com Git - emacs.git/commitdiff
native-compile-async accept list as input
authorAndrea Corallo <akrl@sdf.org>
Tue, 26 Nov 2019 16:13:44 +0000 (17:13 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:11 +0000 (11:38 +0100)
lisp/emacs-lisp/comp.el

index b84a3e5336445c4f2f939083fa6ba4a0727c3d80..b225d4d9297a669d07cbbcc801440d6b6f626b19 100644 (file)
@@ -1893,18 +1893,20 @@ Return the compilation unit file name."
 ;;;###autoload
 (defun native-compile-async (input &optional jobs recursively)
   "Compile INPUT asynchronously.
-INPUT can be either a folder or a file.
+INPUT can be either a list of files a folder or a file.
 JOBS specifies the number of jobs (commands) to run simultaneously (1 default).
 Follow folders RECURSIVELY if non nil."
   (let ((jobs (or jobs 1))
-        (files (if (file-directory-p input)
-                   (if recursively
-                       (directory-files-recursively input "\\.el$")
-                     (directory-files input t "\\.el$"))
-                 (if (file-exists-p input)
-                     (list input)
-                   (signal 'native-compiler-error
-                           "input not a file nor directory")))))
+        (files (if (listp input)
+                   input
+                 (if (file-directory-p input)
+                     (if recursively
+                         (directory-files-recursively input "\\.el$")
+                       (directory-files input t "\\.el$"))
+                   (if (file-exists-p input)
+                       (list input)
+                     (signal 'native-compiler-error
+                             "input not a file nor directory"))))))
     (setf comp-src-pool (nconc files comp-src-pool))
     (cl-loop repeat jobs
              do (comp-start-async-worker))