From 57bb9cada34bb72dbf445fde8290cc388d5b63e0 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sat, 24 Jun 2023 15:33:13 +0300 Subject: [PATCH] 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 Link: https://orgmode.org/list/87352hk0nt.fsf@alphaville.usersys.redhat.com --- lisp/org-mouse.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el index 3b2c4cba6..e0671f3d7 100644 --- a/lisp/org-mouse.el +++ b/lisp/org-mouse.el @@ -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)))