From e42ae7682962bf9cf2f4e215422a1767bb90e397 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Tue, 9 Jul 2024 17:14:45 +0200 Subject: [PATCH] Improve 'put-image' documentation * doc/lispref/display.texi (Showing Images): Mention that it returns the created overlay. * lisp/image.el (put-image): And here. (cherry picked from commit 945335fec1e9349d05291c9abe0730777840f5b9) --- doc/lispref/display.texi | 4 +++- lisp/image.el | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 9cd398da9f8..f10595855b6 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -7123,7 +7123,9 @@ buffer's text. Internally, this function creates an overlay, and gives it a @code{before-string} property containing text that has a @code{display} -property whose value is the image. (Whew! that was a mouthful@dots{}) +property whose value is the image. (Whew! that was a mouthful@dots{}). +It returns the created overlay upon success, and also sets its +@code{put-image} property to @code{t}. @end defun @defun remove-images start end &optional buffer diff --git a/lisp/image.el b/lisp/image.el index c75c8ff765a..e16bd989ce7 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -638,7 +638,9 @@ IMAGE must be an image created with `create-image' or `defimage'. IMAGE is displayed by putting an overlay into the current buffer with a `before-string' STRING that has a `display' property whose value is the image. STRING defaults to \"x\" if it's nil or omitted. -The overlay created by this function has the `put-image' property set to t. +Upon success, this function returns the created overlay with its +`put-image' property set to t. + POS may be an integer or marker. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means -- 2.39.2