I'm using after-string overlays as in this question to put text on the right hand side of the buffer, like this:
(let ((overlay (make-overlay (point-max) (point-max) (current-buffer))))
(overlay-put overlay 'intangible t)
(overlay-put overlay 'before-string
(concat
(propertize " " 'display `(space :align-to (- right-fringe ,(1+ (length text)))))
text))
overlay))
This works well, but if I position the cursor at the end of the buffer at insert characters, I insert past the overlay.
In the image, the check mark is my overlay, and the x
after it is something I inserted by typing an x
after the word Type
, which was previously the last word in the buffer.
How can I stop this from happening? I'd like the overlay to permanently sit past all the actual text in the buffer.