|
@@ -380,7 +380,7 @@ the clocking selection, associated with the letter `d'."
|
|
|
(end (progn (outline-next-heading) (point)))
|
|
|
(re (concat "^[ \t]*" org-clock-string))
|
|
|
(cnt 0)
|
|
|
- first last)
|
|
|
+ first last ind-last)
|
|
|
(goto-char beg)
|
|
|
(when (eobp) (newline) (setq end (max (point) end)))
|
|
|
(when (re-search-forward "^[ \t]*:CLOCK:" end t)
|
|
@@ -397,11 +397,14 @@ the clocking selection, associated with the letter `d'."
|
|
|
(>= (1+ cnt) org-clock-into-drawer))
|
|
|
;; Wrap current entries into a new drawer
|
|
|
(goto-char last)
|
|
|
+ (setq ind-last (org-get-indentation))
|
|
|
(beginning-of-line 2)
|
|
|
- (if (org-at-item-p) (org-end-of-item))
|
|
|
+ (if (and (>= (org-get-indentation) ind-last)
|
|
|
+ (org-at-item-p))
|
|
|
+ (org-end-of-item))
|
|
|
(insert ":END:\n")
|
|
|
(beginning-of-line 0)
|
|
|
- (org-indent-line-function)
|
|
|
+ (org-indent-line-to ind-last)
|
|
|
(goto-char first)
|
|
|
(insert ":CLOCK:\n")
|
|
|
(beginning-of-line 0)
|