Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
dc255b24
Commit
dc255b24
authored
May 21, 2007
by
Chong Yidong
Browse files
(image-toggle-display): Don't clear image cache. Only use filename in
image spec if the file is readable. Call image-refresh.
parent
9ca9e00d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lisp/image-mode.el
lisp/image-mode.el
+7
-5
No files found.
lisp/image-mode.el
View file @
dc255b24
...
...
@@ -144,16 +144,17 @@ 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*
((
image
(
if
(
and
(
buffer-file-name
)
(
not
(
file-remote-p
(
buffer-file-name
)))
(
let*
((
filename
(
buffer-file-name
))
(
image
(
if
(
and
filename
(
file-readable-p
filename
)
(
not
(
file-remote-p
filename
))
(
not
(
buffer-modified-p
))
(
not
(
and
(
boundp
'archive-superior-buffer
)
archive-superior-buffer
))
(
not
(
and
(
boundp
'tar-superior-buffer
)
tar-superior-buffer
)))
(
progn
(
clear-image-cache
)
(
create-image
(
buffer-file-name
)))
(
create-image
filename
)
(
create-image
(
string-make-unibyte
(
buffer-substring-no-properties
(
point-min
)
(
point-max
)))
...
...
@@ -169,6 +170,7 @@ and showing the image as an image."
(
inhibit-read-only
t
)
(
buffer-undo-list
t
)
(
modified
(
buffer-modified-p
)))
(
image-refresh
image
)
(
add-text-properties
(
point-min
)
(
point-max
)
props
)
(
set-buffer-modified-p
modified
)
;; Inhibit the cursor when the buffer contains only an image,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment