>From 2fc86ae438725e5f0656c8966eaa4935e0203ee4 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Fri, 22 Feb 2019 18:23:40 +0100 Subject: [PATCH 3/3] org-clock-in: Fix drawer-less clocking * lisp/org-clock.el (org-clock-in): Ensure insertion in current restriction. This commit ensures that drawer-less clock-lines are created within the current restriction. --- lisp/org-clock.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 5624af32a..5c9b0a1cf 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1292,6 +1292,7 @@ the default behavior." (org-todo org-clock-in-switch-to-state))) (setq org-clock-heading (org-clock--mode-line-heading)) (org-clock-find-position org-clock-in-resume) + (forward-char -1) (cond ((and org-clock-in-resume (looking-at @@ -1315,8 +1316,8 @@ the default behavior." (sit-for 2) (throw 'abort nil)) (t - (insert-before-markers "\n") - (backward-char 1) + (insert "\n") + (org-indent-line) (org-indent-line) (when (and (save-excursion (end-of-line 0) -- 2.20.1