"Lennart Borgman (gmail)" <address@hidden> writes:
Stefan Monnier wrote:
Is it possible to retrieve from an overlay the parameters front-advance and
rear-advance that was given to make-overlay?
Without that it is not possible to make a new copy of an overlay AFAICS.
The source code of `copy-overlay' answers this question.
Thanks. Indeed it does ;-) -- BTW copy-overlay is not mentioned in Info.
(defun overlay-polarities (ov)
(let ((buf (overlay-buffer ov))
(start (overlay-start ov))
(end (overlay-end ov)))
(unwind-protect
(with-temp-buffer
(move-overlay ov 1 1)
(insert " ")
(list (> (overlay-start ov) 1)
(> (overlay-end ov) 1)))
(move-overlay ov buf start end))))
This at least has the advantage of not touching the original buffer.
But it is tasteless nevertheless.