diff options
| author | Stefan Monnier | 2010-02-11 14:35:36 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-02-11 14:35:36 -0500 |
| commit | 48b1e7cf2bf6bf70340c49aaac393176bf3d7aaf (patch) | |
| tree | 742297fdbe6db836aae9756cc8e897c85c12a0da | |
| parent | c07ff221194a2d27346fb7fa3d4c8a877d3db66d (diff) | |
| download | emacs-48b1e7cf2bf6bf70340c49aaac393176bf3d7aaf.tar.gz emacs-48b1e7cf2bf6bf70340c49aaac393176bf3d7aaf.zip | |
* subr.el (copy-overlay): Handle deleted overlays.
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/subr.el | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5ad1f14462..559d4f54800 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2010-02-11 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2010-02-11 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * subr.el (copy-overlay): Handle deleted overlays. | ||
| 4 | |||
| 3 | * man.el (Man-completion-table): Don't signal an error if we can't run | 5 | * man.el (Man-completion-table): Don't signal an error if we can't run |
| 4 | manual-program (bug#4056). | 6 | manual-program (bug#4056). |
| 5 | 7 | ||
diff --git a/lisp/subr.el b/lisp/subr.el index b80988ad723..3b5d977c1f8 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." | |||
| 2232 | 2232 | ||
| 2233 | (defun copy-overlay (o) | 2233 | (defun copy-overlay (o) |
| 2234 | "Return a copy of overlay O." | 2234 | "Return a copy of overlay O." |
| 2235 | (let ((o1 (make-overlay (overlay-start o) (overlay-end o) | 2235 | (let ((o1 (if (overlay-buffer o) |
| 2236 | ;; FIXME: there's no easy way to find the | 2236 | (make-overlay (overlay-start o) (overlay-end o) |
| 2237 | ;; insertion-type of the two markers. | 2237 | ;; FIXME: there's no easy way to find the |
| 2238 | (overlay-buffer o))) | 2238 | ;; insertion-type of the two markers. |
| 2239 | (overlay-buffer o)) | ||
| 2240 | (let ((o1 (make-overlay (point-min) (point-min)))) | ||
| 2241 | (delete-overlay o1) | ||
| 2242 | o1)))) | ||
| 2239 | (props (overlay-properties o))) | 2243 | (props (overlay-properties o))) |
| 2240 | (while props | 2244 | (while props |
| 2241 | (overlay-put o1 (pop props) (pop props))) | 2245 | (overlay-put o1 (pop props) (pop props))) |