I have bit of custom elisp code (few hundred lines) that gets loaded from config.el with
(load "~/path/my.el"). I have noticed these functions are never natively compiled. Some of them are bit long running, and will be helped by native-comp.
What did you expect to happen?
Doom/Emacs should automatically natively compile these custom functions either ahead of time or JIT as stock emacs.
Steps to reproduce
- Define long running functions in separate file
(load " ~/path/file.el")
- Run custom function
C-h o custom-function RET
Loading data dump...
Maybe not exactly what you’re looking for, but you could put the code you want to have native-compiled into a repository and reference it locally in
packages.el. Then you can include it like so:
(package! my-elisp :recipe
While this builds doom config, as soon as Emacs launches it complains about missing function definition from my file that are called in rest of the config. So while
doom sync says the package is built, it isn’t actually loaded when Emacs starts.
You’ll need to actually write the repository as if it was a package, which means you’ll need to add a
provide statement at the end of the file in question, and then
require it in your configuration:
(defun my-elisp-foo ()