Mercurial > emacs
comparison lisp/image.el @ 26007:774b2504710b
(insert-image): Copy the image spec and add an intangible property.
author | Dave Love <fx@gnu.org> |
---|---|
date | Wed, 13 Oct 1999 17:38:18 +0000 |
parents | 6ae50308e8a3 |
children | 6bb2a4a0413e |
comparison
equal
deleted
inserted
replaced
26006:ca384fd94454 | 26007:774b2504710b |
---|---|
130 (error "Invalid area %s" area)) | 130 (error "Invalid area %s" area)) |
131 (when area | 131 (when area |
132 (setq image (list (list 'margin area) image))) | 132 (setq image (list (list 'margin area) image))) |
133 (let ((start (point))) | 133 (let ((start (point))) |
134 (insert string) | 134 (insert string) |
135 ;; Copy `image' so that inserting it twice in a row (adjacently) | |
136 ;; displays two copies of the image. | |
135 (add-text-properties start (point) | 137 (add-text-properties start (point) |
136 (list 'display image | 138 (list 'display (copy-sequence image) |
139 'intangible (list t) ; something unique | |
137 'rear-nonsticky (list 'display))))) | 140 'rear-nonsticky (list 'display))))) |
138 | 141 |
139 | 142 |
140 ;;;###autoload | 143 ;;;###autoload |
141 (defun remove-images (start end &optional buffer) | 144 (defun remove-images (start end &optional buffer) |
142 "Remove images between START and END in BUFFER. | 145 "Remove images between START and END in BUFFER. |
143 Remove only images that were put in BUFFER with calls to `put-image'. | 146 Remove only images that were put in BUFFER with calls to `put-image'. |