Closed bmp closed 8 months ago
Thanks for taking the time to fill out a support ticket. The warning sums up the situation:
a built-in Org version is loaded prior to the more recent Org version
This means that the Org feature has been loaded prior to your use-package declaration for Org. This often happens when one of Org's features is used early in the init file (e.g. Users loading their config with org-babel-load-file
).
If you have a link to your init file, I'd be happy to take a look and diagnose the issue.
Alternatively you can add the following elisp to the beginning of your init file.
It should cause the debugger to show a backtrace. The backtrace will show exactly when and what is causing Org to be loaded.
(eval-after-load "org" '(debug))
If you're having trouble interpreting the output of the backtrace, feel free to share it's full text here and I will take a look.
Let me know if that helps.
Thank you for the offer to look at the init file, I'll need to remove all the personal info in it before I can put it up online. I do have my init file in an org file, but I do not load it throught that mode, I tangle the file and then place it in the .emacs.d folder.
In the meantime, I added the (eval-after-load "org" '(debug))
into the init file and here is the backtrace,
Debugger entered: nil
(closure (t) nil (debug))()
funcall((closure (t) nil (debug)))
do-after-load-evaluation("/usr/share/emacs/29.2/lisp/org/org.elc")
(org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (dot . t) (org . t) (R . t) (python . t) (latex . t) (emacs-lisp . t) (latex . t) (java . t)))
load-with-code-conversion("/home/bmp/.emacs.d/init.el" "/home/bmp/.emacs.d/init.el" t t)
load("/home/bmp/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x10e71e71dc9d5432>) #f(compiled-function () #<bytecode -0x1f3c61addc0acb35>) t)
command-line()
normal-top-level()
(org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (dot . t) (org . t) (R . t) (python . t) (latex . t) (emacs-lisp . t) (latex . t) (java . t))) load-with-code-conversion("/home/bmp/.emacs.d/init.el" "/home/bmp/.emacs.d/init.el" t t) load("/home/bmp/.emacs.d/init" noerror nomessage)
It looks like these forms are at the top level of your init file. They need to be deferred so Elpaca can load Org first. e.g.
With use-package/elpaca-use-package-mode:
(elpaca elpaca-use-package (elpaca-use-package-mode))
(elpaca-wait)
(use-package org
:ensure t ;; This will install the dev version of Org
;; :ensure nil would use the built-in version of Org
:config
;; your Org config goes here
)
Or without use-package:
(elpaca org
;;Org config goes here
)
Does that make sense?
I actually was loading this portion babel much after I was loading org package. I have now moved it into tho the config portion like this,
(use-package org
:ensure t
:bind
(:map org-mode-map
("C-M-<return>" . org-insert-subheading))
:config
;; Bunch of other config
;; active Babel languages
(org-babel-do-load-languages
(quote org-babel-load-languages)
(quote ((shell . t)
(dot . t)
(org . t)
(R . t)
(python . t)
(latex . t)
(emacs-lisp . t)
(latex . t)
(java . t)))))
This portion works now, thank you so much!
I actually was loading this portion babel much after I was loading org package. I have now moved it into tho the config portion like this,
Because Elpaca is asynchronous, the use-package form was being deferred and the part that was "after", lexically speaking, was being evaluated first.
Moving the configuration into the use-package declaration defers its evaluation as well.
This portion works now, thank you so much!
Glad to hear it. Thank you.
Confirmation
Elpaca Version
Elpaca 09a94ca HEAD -> master, origin/master, origin/HEAD installer: 0.6 emacs-version: GNU Emacs 29.2 (build 2, x86_64-unknown-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2024-01-20 git --version: git version 2.43.2
Operating System
OS: Void x86_64 Kernel: 6.6.16_1
Description
I use the following in my init.el with both straight.el and use-package based on a wonderful guide by Norang,
It worked perfectly well previously, however with elpaca, I get the following warning,