Thanks! Did not know about `org-with-limited-levels'. After reading the function docstring again, I see that it behaved correctly. However, it seems that `org-back-to-heading' is not really used according to the docstring in the org source code: - `org-agenda' with subtree restriction: the results are different if you call it below or above an inline task. - `org-attach', `org-attach-dir', `org-attach-tag', with point below/above an inline task behave differently - the following functions from org.el behave depending on the point position (below or above an inline task): `org-entry-beginning-position', `org-entry-end-position', `org-get-heading', `org-get-entry', `org-insert-heading-after-current', `org-promote', `org-demote', `org-move-subtree-down', etc. Some of the functions above give very unexpected results if the point is below an inline task. Would it make sense to add org specific macros to Hacking section of org manual? It is sometimes difficult to guess that some of these macros even exist. Best, Ihor Nicolas Goaziou writes: > Hllo, > > yantar92@gmail.com writes: > >> Consider calling =org-back-to-heading= for the following org entry: >> >> #+begin_src org >> * Sample entry >> >> Some text. >> >> *************** TODO Inline task >> *************** END >> >> Some more text. >> >> ->(point)<- >> >> Yet another piece of text. >> #+end_src >> >> The expected behaviour is that the point moves to the first line of the >> entry. >> However, the point moves to the end of the inline task. >> >> Indeed, the wrong behaviour is because =outline-regexp= variable is set >> to ="\\*+ "=, which includes inline tasks. > > This is the desired effect. Use the macro `org-with-limited-levels' to > ignore headlines. > > Regards, > > -- > Nicolas Goaziou