From 5447d4428be11ecd4979a6ce8b679e20c7865de0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 23 Oct 2024 10:00:45 +0300 Subject: [PATCH] ; Improve documentation of 'native-compile-directory' (bug#73303) * lisp/emacs-lisp/comp.el (native-compile-directory): Doc fix. * doc/lispref/compile.texi (Native-Compilation Functions): Document 'native-compile-directory'. * etc/NEWS: Improve wording. (cherry picked from commit c037b253975da883594f10f48e0be53d81a32756) --- doc/lispref/compile.texi | 8 ++++++++ etc/NEWS | 4 ++-- lisp/emacs-lisp/comp.el | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) 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 88c11eac0e2..9e95f8015f6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -579,8 +579,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))) -- 2.39.5