emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] org-babel-load-file can not compile file


From: Max Nikulin
Subject: [BUG] org-babel-load-file can not compile file
Date: Tue, 10 May 2022 14:34:33 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1

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 <stefan@marxist.se> Tue Sep 22 00:16:22 2020 +0200
committer Kyle Meyer <kyle@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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]