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

From: Juri Linkov <[email-masked]>
Date: Fri, 11 Nov 2022 10:13:38 +0200

>>> Also, what will happen with ellipsis when there is 'display property?
>>
>> Then ellipsis could be added to (overlay-put o 'display "...\n").
>
> Then, changes to `buffer-invisibility-spec' will not affect the overlay.

Frankly speaking, I don't understand why the problem can't be solved
simply by adding a newline without any faces or text properties
before the next outline heading.

So for example, the problem with shortdoc discussed in bug#53981,
can be solved just by adding a newline:

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 18b758a9ca3..6000f1f5375 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1385,7 +1385,7 @@ shortdoc-display-group
         ;; There may be functions not yet defined in the data.
         ((fboundp (car data))
          (when prev
-           (insert (make-separator-line)))
+           (insert (make-separator-line) "\n"))
          (setq prev t)
          (shortdoc--display-function data))))
      (cdr (assq group shortdoc--groups))))