all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [BUG] org-babel-load-file can not compile file
@ 2022-05-10  7:34 Max Nikulin
  2022-05-11 12:41 ` Ihor Radchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Max Nikulin @ 2022-05-10  7:34 UTC (permalink / raw)
  To: orgmode; +Cc: Stefan Kangas, Kyle Meyer

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-16 15:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-10  7:34 [BUG] org-babel-load-file can not compile file Max Nikulin
2022-05-11 12:41 ` Ihor Radchenko
2022-05-12 14:55   ` Max Nikulin
2022-05-13 10:38     ` Ihor Radchenko
2022-05-13 10:38     ` Ihor Radchenko
2022-05-14 10:36       ` Max Nikulin
2022-05-14 11:35         ` Ihor Radchenko
2022-05-16 14:53           ` Max Nikulin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.