emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retrieve front-advance from make-overlay


From: Lennart Borgman (gmail)
Subject: Re: Retrieve front-advance from make-overlay
Date: Mon, 15 Jan 2007 10:18:58 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

David Kastrup wrote:
"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.


Thanks David, I did not that one. I will try it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]