]> code.delx.au - gnu-emacs/blobdiff - lisp/image-mode.el
(ispell-keep-choices-win, ispell-dictionary-alist, ispell-word,
[gnu-emacs] / lisp / image-mode.el
index 13a689b606144c8bcb24b8c98f5e1d7e7f242651..eb08de1d6bbb12c7d0ba64d7be96a3296cdb42bf 100644 (file)
@@ -60,6 +60,12 @@ to toggle between display as an image and display as text."
   (setq major-mode 'image-mode)
   (use-local-map image-mode-map)
   (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
+  (if (and (display-images-p)
+          (not (get-text-property (point-min) 'display)))
+      (image-toggle-display)
+    ;; Set next vars when image is already displayed but local
+    ;; variables were cleared by kill-all-local-variables
+    (setq cursor-type nil truncate-lines t))
   (run-mode-hooks 'image-mode-hook)
   (if (display-images-p)
       (message "%s" (concat
@@ -174,11 +180,6 @@ and showing the image as an image."
       (if (called-interactively-p)
          (message "Repeat this command to go back to displaying the file as text")))))
 
-(put 'image-toggle-display 'disabled "\
-WARNING: Displaying images can be a security risk.
-Please make sure you're using up-to-date image libraries
-and the images displayed come from a trusted source.")
-
 (provide 'image-mode)
 
 ;; arch-tag: b5b2b7e6-26a7-4b79-96e3-1546b5c4c6cb