org-list: ignore inline tasks when shifting an item, and fix indentation
* lisp/org-list.el (org-list-struct-apply-struct): inline tasks along with their content must stay at column 0 even if the item is gaining indentation. Moreover, fix indentation of text in an inline task, now it can be in such a task within a list.
This commit is contained in:
parent
349196def4
commit
f7ebd6bcf0
|
@ -1586,6 +1586,8 @@ have changed.
|
||||||
|
|
||||||
Initial position of cursor is restored after the changes."
|
Initial position of cursor is restored after the changes."
|
||||||
(let* ((pos (copy-marker (point)))
|
(let* ((pos (copy-marker (point)))
|
||||||
|
(inlinetask-re (and (featurep 'org-inlinetask)
|
||||||
|
(org-inlinetask-outline-regexp)))
|
||||||
(item-re (org-item-re))
|
(item-re (org-item-re))
|
||||||
(shift-body-ind
|
(shift-body-ind
|
||||||
(function
|
(function
|
||||||
|
@ -1598,9 +1600,14 @@ Initial position of cursor is restored after the changes."
|
||||||
(while (or (> (point) beg)
|
(while (or (> (point) beg)
|
||||||
(and (= (point) beg)
|
(and (= (point) beg)
|
||||||
(not (looking-at item-re))))
|
(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)))
|
(let ((i (org-get-indentation)))
|
||||||
(org-indent-line-to (+ i delta))))
|
(org-indent-line-to (+ i delta)))))
|
||||||
(forward-line -1)))))
|
(forward-line -1)))))
|
||||||
(modify-item
|
(modify-item
|
||||||
(function
|
(function
|
||||||
|
|
10
lisp/org.el
10
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"))
|
(org-drawer-regexp (or org-drawer-regexp "\000"))
|
||||||
(inline-task-p (and (featurep 'org-inlinetask)
|
(inline-task-p (and (featurep 'org-inlinetask)
|
||||||
(org-inlinetask-in-task-p)))
|
(org-inlinetask-in-task-p)))
|
||||||
|
(inline-re (and inline-task-p
|
||||||
|
(org-inlinetask-outline-regexp)))
|
||||||
column bpos bcol tpos tcol)
|
column bpos bcol tpos tcol)
|
||||||
(beginning-of-line 1)
|
(beginning-of-line 1)
|
||||||
(cond
|
(cond
|
||||||
|
@ -18880,8 +18882,12 @@ If point is in an inline task, mark that task instead."
|
||||||
(beginning-of-line 0)
|
(beginning-of-line 0)
|
||||||
(while (and (not (bobp))
|
(while (and (not (bobp))
|
||||||
(not (looking-at org-drawer-regexp))
|
(not (looking-at org-drawer-regexp))
|
||||||
;; skip comments, verbatim, empty lines, tables,
|
;; When point started in an inline task, do not move
|
||||||
;; inline tasks, lists, drawers and blocks
|
;; 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:")
|
(or (and (looking-at "[ \t]*:END:")
|
||||||
(re-search-backward org-drawer-regexp nil t))
|
(re-search-backward org-drawer-regexp nil t))
|
||||||
(and (looking-at "[ \t]*#\\+end_")
|
(and (looking-at "[ \t]*#\\+end_")
|
||||||
|
|
Loading…
Reference in New Issue