Commit 08aa6a05 authored by Charles A. Roelli's avatar Charles A. Roelli

Improve and make use of 'image--get-image'

* lisp/image.el (image--get-image): Add documentation, and
check overlays for images too (since function 'put-image' from
the same library uses overlays to insert images).
(image-save): Use 'image--get-image'.
parent d48f4c3b
......@@ -971,7 +971,8 @@ default is 20%."
(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"))
......@@ -1026,10 +1027,7 @@ default is 20%."
(defun image-save ()
"Save the image under point."
(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)))
(let ((file (plist-get (cdr image) :file)))
(if file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment