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.
cursor
property but that didn't work. Any ideas? – pavpanchekha Aug 27 '15 at 19:19cursor
property again. It's a tricky property to use, and I've often had to play with it for a while until it worked. – Stefan Aug 28 '15 at 02:58