org-up-element: Fix jumping up from inlinetask

* lisp/org.el (org-up-element): Do not assume that
`org-back-to-heading' skips inlinetasks.  Avoid that `if' branch by
skipping over section parents.

Reported-by: Michael Dauer <mick.dauer@gmail.com>
Link: https://orgmode.org/list/CAP7OBxKKeuK_uH46SyEqQbsuBsE=XPkB=ks1TkCZTwyPZ40KaA@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2022-10-13 11:05:33 +08:00
parent 601ce688d5
commit 0e4874f17c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 4 additions and 1 deletions

View File

@ -20949,8 +20949,11 @@ Move to the previous element at the same level, when possible."
(unless (org-up-heading-safe) (user-error "No surrounding element"))
(let* ((elem (org-element-at-point))
(parent (org-element-property :parent elem)))
;; Skip sections
(when (eq 'section (org-element-type parent))
(setq parent (org-element-property :parent parent)))
(if (and parent
(not (memq (org-element-type parent) '(section org-data))))
(not (eq (org-element-type parent) 'org-data)))
(goto-char (org-element-property :begin parent))
(if (org-with-limited-levels (org-before-first-heading-p))
(user-error "No surrounding element")