1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

(image-minor-mode): Set cursor-type' and truncate-lines' if the

image is already displayed.  Add turning image-minor-mode off to
`change-major-mode-hook'.  Add message.
Call `image-toggle-display-text' after turning image-minor-mode off.
This commit is contained in:
Juri Linkov 2005-03-25 21:45:47 +00:00
parent e0e6e9b80a
commit 90d0be7d3f
2 changed files with 13 additions and 4 deletions

View File

@ -18,8 +18,10 @@
(image-toggle-display): Use called-interactively-p.
Let-bind `inhibit-read-only' to t.
* image-file.el (image-file-name-extensions): Remove .xbm and .xpm
associated with c-mode in `auto-mode-alist'.
* image-mode.el (image-minor-mode): Set `cursor-type' and
`truncate-lines' if the image is already displayed. Add turning
image-minor-mode off to `change-major-mode-hook'. Add message.
Call `image-toggle-display-text' after turning image-minor-mode off.
2005-03-25 Stefan Monnier <monnier@iro.umontreal.ca>

View File

@ -79,8 +79,15 @@ See the command `image-mode' for more information on this mode."
nil " Image" image-mode-map
:group 'image
:version "22.1"
(unless (or (eq major-mode 'image-mode) image-minor-mode)
(use-local-map image-mode-map)))
(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 (concat (substitute-command-keys
"Type \\[image-toggle-display] to view the image as ")
(if (get-text-property (point-min) 'display)
"text" "an image") "."))))
;;;###autoload
(defun image-mode-maybe ()