0.8)))
(defun image--get-image ()
- (let ((image (get-text-property (point) 'display)))
+ "Return the image at point."
+ (let ((image (get-char-property (point) 'display)))
(unless (eq (car-safe image) 'image)
(error "No image under point"))
image))
(defun image-save ()
"Save the image under point."
(interactive)
- (let ((image (get-text-property (point) 'display)))
- (when (or (not (consp image))
- (not (eq (car image) 'image)))
- (error "No image under point"))
+ (let ((image (image--get-image)))
(with-temp-buffer
(let ((file (plist-get (cdr image) :file)))
(if file