diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index 65442dd8d19..69a9aa5f31c 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -927,6 +927,14 @@ compilation subprocesses in parallel, under the control of Variables}). @end defun +@defun native-compile-directory directory +This function compiles into native code all the @file{*.el} files in the +specified @var{directory} and, recursively, in all of its +subdirectories, if a corresponding @file{.eln} file could not be found +in any of the directories mentioned in the +@code{native-comp-eln-load-path} list (@pxref{Library Search}). +@end defun + @deffn Command emacs-lisp-native-compile This command compiles the file visited by the current buffer into native code, if the file was changed since the last time it was diff --git a/etc/NEWS b/etc/NEWS index 5b7868e8720..f7ad41b1b9f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -646,8 +646,8 @@ sup-mouse.el, terminal.el, vi.el, vip.el, ws-mode.el, and yow.el. --- ** New function 'native-compile-directory'. -This function native compiles all Lisp files in a directory and in its -sub-directories (if they are not already native compiled). +This function natively-compiles all Lisp files in a directory and in its +sub-directories, recursively, which were not already natively-compiled. +++ ** The 'defcustom' ':local' keyword can now be 'permanent-only'. diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 8866f47aa66..96341b0a39f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3665,9 +3665,9 @@ the compilation was successful return the compiled function." ;;;###autoload (defun native-compile-directory (directory) "Native compile if necessary all the .el files present in DIRECTORY. -Each .el file is native compiled if the corresponding .eln file is not -found inside the current `native-comp-eln-load-path'. The search within -DIRECTORY is perfomed recursively." +Each .el file is native-compiled if the corresponding .eln file is not +found in any directory mentioned in `native-comp-eln-load-path'. +The search within DIRECTORY is perfomed recursively." (mapc (lambda (file) (unless (comp-lookup-eln file) (native-compile file)))