* lisp/image.el (image-at-point-p): New defun.
* doc/lispref/display.texi (Showing Images): Document above new defun.
@code{max-image-size} is subsequently changed (@pxref{Image Cache}).
@end defvar
+@defun image-at-point-p
+This function returns @code{t} if point is on an image, and @code{nil}
+otherwise.
+@end defun
+
Images inserted with the insertion functions above also get a local
keymap installed in the text properties (or overlays) that span the
displayed image. This keymap defines the following commands:
correct. The 'kbd-valid-p' predicate does a stricter check of the
syntax.
++++
+** New function 'image-at-point-p'.
+This function returns t if point is on a valid image, and nil
+otherwise.
+
\f
* Changes in Emacs 29.1 on Non-Free Operating Systems
(error "No image under point"))
image))
+;;;###autoload
+(defun image-at-point-p ()
+ "Return non-nil if there is an image at point."
+ (condition-case nil
+ (prog1 t (image--get-image))
+ (error nil)))
+
(defun image--get-imagemagick-and-warn (&optional position)
(declare-function image-transforms-p "image.c" (&optional frame))
(unless (or (fboundp 'imagemagick-types) (image-transforms-p))