From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Kuba Orlik via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61685: 28.2; imenu in org-mode is wrong for the first org file opened in a given session Date: Tue, 21 Feb 2023 19:37:50 +0100 Message-ID: <87r0ui3lvl.fsf@kuba-orlik.name> Reply-To: Kuba Orlik Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1092"; mail-complaints-to="usenet@ciao.gmane.io" To: 61685@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 21 19:38:43 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUXXG-000AaM-2B for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Feb 2023 19:38:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUXX3-0006AO-4n; Tue, 21 Feb 2023 13:38:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUXWp-00066s-M0 for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 13:38:19 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUXWb-0005oM-T4 for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 13:38:15 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUXWb-0001ob-Me for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 13:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kuba Orlik Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 18:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61685 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16770046796967 (code B ref -1); Tue, 21 Feb 2023 18:38:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Feb 2023 18:37:59 +0000 Original-Received: from localhost ([127.0.0.1]:57248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUXWY-0001oI-B4 for submit@debbugs.gnu.org; Tue, 21 Feb 2023 13:37:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUXWT-0001o6-MQ for submit@debbugs.gnu.org; Tue, 21 Feb 2023 13:37:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUXWT-0005tw-GE for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 13:37:53 -0500 Original-Received: from nyuno.kuba-orlik.name ([159.69.83.182]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUXWP-0005mS-Tv for bug-gnu-emacs@gnu.org; Tue, 21 Feb 2023 13:37:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kuba-orlik.name; s=mail; t=1677004665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=3Bt5TaKFJWQny2qlrxEZSXPsCjD67lC+ZvPAXzw2frw=; b=EKxtHxa8Ch7m/C372mUknddrigDumsznBNXd2i74QcYssn3XkyDyNjZ/IoKFn9gzKDxJhC /0sGiRl8oZ3qronFvbySCIPaTKBZLSgCXNbNkW5YeiM8Yu6ZtXb5mMrAbXK39F33XDEBtF o0XX5WA1twNSHmLcIcxN/oJI7y07CmI= Received-SPF: pass client-ip=159.69.83.182; envelope-from=kontakt@kuba-orlik.name; helo=nyuno.kuba-orlik.name X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:256308 Archived-At: 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))