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

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 17 Sep 2023 11:56:01 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61685: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61685
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61685: 28.2; imenu in org-mode is wrong for the first org file opened in a given session
From: Stefan Kangas <[email-masked]>
To: Ihor Radchenko <[email-masked]>, Kuba Orlik <[email-masked]>
Cc: [email-masked]
Date: Sun, 17 Sep 2023 04:55:06 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Ihor Radchenko <[email-masked]> writes:

> Ihor Radchenko <[email-masked]> writes:
>
>> 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.
>
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=cbab9ebf5

It seems like this issue was resolved, but was left open in the bug
tracker.  I'm therefore closing it now.

Subject: 28.2; imenu in org-mode is wrong for the first org file opened in a given session
From: Kuba Orlik <[email-masked]>
To: [email-masked]
Date: Tue, 21 Feb 2023 19:37:50 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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:

1. Create an org file with the following contents:

```
* Some Heading
** subheading
** subheading 2
* Another heading
** another subheading
** another subheading 2
```

save it as repro.org

2. Run `emacs -Q repro.org`

3. Eval `(imenu-add-menubar-index)` in the org buffer

4. Check the results in the `index` menu in the menu-bar: they are
   wrong. they should be nested to reflect the structure of the
   headings, but they are just flat.

5. Kill the org buffer (C-x k)

6. Open the org file again, without closing emacs

7. Eval `(imenu-add-menubar-index)` in the org buffer

8. Check the `index` menu in the menu-bar: the headings are now properly
parsed and nested.

In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.36, cairo version 1.17.6)
 of 2023-01-03 built on 2
Windowing system distributor 'The X.Org Foundation', version 11.0.12201008
System Description: Arch Linux

Configured using:
 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib
 --localstatedir=/var --with-cairo --with-harfbuzz --with-libsystemd
 --with-modules --with-x-toolkit=gtk3 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2
 -Wformat -Werror=format-security -fstack-clash-protection
 -fcf-protection -g
 -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE
XIM XPM GTK3 ZLIB

Important settings:
  value of $LC_MONETARY: pl_PL.UTF-8
  value of $LC_NUMERIC: pl_PL.UTF-8
  value of $LC_TIME: pl_PL.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  mu4e-column-faces-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  global-prettier-mode: t
  shell-dirtrack-mode: t
  apheleia-global-mode: t
  apheleia-mode: t
  counsel-projectile-mode: t
  projectile-mode: t
  counsel-mode: t
  ivy-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  delete-selection-mode: t
  global-tree-sitter-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/kuba/.emacs.d/straight/build/transient/transient hides /usr/share/emacs/28.2/lisp/transient

Features:
(shadow emacsbug re-builder descr-text misearch multi-isearch ffap
cl-print help-fns radix-tree apropos cus-edit cus-start cus-load
cal-move apheleia org-archive org-colview sort gnus-cite smiley
shr-color mm-archive mail-extr qp diary-lib diary-loaddefs cal-iso
org-duration vc-git vc-dispatcher org-element avl-tree ol-eww eww
url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-search eieio-opt speedbar ezimage dframe ol-docview doc-view
jka-compr image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi
face-remap org-agenda org-refile solarized-selenized-light-theme
solarized-palettes solarized solarized-faces mu4e-column-faces inline
memoize memoize-autoloads mu4e mu4e-org org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete
org-list org-faces org-entities noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc
org-compat advice org-macs org-loaddefs find-func mu4e-main mu4e-view
gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum gnus-group
gnus-undo gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source
utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader
wid-edit cal-menu calendar cal-loaddefs mu4e-headers mu4e-compose
mu4e-draft mu4e-actions smtpmail sendmail mu4e-search mu4e-lists
mu4e-bookmarks mu4e-mark mu4e-message shr kinsoku svg xml dom flow-fill
mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-server
mu4e-context mu4e-vars mu4e-helpers mu4e-config magit-bookmark bookmark
ido mu4e-column-faces-autoloads pcase dockerfile-mode-autoloads
web-mode-autoloads magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit magit-repos magit-apply
magit-wip magit-log which-func imenu magit-diff smerge-mode diff-mode
git-commit rx log-edit message rmc puny rfc822 mml mml-sec epa derived
epg rfc6068 epg-config gnus-util rmail rmail-loaddefs mm-decode
mm-bodies mm-encode mailabbrev mail-utils gmm-utils mailheader pcvs-util
add-log magit-core magit-autorevert autorevert filenotify magit-margin
magit-transient magit-process with-editor magit-mode transient magit-git
magit-base magit-section crm compat-27 compat-26 compat compat-macs
magit-autoloads magit-section-autoloads git-commit-autoloads
with-editor-autoloads transient-autoloads compat-autoloads prettier
editorconfig editorconfig-core editorconfig-core-handle
editorconfig-fnmatch package browse-url url-handlers tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete parse-time iso8601 time-date ls-lisp format-spec nvm f
f-shortdoc shortdoc dash s iter2 generator prettier-autoloads
editorconfig-autoloads nvm-autoloads f-autoloads s-autoloads
iter2-autoloads apheleia-autoloads easy-mmode edmacro kmacro
counsel-projectile ivy-prescient prescient char-fold projectile lisp-mnt
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr grep
ibuf-ext ibuffer ibuffer-loaddefs thingatpt counsel xdg xref project
swiper ivy ivy-faces ivy-overlay colir color ivy-prescient-autoloads
prescient-autoloads counsel-projectile-autoloads counsel-autoloads
swiper-autoloads ivy-autoloads projectile-autoloads undo-tree diff queue
undo-tree-autoloads queue-autoloads finder-inf undo-fu-autoloads delsel
server tree-sitter-langs tree-sitter-langs-build tar-mode arc-mode
archive-mode url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source eieio
eieio-core eieio-loaddefs password-cache json url-vars mailcap pp
tree-sitter-hl tree-sitter tree-sitter-load tree-sitter-cli map tsc
tsc-dyn tsc-dyn-get compile text-property-search comint ansi-color ring
dired-aux dired dired-loaddefs tsc-obsolete tree-sitter-langs-autoloads
tree-sitter-autoloads tsc-autoloads solarized-theme-autoloads
dash-autoloads info straight-autoloads cl-seq cl-extra help-mode seq
byte-opt straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp
byte-compile cconv iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 3070189 182089)
 (symbols 48 52783 17)
 (strings 32 444754 5459)
 (string-bytes 1 9903280)
 (vectors 16 93443)
 (vector-slots 8 2228997 183968)
 (floats 8 598 463)
 (intervals 56 421229 21137)
 (buffers 992 64))