; 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.
This commit is contained in:
Eli Zaretskii 2024-10-23 10:00:45 +03:00
parent e756d4373b
commit c037b25397
3 changed files with 13 additions and 5 deletions

View file

@ -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

View file

@ -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'.

View file

@ -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)))