From: apple@unix.mail-host-address-is-not-set
To: emacs-orgmode@gnu.org
Subject: [BUG] `org-format-outline-path` returns inproper `org-level-N` face
for a heading if its level is not consequent from its parent heading.
[9.6.15 (release_9.6.15 @ /usr/share/emacs/29.4/lisp/org/)]
Date: Fri, 18 Oct 2024 17:28:33 +0800
Message-ID: <87ldylahfi.fsf@unix.mail-host-address-is-not-set>
--text follows this line--

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

For example, in an org-mode buffer
```
* Heading level 1
*** Heading level 3 ; where the point is at

```

Run `(org-format-outline-path (org-get-outline-path t nil))` in
`eval-expression`.

The output is `#("Heading level 1/Heading level 3" 0 15 (face org-level-1)
16 31 (face org-level-2))`.

Which doesn't work as expected, it should add face of `org-level-3` instead of
`org-level-2`.

Reproduced the same result by launching Emacs with `emacs -q`.

------------------------------------------------------------------------

Emacs  : GNU Emacs 29.4 (build 2, x86_64-unknown-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.0)
of 2024-10-13
Package: Org mode version 9.6.15 (release_9.6.15 @ /usr/share/emacs/29.4/lisp/org/)