0

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 to use-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 .

migdsb
  • 113
  • 5
  • Is it autoloadable? – Drew Aug 29 '20 at 18:06
  • You didn't say what version of Emacs and org-mode you're using. I took a look in the org-mode source code, and `speedbar-add-supported-extension` is only called after speedbar is loaded. Perhaps this is a bug that was fixed, and you're using an older version of org-mode? – db48x Aug 29 '20 at 18:34
  • Thanks @db48, I've updated my post. – migdsb Aug 30 '20 at 05:06
  • Curious; my version is 9.1.2 and it doesn't have the problem. – db48x Aug 30 '20 at 09:17

0 Answers0