unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: image on splash screen (svg vs. png)
Date: Thu, 05 Feb 2009 01:45:02 +0200	[thread overview]
Message-ID: <87r62dahvd.fsf@jurta.org> (raw)
In-Reply-To: <87ljsmlz4x.fsf@kfs-lx.rd.rdm> (Kim F. Storm's message of "Wed, 04 Feb 2009 21:34:38 +0100")

> 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/




  parent reply	other threads:[~2009-02-04 23:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04 20:34 image on splash screen (svg vs. png) Kim F. Storm
2009-02-04 21:06 ` Glenn Morris
2009-02-04 22:37 ` Miles Bader
2009-02-04 23:45 ` Juri Linkov [this message]
2009-02-05  0:45   ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r62dahvd.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).