+ (if (not image-minor-mode)
+ (image-toggle-display-text)
+ (if (get-text-property (point-min) 'display)
+ (setq cursor-type nil truncate-lines t))
+ (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
+ (message "%s" (concat (substitute-command-keys
+ "Type \\[image-toggle-display] to view the image as ")
+ (if (get-text-property (point-min) 'display)
+ "text" "an image") "."))))