Consider the following file ex-ob-load-file.org:
---- >8 ----
#+begin_src emacs-lisp
(defun ex-org-babel-load-file (msg)
(message "From tagled file: %s" msg))
#+end_src
[[elisp:(org-babel-load-file "ex-ob-load-file.org" t)]]
---- 8< ----
Try to follow the link at the end of file or just execute the command in
the link target.
Expected result: the .org file is tangled to ex-ob-load-file.el, the
latter is compiled and loaded.
Actual result:
Compiling /home/ubuntu/examples/org/ex-ob-load-file.el...done
Wrote /home/ubuntu/examples/org/ex-ob-load-file.elc
progn: Cannot open load file: No such file or directory, ex-ob-load-file.el
It seems, it is a regression caused by the Org commit
0193b543e9ef84bfefe76d55e330d5b1cb842cef
author Stefan Kangas <ste...@marxist.se> Tue Sep 22 00:16:22 2020 +0200
committer Kyle Meyer <k...@kyleam.com> Sun Oct 25 01:10:16 2020 -0400
Backport commit 4a575eb18 from Emacs
byte-compile-file: Make optional LOAD argument obsolete
4a575eb18cca3eed5019f2d2d2abeea1f0c07005
Stefan Kangas
Tue Oct 20 18:48:27 2020 +0200
diff --git a/lisp/org.el b/lisp/org.el
index db7f83825..73b1f9458 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -232,7 +232,8 @@ byte-compiled before it is loaded."
(org-babel-tangle-file file tangled-file "emacs-lisp\\|elisp"))
(if compile
(progn
- (byte-compile-file tangled-file 'load)
+ (byte-compile-file tangled-file)
+ (load tangled-file)
(message "Compiled and loaded %s" tangled-file))
(load-file tangled-file)
(message "Loaded %s" tangled-file))))
It seems with the 'load argument `byte-compile-file' was able to load a
file outside of `load-path'.
Emacs 26.3, Org main or bugfix branches.
Org-9.3.1 works fine.