Subject: Re: bug#25246: 25.1.90; Buffer not responsible with overlay at buffer end.

From: [email-masked]
Date: Thu, 22 Dec 2016 08:55:41 -0500

tags 25246 confirmed
quit

"Stefan-W. Hahn" <[email-masked]> writes:

>
> I have the following problem:
>
> For showing some information in compile buffer I have a function which
> uses the hooks compilation-start-hook and compilation-filter-hook to
> scan the compile buffer while compiling and adding an overlay together
> with information of the compilation at the end of the compile buffer.
>
> The compile buffer has
>   truncate-lines t
>
> And the function to add the overlay is like:
>
> (defun xx ()
>   (interactive)
>   (let ((text (propertize
>                 (concat
>                 (format "Already done %d test (%d positive, %d negative, %d undecided).\n"
>                         0 0 0 0))
>                'face 'highlight))
>         (ov (make-overlay (point-min) (point-min) nil 'front-advance)))
>     (overlay-put ov 'after-string text)
>     (goto-char (point-max))
>     (move-overlay ov (point-at-bol) (point-at-eol))))
>
> Together with an content of a buffer like:
>
> --- snipp
>     xxxx xxxxxx xxxxxx `xxxxxxxx_xxxxx_xxxx.xxx'.
> ./../../xxxxx/xxxxxx xxxxxxxxxxxxx.xxx xxxxxxx.xxx xxxxxxx.xxx xxxxxxxxx.xxx xxxxx.xxx xxxxxxxxxxxx.xxx xxxxxxxxx.xxx xxxxxxxxxx.xxx xxx_xxxx.xxx xxxxxxxxx.xxx xxxxxxxxxx.xxx xxxxxxxxxx.xxxxxxxxxxxxx.xxxxxxxxxxxxx.xxxxxxxxxxxxx.xxxxxxxxxxxx
> --- snipp
>
> The last line is longer then the screen width, so truncated.
>
> If running the above defined funtion xx in this buffer (with emacs -Q), the
> buffer is not responsible any more afterwards.
>
> If truncate-lines is nil, it works.

I think this is a similar case to #24633 "highlight-region func using
(window-hscroll) in :align-to spec can cause inf loop".  If you try your
recipe in the master branch, Emacs won't freeze, although the overlay
you put blinks in and out of visibility on every redisplay (trigged by
cursor blinking).