Skip to content

Commit

Permalink
org-up-element: Fix jumping up from inlinetask
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
yantar92 committed Oct 13, 2022
1 parent 601ce68 commit 0e4874f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lisp/org.el
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0e4874f

Please sign in to comment.