emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/image-mode.el, v [EMACS_22_BASE]


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/image-mode.el, v [EMACS_22_BASE]
Date: Tue, 07 Aug 2007 16:40:30 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Chong Yidong <cyd>      07/08/07 16:40:30

Index: image-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-mode.el,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -b -r1.21.2.2 -r1.21.2.3
--- image-mode.el       25 Jul 2007 04:47:17 -0000      1.21.2.2
+++ image-mode.el       7 Aug 2007 16:40:29 -0000       1.21.2.3
@@ -295,16 +295,17 @@
            (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)))
@@ -313,13 +314,11 @@
            `(display ,image
                      intangible ,image
                      rear-nonsticky (display intangible)
-                     ;; This a cheap attempt to make the whole buffer
-                     ;; read-only when we're visiting the file (as
-                     ;; opposed to just inserting it).
                      read-only t front-sticky (read-only)))
           (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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]