Commit 2bd53dc0 authored by Chong Yidong's avatar Chong Yidong
Browse files

* image-mode.el (image-toggle-display): Use file name if possible,

	instead of unnecessarily allocating a (possibly huge) lisp string.
parent c45c309f
2006-01-30 Chong Yidong <cyd@stupidchicken.com>
* image-mode.el (image-toggle-display): Use file name if possible,
instead of unnecessarily allocating a (possibly huge) lisp string.
2006-01-30 John Paul Wallington <jpw@pobox.com>
 
* subr.el (toplevel): Define `cl-assertion-failed' condition here
......
......@@ -137,11 +137,14 @@ and showing the image as an image."
(message "Repeat this command to go back to displaying the image")))
;; Turn the image data into a real image, but only if the whole file
;; was inserted
(let* ((data
(string-make-unibyte
(buffer-substring-no-properties (point-min) (point-max))))
(image
(create-image data nil t))
(let* ((image
(if (and (buffer-file-name)
(not (buffer-modified-p)))
(create-image (buffer-file-name))
(create-image
(string-make-unibyte
(buffer-substring-no-properties (point-min) (point-max)))
nil t)))
(props
`(display ,image
intangible ,image
......
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