I'd like to copy part of a buffer including all images. The code below copies the text but not the image. How do I copy images and how do I search for images in a buffer?
(insert
(with-current-buffer (get-buffer-create "buf")
(insert "-->")
(put-image (find-image '((:type jpeg :file "~/foo.jpg")))
(point))
(insert "<--")
(buffer-substring (point-min) (point-max))))
buffer-substring
. I'm still looking for how to insert a string in the buffer, including its display property. – JeanPierre Mar 11 '20 at 18:03copy-overlay
. But I do not know what to do with this copy. How do I insert it? – Andreas Matthias Mar 11 '20 at 20:16