1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

* subr.el (copy-overlay): Handle deleted overlays.

This commit is contained in:
Stefan Monnier 2010-02-11 14:35:36 -05:00
parent c07ff22119
commit 48b1e7cf2b
2 changed files with 10 additions and 4 deletions

View file

@ -2232,10 +2232,14 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
(defun copy-overlay (o)
"Return a copy of overlay O."
(let ((o1 (make-overlay (overlay-start o) (overlay-end o)
;; FIXME: there's no easy way to find the
;; insertion-type of the two markers.
(overlay-buffer o)))
(let ((o1 (if (overlay-buffer o)
(make-overlay (overlay-start o) (overlay-end o)
;; FIXME: there's no easy way to find the
;; insertion-type of the two markers.
(overlay-buffer o))
(let ((o1 (make-overlay (point-min) (point-min))))
(delete-overlay o1)
o1))))
(props (overlay-properties o)))
(while props
(overlay-put o1 (pop props) (pop props)))