emacs-devel
[Top][All Lists]
Advanced

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

Re: image on splash screen (svg vs. png)


From: Juri Linkov
Subject: Re: image on splash screen (svg vs. png)
Date: Thu, 05 Feb 2009 01:45:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> BTW, if I use dired on the etc/images directory and open
> the .png or .pbm images, I see the image, while if I open
> the .xpm or .svg images, I get the source code rather than
> the image ... which is rather obscure (I think the ratio
> view image / edit image is close to 99:1 so I see very little
> reason for the current behaviour).
>
> I remember a talk about this a long time ago (I think it
> was Juri) that discussed ways to have image-minor-mode
> show the image rather than text initially - but maybe that
> was rejected or forgotten about. Please reconsider this.

Sorry, it seems I forgot to fix after it was approved by Stefan:

http://thread.gmane.org/gmane.emacs.devel/77130/focus=77141

Below is a patch that syncs the logic of `image-minor-mode'
with `image-mode':

Index: lisp/image-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/image-mode.el,v
retrieving revision 1.53
diff -c -r1.53 image-mode.el
*** lisp/image-mode.el  5 Jan 2009 03:19:23 -0000       1.53
--- lisp/image-mode.el  4 Feb 2009 23:44:12 -0000
***************
*** 332,338 ****
  
    (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
    (if (display-images-p)
!       (if (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
--- 332,338 ----
  
    (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
    (if (display-images-p)
!       (if (not (image-get-display-property))
          (image-toggle-display)
        ;; Set next vars when image is already displayed but local
        ;; variables were cleared by kill-all-local-variables
***************
*** 357,371 ****
    :version "22.1"
    (if (not image-minor-mode)
        (image-toggle-display-text)
-     (if (image-get-display-property)
-       (setq cursor-type nil truncate-lines t)
-       (setq image-type "text"))
      (image-mode-setup-winprops)
      (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 (image-get-display-property)
!                             "text" "an image") "."))))
  
  ;;;###autoload
  (defun image-mode-maybe ()
--- 357,376 ----
    :version "22.1"
    (if (not image-minor-mode)
        (image-toggle-display-text)
      (image-mode-setup-winprops)
      (add-hook 'change-major-mode-hook (lambda () (image-minor-mode -1)) nil t)
!     (if (display-images-p)
!       (if (not (image-get-display-property))
!           (image-toggle-display)
!         (setq cursor-type nil truncate-lines t))
!       (setq image-type "text")
!       (use-local-map image-mode-text-map))
!     (if (display-images-p)
!       (message "%s" (concat
!                      (substitute-command-keys
!                       "Type \\[image-toggle-display] to view the image as ")
!                      (if (image-get-display-property)
!                          "text" "an image") ".")))))
  
  ;;;###autoload
  (defun image-mode-maybe ()

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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