org-num-mode: Clear remaining num overlays before activation
* lisp/org-num.el (org-num-mode): Call `org-num--clear' when enabling the mode. This avoids duplicate overlays when the mode was active prior (org-num-mode +1) call. Reported-by: Ruijie Yu Link: https://orgmode.org/list/sdvbkq8a7lp.fsf@fw.net.yu
This commit is contained in:
parent
a7a579d06a
commit
7f8e616f3b
|
@ -461,6 +461,7 @@ NUMBERING is a list of numbers."
|
|||
(org-num-mode
|
||||
(unless (derived-mode-p 'org-mode)
|
||||
(user-error "Cannot activate headline numbering outside Org mode"))
|
||||
(org-num--clear)
|
||||
(setq org-num--numbering nil)
|
||||
(setq org-num--overlays (nreverse (org-num--number-region nil nil)))
|
||||
(add-hook 'after-change-functions #'org-num--verify nil t)
|
||||
|
|
Loading…
Reference in New Issue