Subject: Re: bug#61685: 28.2; imenu in org-mode is wrong for the first org file opened in a given session

From: Ihor Radchenko <[email-masked]>
Date: Wed, 22 Feb 2023 11:14:20 +0000

Kuba Orlik via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <[email-masked]> writes:

> When opening an org file and running imenu, the structure is not parsed
> properly. I need to kill the buffer visiting the org file and find it
> again. This only affects the first org file opened in a given Emacs
> session.
>
> To reproduce:
> ...

Org activates Imenu support only after Imenu is loaded. Effective only
in Org buffers opened after Imenu is enabled.

I tried to clarify this in the manual.

See the attached.

>From cbab9ebf5521d327937e9e30e2de43b39c5dcdc5 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Ihor Radchenko <[email-masked]>
Date: Wed, 22 Feb 2023 14:11:11 +0300
Subject: [PATCH] org-manual.org: Clarify that Imenu support is activated in
 future Org buffers

* doc/org-manual.org (Packages that Org cooperates with): Clarify that
imenu should be loaded before Org mode is loaded in current buffer.

Reported-by: Kuba Orlik <[email-masked]>
Link: Emacs bug#61685
---
 doc/org-manual.org | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 5b6633417..6a625b42a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -20327,6 +20327,10 @@ *** Packages that Org cooperates with
   By default the index is two levels deep---you can modify the
   depth using the option ~org-imenu-depth~.
 
+  Org activates Imenu support only in the buffers opened after loading
+  Imenu library.  To enable Imenu support in an already opened Org
+  buffer, reload Org.
+
 - =speedbar.el= by Eric\nbsp{}M.\nbsp{}Ludlam ::
   #+cindex: @file{speedbar.el}
 
-- 
2.39.1

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>