diff options
| -rw-r--r-- | lisp/image.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/image.el b/lisp/image.el index b69bf930545..ab868f7db35 100644 --- a/lisp/image.el +++ b/lisp/image.el | |||
| @@ -971,7 +971,8 @@ default is 20%." | |||
| 971 | 0.8))) | 971 | 0.8))) |
| 972 | 972 | ||
| 973 | (defun image--get-image () | 973 | (defun image--get-image () |
| 974 | (let ((image (get-text-property (point) 'display))) | 974 | "Return the image at point." |
| 975 | (let ((image (get-char-property (point) 'display))) | ||
| 975 | (unless (eq (car-safe image) 'image) | 976 | (unless (eq (car-safe image) 'image) |
| 976 | (error "No image under point")) | 977 | (error "No image under point")) |
| 977 | image)) | 978 | image)) |
| @@ -1026,10 +1027,7 @@ default is 20%." | |||
| 1026 | (defun image-save () | 1027 | (defun image-save () |
| 1027 | "Save the image under point." | 1028 | "Save the image under point." |
| 1028 | (interactive) | 1029 | (interactive) |
| 1029 | (let ((image (get-text-property (point) 'display))) | 1030 | (let ((image (image--get-image))) |
| 1030 | (when (or (not (consp image)) | ||
| 1031 | (not (eq (car image) 'image))) | ||
| 1032 | (error "No image under point")) | ||
| 1033 | (with-temp-buffer | 1031 | (with-temp-buffer |
| 1034 | (let ((file (plist-get (cdr image) :file))) | 1032 | (let ((file (plist-get (cdr image) :file))) |
| 1035 | (if file | 1033 | (if file |