Subject: bug#59141: 28.1.90; Face :extend when all the line but trailing \n is invisible

From: Juri Linkov <[email-masked]>
Date: Sun, 20 Nov 2022 20:38:02 +0200

> As I mentioned, magit supports replacing its fringe bitmaps with
> ellipses.  See the magit-section-visibility-indicator user option, and
> the functions that act on it[1].  tl;dr the option can be set to
>
> * (SYMBOL1 . SYMBOL2): each symbol describes a fringe bitmap to be used
>   for expandable (1) or collapsible (2) sections,
>
> * (STRING . BOOLEAN): STRING is appended at the end of collapsed
>   sections.
>
> IIUC magit-section sets these ellipses via 'after-string overlays on the
> last character before a heading's newline, rather than adjusting display
> tables.
>
> Thanks for weighing in on how outline.el could be adapted, Juri.  Can't
> promise I'll be able to act on your advice and turn it into a patch
> anytime soon, but finally hashing out the implementation details between
> these two packages has made me more hopeful outline.el can be taught
> more tricks without resorting to ugly hacks.

Thanks for summarizing the relevant details of magit-section.
Now everything is clear.

>   (defun magit-section-maybe-paint-visibility-ellipses ()
>     ;; This is needed because we hide the body instead of "the body
>     ;; except the final newline and additionally the newline before
>     ;; the body"; otherwise we could use `buffer-invisibility-spec'.

This comment explains why this is needed.  I believe we could avoid
ugly hacks in outline.el because unlike magit-section, outline.el can
display arrows on the left side even on TTYs.  But since the default
ellipses should be disabled in any case, even when users don't want to use
the left-side arrows, we could add ellipses in a more clean way: as a new
value of the user option 'outline-minor-mode-use-buttons'.  So when it's
customized to 'ellipsis', the ellipsis overlay will be created in a new
pcase branch in outline--insert-button.