Further evidence suggests that the "t taking precedence" version is wrong. It's more probable the the precedence is determined by the order of overlays in some C data-structure. On Mon, Mar 11, 2013 at 11:41 PM, E Sabof wrote: > The overlay with t value has precedence over other overlays. If the > problem occurs, I can run the following function, and it will get fixed in > existing windows. However if I create a new window, it will show only text. > If I press + in that window, a new overlay will be created. Perhaps the t > overlay was meant to be the default, and someone misunderstood it's effect. > > (defun 13887-fix-helper1 () > (interactive) > (let* ((ovs (overlays-at (point))) > (ov-t (find-if (lambda (ov) (eq (overlay-get ov 'window) t)) > ovs))) > (when ov-t (delete-overlay ov-t)))) > > Here is one more helper function which might be useful. > > (defun 13887-own-overlay-present-p () > (interactive) > (let* ((ovs (overlays-at (point)))) > (find-if (lambda (ov) (eq (overlay-get ov 'window) > (selected-window))) > ovs))) >