summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-11-19 22:18:50 +0100
committerStefan Kangas <stefan@marxist.se>2020-11-21 04:22:59 +0100
commit6781cd670d1487bbf0364d80de68ca9733342769 (patch)
treee17667c810d9ce67bf1ac2a8ff621dbd6934040e /lisp/emacs-lisp
parentc60355582a3ed19b4cc7e04b3b2031e461ccf7f1 (diff)
downloademacs-6781cd670d1487bbf0364d80de68ca9733342769.tar.gz
emacs-6781cd670d1487bbf0364d80de68ca9733342769.tar.bz2
emacs-6781cd670d1487bbf0364d80de68ca9733342769.zip
Make load argument of native-compile-async internal
* lisp/emacs-lisp/comp.el (native--compile-async): New defun extracted from native-compile-async. (native-compile-async): Remove load argument and use above new defun. * src/comp.c (maybe_defer_native_compilation): Use above new defun. (Bug#44676)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/comp.el20
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 2f1e8965c1b..567ff00b9c4 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3485,8 +3485,7 @@ environment variable 'NATIVE_DISABLED' is set byte compile only."
(`(,tempfile . ,target-file)
(rename-file tempfile target-file t))))))
-;;;###autoload
-(defun native-compile-async (paths &optional recursively load)
+(defun native--compile-async (paths &optional recursively load)
"Compile PATHS asynchronously.
PATHS is one path or a list of paths to files or directories.
@@ -3553,6 +3552,23 @@ bytecode definition was not changed in the meanwhile)."
(when (zerop (comp-async-runnings))
(comp-run-async-workers))))
+;;;###autoload
+(defun native-compile-async (paths &optional recursively load)
+ "Compile PATHS asynchronously.
+PATHS is one path or a list of paths to files or directories.
+
+If optional argument RECURSIVELY is non-nil, recurse into
+subdirectories of given directories.
+
+If optional argument LOAD is non-nil, request to load the file
+after compiling.
+
+The variable `comp-async-jobs-number' specifies the number
+of (commands) to run simultaneously."
+ ;; Normalize: we only want to pass t or nil, never e.g. `late'.
+ (let ((load (not (not load))))
+ (native--compile-async paths recursively load)))
+
(provide 'comp)
;;; comp.el ends here