org-mouse-transform-to-outline: Do not rely on match-data from `org-back-to-heading'

* lisp/org-mouse.el (org-mouse-transform-to-outline): Use
`org-current-level' instead of relying upon `org-back-to-heading' to
set match data.

Reported-by: Nick Dokos <ndokos@gmail.com>
Link: https://orgmode.org/list/87352hk0nt.fsf@alphaville.usersys.redhat.com
This commit is contained in:
Ihor Radchenko 2023-06-24 15:33:13 +03:00
parent f56ca5009e
commit 57bb9cada3
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 1 deletions

View File

@ -975,7 +975,7 @@ This means, between the beginning of line and the point."
(interactive)
(org-back-to-heading)
(let ((minlevel 1000)
(replace-text (concat (match-string 0) "* ")))
(replace-text (concat (make-string (org-current-level) ?*) "* ")))
(beginning-of-line 2)
(save-excursion
(while (not (or (eobp) (looking-at org-outline-regexp)))