* [BUG] org-num-mode does not clear previous numbers [9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)]
@ 2022-10-19 2:08 Ruijie Yu via General discussions about Org-mode.
2022-10-20 4:53 ` Ihor Radchenko
0 siblings, 1 reply; 2+ messages in thread
From: Ruijie Yu via General discussions about Org-mode. @ 2022-10-19 2:08 UTC (permalink / raw)
To: emacs-orgmode
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------
When I call `(org-num-mode)' from lisp multiple times on a single
orgmode buffer, I get multiple numberings on each heading.
Subsequently, when I call `(org-num-mode -1)' or `(org-num--clear)',
only one layer of numberings are removed.
This behavior is observed at the build below, but should still be
reproducible in current HEAD (4179d1205ed791254aa21fadf262623bc805595d).
I have also successfully replicated this issue from a `emacs -Q -nw'
environment, using the same orgmode version. Because of this, I have
removed the "current state" section since they are proven irrelevant.
The offending code is the `cond' construct in `org-num-mode' minor mode
definition, where we are directly resetting `org-num--overlays'. I
think we should run something like `(org-num--clear)' before the two
`setq''s, so that the previous numbers are cleared.
Alternatively (and probably a bad advice), maybe we could simply not
execute the "enable" branch in `cond' when `org-num--overlays' is
non-nil?
I don't have a full understanding of the role of `org-num--numbering',
so I don't have anything to say about this variable.
Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6)
of 2022-10-14
Package: Org mode version 9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)
current state:
==============
;; omitted
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUG] org-num-mode does not clear previous numbers [9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)]
2022-10-19 2:08 [BUG] org-num-mode does not clear previous numbers [9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)] Ruijie Yu via General discussions about Org-mode.
@ 2022-10-20 4:53 ` Ihor Radchenko
0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2022-10-20 4:53 UTC (permalink / raw)
To: Ruijie Yu; +Cc: emacs-orgmode
Ruijie Yu via "General discussions about Org-mode."
<emacs-orgmode@gnu.org> writes:
> When I call `(org-num-mode)' from lisp multiple times on a single
> orgmode buffer, I get multiple numberings on each heading.
> Subsequently, when I call `(org-num-mode -1)' or `(org-num--clear)',
> only one layer of numberings are removed.
>
> This behavior is observed at the build below, but should still be
> reproducible in current HEAD (4179d1205ed791254aa21fadf262623bc805595d).
Thanks for reporting!
Fixed on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7f8e616f3b1fbe1c4f893c8ba94b13e908dcd8b7
--
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-20 4:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 2:08 [BUG] org-num-mode does not clear previous numbers [9.5.5 (9.5.5-g9ce472 @ /home/user/.config/emacs/straight/build/org/)] Ruijie Yu via General discussions about Org-mode.
2022-10-20 4:53 ` Ihor Radchenko
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).