Subject: outline-mode: attempting to open folded sections does not work as expected inside a deeply nested header

From: James Cherti <[email-masked]>
Date: Thu, 21 Aug 2025 14:08:49 -0400

When using outline-mode or outline-minor-mode, attempting to
open folded sections (outline-show-entry) does not work as
expected when the cursor is positioned inside a deeply
nested header.

Steps to Reproduce:
-------------------
1. Open an outline-mode buffer with multiple
    nested headers, for example:
--8<---------------cut here---------------start------------->8---
Level 1
** Level 2
*** Level 3
**** Level 4: A
Some content here
Some content here
Some content here
Some content here
**** Level 4: B
Some content here
Some content here
Some content here
Some content here
**** Level 4: C
Some content here
Some content here< PUT THE CURSOR HERE
Some content here
Some content here
**** Level 4: D
Some content here
Some content here
Some content here
Some content here
Some content here
**** Level 4: E
Some content here
Some content here
Some content here
--8<---------------cut here---------------start------------->8---

2. Put the cursor before `< PUT THE CURSOR HERE`

3. Collapse all folds with: (hide-sublevels 1)

6. Show entry: (outline-show-entry)

The folds fail to expand fully in nested hierarchies, leaving all 
content hidden except for `level 4: C`.

Screenshot: 
https://github.com/user-attachments/assets/2ea6c3bd-0284-40a7-90e5-1619bdf3acc5

Expected Behavior:
------------------
The expected behavior is that only the heading at point (and
its associated content) should be expanded, while all
ancestor headings remain collapsed. (Similar to other editors.)

Actual Behavior:
----------------
Only the heading at point expands, while other headings
remain invisible, which is confusing. In some cases, these
hidden headings cannot be revealed until the parent heading
is first collapsed and then expanded again.

Environment:
------------
* Emacs version: 30.2 and master branch 
(ade6608e2587452c8ea565ce3057879379ebd0b5)

--
James Cherti
GitHub: https://github.com/jamescherti
Website: https://www.jamescherti.com/