aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2010-02-11 14:35:36 -0500
committerStefan Monnier <[email protected]>2010-02-11 14:35:36 -0500
commit48b1e7cf2bf6bf70340c49aaac393176bf3d7aaf (patch)
tree742297fdbe6db836aae9756cc8e897c85c12a0da /lisp/subr.el
parentc07ff221194a2d27346fb7fa3d4c8a877d3db66d (diff)
* subr.el (copy-overlay): Handle deleted overlays.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index b80988ad72..3b5d977c1f 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -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)))