diff options
author | Andrea Corallo <acorallo@gnu.org> | 2024-10-22 17:46:44 +0200 |
---|---|---|
committer | Andrea Corallo <acorallo@gnu.org> | 2024-10-22 18:21:16 +0200 |
commit | 246d68bd2a5468bd428a0406402e7ad2b3005314 (patch) | |
tree | 00d2d9efe482277766f057647397c98786b85f6a /lisp/emacs-lisp | |
parent | 202adfcfcc2ed20fa91d8377107618c8113f7106 (diff) | |
download | emacs-246d68bd2a5468bd428a0406402e7ad2b3005314.tar.gz emacs-246d68bd2a5468bd428a0406402e7ad2b3005314.tar.bz2 emacs-246d68bd2a5468bd428a0406402e7ad2b3005314.zip |
Add 'native-compile-directory' (bug#73303)
* lisp/emacs-lisp/comp.el (native-compile-directory): New function.
* etc/NEWS (native-compile-directory): Add to NEWS.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/comp.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index fc87014202c..8866f47aa66 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3663,6 +3663,17 @@ the compilation was successful return the compiled function." (comp--native-compile function-or-file nil output)) ;;;###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." + (mapc (lambda (file) + (unless (comp-lookup-eln file) + (native-compile file))) + (directory-files-recursively directory ".+\\.el\\'"))) + +;;;###autoload (defun batch-native-compile (&optional for-tarball) "Perform batch native compilation of remaining command-line arguments. |