org.el: Autoload org-load-modules-maybe

* lisp/org.el (org-load-modules-maybe): Autoload.

org-store-link and orgtbl-mode both 1) call org-load-modules-maybe at
the start of their execution, 2) can be used outside of Org mode, and
3) are in libraries that do not load org.el (instead org.el loads
them).  Autoload org-load-modules-maybe to avoid an error if these are
called before org.el is loaded.

Reported-by: Tim Frana <tfr@mailbox.org>
Ref: https://orgmode.org/list/5e0f0216-44d8-c909-3757-4d95650445ef@mailbox.org
This commit is contained in:
Kyle Meyer 2020-10-20 00:39:28 -04:00
parent 90b14cb409
commit edfafa9090
1 changed files with 1 additions and 0 deletions

View File

@ -662,6 +662,7 @@ defined in org-duration.el.")
(defvar org-modules-loaded nil
"Have the modules been loaded already?")
;;;###autoload
(defun org-load-modules-maybe (&optional force)
"Load all extensions listed in `org-modules'."
(when (or force (not org-modules-loaded))