[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes the functions to create, delete and move overlays, and to examine their contents.
The arguments front-advance and rear-advance specify the insertion type for the start of the overlay and for the end of the overlay, respectively. See section 31.5 Marker Insertion Types.
A deleted overlay is not permanently disconnected. You can give it a
position in a buffer again by calling move-overlay
.
If buffer is omitted, overlay stays in the same buffer it was already associated with; if overlay was deleted, it goes into the current buffer.
The return value is overlay.
This is the only valid way to change the endpoints of an overlay. Do not try modifying the markers in the overlay by hand, as that fails to update other vital data structures and can cause some overlays to be "lost".
Here are some examples:
;; Create an overlay. (setq foo (make-overlay 1 10)) => #<overlay from 1 to 10 in display.texi> (overlay-start foo) => 1 (overlay-end foo) => 10 (overlay-buffer foo) => #<buffer display.texi> ;; Give it a property we can check later. (overlay-put foo 'happy t) => t ;; Verify the property is present. (overlay-get foo 'happy) => t ;; Move the overlay. (move-overlay foo 5 20) => #<overlay from 5 to 20 in display.texi> (overlay-start foo) => 5 (overlay-end foo) => 20 ;; Delete the overlay. (delete-overlay foo) => nil ;; Verify it is deleted. foo => #<overlay in no buffer> ;; A deleted overlay has no position. (overlay-start foo) => nil (overlay-end foo) => nil (overlay-buffer foo) => nil ;; Undelete the overlay. (move-overlay foo 1 20) => #<overlay from 1 to 20 in display.texi> ;; Verify the results. (overlay-start foo) => 1 (overlay-end foo) => 20 (overlay-buffer foo) => #<buffer display.texi> ;; Moving and deleting the overlay does not change its properties. (overlay-get foo 'happy) => t |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |