This is my config for org-babel:
(use-package org
:mode (("\\.org$" . org-mode))
:ensure org-plus-contrib
:config
(org-babel-do-load-languages 'org-babel-load-languages
'((emacs-lisp . t)
(python . t)
(shell . t)
(jupyter . t))))
It works when it is located in my init.el
. However when I relocate it in another file org.el
and load it in init.el
with:
(load-user-file "org.el")
I have got the error:
Symbol's value as variable is void: org-src-lang-modes
Also I have the line
;;; -*- lexical-binding: t -*-
and the same encoding in both files (init.el
,org.el
).
So, could you explain me what happens?
UPDATE.
Just for clarification this is my load-user-file
:
(defun load-user-file (file)
(interactive "f")
"Load a file in current user's configuration directory"
(load-file (expand-file-name file user-init-dir)))
org.el
is a bad name: it conflicts with theorg.el
that is part of Org mode proper. Choose a different name for your file.load-user-file
a thing? I've only seeload-file
....with: (load-user-file "org.el") I have got the error:...
and he is (correctly I think) wondering about thatload-user-file
: standard emacs only providesload-file
so this is either a typo or you are using some non-standard package that definesload-user-file
.