Subject: bug#349: show-paren-mode overlay extending onto new text

From: Stefan Monnier <[email-masked]>
Date: Mon, 02 Jun 2008 09:47:54 -0400

>> I wondered if the make-overlay in show-paren-function
>> might have the "rear-advance" arg nil, unless there's ever a time it
>> ought to extend.
>> 
>> In GNU Emacs 22.2.1 (i486-pc-linux-gnu, GTK+ Version 2.12.9)
> [...]
>> show-paren-mode: t
> [...]

> Version 1.75 of paren.el has
> 		(setq show-paren-overlay-1 (make-overlay from to nil t)))
> and
> 	      (setq show-paren-overlay (make-overlay from to nil t))))
> hence both overlays seem to have "rear-advance" nil.

Indeed, the problem is that compile.el uses insert-before-markers.
So no amount of rear-advance will help.

I have been using a simple patch which adds a buffer-local variable
which I called `window-marker-insertion-type' (but I realize now it
should rather be `window-point-insertion-type'), so major modes can set
this variable if they want `window-point' to be "move after insertion".

This way, compile.el (and other similar packages) might not need to use
insert-before-markers.

        Stefan