Skip to main content
added 246 characters in body
Source Link
Pfedj
  • 338
  • 2
  • 11

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)))

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?

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)))
Source Link
Pfedj
  • 338
  • 2
  • 11

Config is broken when I use load-user-file

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?