Subject: bug#57972: 29.0.50; Autoloaded function raises (void-function org-element-cache-reset) when called within major-mode body

From: Eli Zaretskii <[email-masked]>
Date: Wed, 21 Sep 2022 16:14:37 +0300

> From: Ihor Radchenko <[email-masked]>
> Date: Wed, 21 Sep 2022 21:00:08 +0800
> Cc: [email-masked]
> 
>  Alternatively, a complete recipe (without referring to directories
>  that I definitely don't have here) to reproduce the problem could
>  answer all those questions succinctly and efficiently.
> 
> Here it is
> 1. cd /tmp
> 2. git clone git://git.sv.gnu.org/emacs/org-mode.git

So reproducing this requires the development version of Org?

> 3. cd org-mode
> 4. make autoloads
> 5. Create /tmp/bug.el with the following contents:
> -----
> (add-to-list 'load-path "/tmp/org-mode/lisp")
> (require 'org)
> -----
> 6. Create /tmp/bug.org with the following contents:
> -----
> * TODO start clock on this test item
> -----
> 7. emacs -Q /tmp/bug.el
> 8. M-x eval-buffer
> 9. C-x C-f /tmp/bug.org
> 10. Observe error in echo area

I cannot reproduce with the version of Org we have on the Emacs
master branch.