From: Stefan Kangas Date: Thu, 19 Nov 2020 21:18:50 +0000 (+0100) Subject: Make load argument of native-compile-async internal X-Git-Tag: emacs-28.0.90~2727^2~303 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6781cd670d1487bbf0364d80de68ca9733342769;p=emacs.git 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) --- 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 diff --git a/src/comp.c b/src/comp.c index 6ddfad528b4..99560cc13a1 100644 --- a/src/comp.c +++ b/src/comp.c @@ -4677,13 +4677,13 @@ maybe_defer_native_compilation (Lisp_Object function_name, /* Comp already loaded. */ if (!NILP (delayed_sources)) { - CALLN (Ffuncall, intern_c_string ("native-compile-async"), + CALLN (Ffuncall, intern_c_string ("native--compile-async"), delayed_sources, Qnil, Qlate); delayed_sources = Qnil; } Fputhash (function_name, definition, Vcomp_deferred_pending_h); - CALLN (Ffuncall, intern_c_string ("native-compile-async"), src, Qnil, - Qlate); + CALLN (Ffuncall, intern_c_string ("native--compile-async"), + src, Qnil, Qlate); } else {