diff --git a/lisp/org-list.el b/lisp/org-list.el index a6f7ff73e..f5e04fef6 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1586,6 +1586,8 @@ have changed. Initial position of cursor is restored after the changes." (let* ((pos (copy-marker (point))) + (inlinetask-re (and (featurep 'org-inlinetask) + (org-inlinetask-outline-regexp))) (item-re (org-item-re)) (shift-body-ind (function @@ -1598,9 +1600,14 @@ Initial position of cursor is restored after the changes." (while (or (> (point) beg) (and (= (point) beg) (not (looking-at item-re)))) - (when (org-looking-at-p "^[ \t]*\\S-") + (cond + ;; Skip inline tasks + ((and inlinetask-re (looking-at inlinetask-re)) + (org-inlinetask-goto-beginning)) + ;; Shift only non-empty lines + ((org-looking-at-p "^[ \t]*\\S-") (let ((i (org-get-indentation))) - (org-indent-line-to (+ i delta)))) + (org-indent-line-to (+ i delta))))) (forward-line -1))))) (modify-item (function diff --git a/lisp/org.el b/lisp/org.el index 64a597977..23137ecd5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18833,6 +18833,8 @@ If point is in an inline task, mark that task instead." (org-drawer-regexp (or org-drawer-regexp "\000")) (inline-task-p (and (featurep 'org-inlinetask) (org-inlinetask-in-task-p))) + (inline-re (and inline-task-p + (org-inlinetask-outline-regexp))) column bpos bcol tpos tcol) (beginning-of-line 1) (cond @@ -18880,8 +18882,12 @@ If point is in an inline task, mark that task instead." (beginning-of-line 0) (while (and (not (bobp)) (not (looking-at org-drawer-regexp)) - ;; skip comments, verbatim, empty lines, tables, - ;; inline tasks, lists, drawers and blocks + ;; When point started in an inline task, do not move + ;; above task starting line. + (not (and inline-task-p + (looking-at inline-re))) + ;; Skip comments, verbatim, empty lines, tables, + ;; inline tasks, lists, drawers and blocks. (or (and (looking-at "[ \t]*:END:") (re-search-backward org-drawer-regexp nil t)) (and (looking-at "[ \t]*#\\+end_")