Whenever I open an org file before the speedbar package is loaded, org-mode produces the following error:
Symbol’s function definition is void: speedbar-add-supported-extension
The error above is resolved if I (require 'speedbar)
in my init file but, as a learning experience, I was wondering if there's a way of deferring loading of speedbar until such a time when org-mode is actually initialized for the first time.
I've tried:
specifying the
:after
prop touse-package
:(use-package org :hook (org-mode . init/mode/org) :after speedbar :config (init/org-mode))
setting up an advice
(advice-add 'org-mode :before #'init/org-mode))
Nothing worked so far. Is there a way of accomplishing this?
EDIT
Using Emacs 26.3 and org-mode 9.1.9 .