From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: image on splash screen (svg vs. png) Date: Thu, 05 Feb 2009 01:45:02 +0200 Organization: JURTA Message-ID: <87r62dahvd.fsf@jurta.org> References: <87ljsmlz4x.fsf@kfs-lx.rd.rdm> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233791763 13937 80.91.229.12 (4 Feb 2009 23:56:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 Feb 2009 23:56:03 +0000 (UTC) Cc: emacs-devel@gnu.org To: storm@cua.dk (Kim F. Storm) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 05 00:57:16 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LUrcJ-0007xy-9n for ged-emacs-devel@m.gmane.org; Thu, 05 Feb 2009 00:57:15 +0100 Original-Received: from localhost ([127.0.0.1]:57189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUrb0-0000c7-7k for ged-emacs-devel@m.gmane.org; Wed, 04 Feb 2009 18:55:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUrS7-0005Wk-Na for emacs-devel@gnu.org; Wed, 04 Feb 2009 18:46:43 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUrS3-0005V8-QL for emacs-devel@gnu.org; Wed, 04 Feb 2009 18:46:43 -0500 Original-Received: from [199.232.76.173] (port=39885 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUrS3-0005Uy-Cl for emacs-devel@gnu.org; Wed, 04 Feb 2009 18:46:39 -0500 Original-Received: from relay02.kiev.sovam.com ([62.64.120.197]:61747) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LUrS2-0006O4-SH for emacs-devel@gnu.org; Wed, 04 Feb 2009 18:46:39 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LUrRy-000BHC-23; Thu, 05 Feb 2009 01:46:35 +0200 In-Reply-To: <87ljsmlz4x.fsf@kfs-lx.rd.rdm> (Kim F. Storm's message of "Wed, 04 Feb 2009 21:34:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu) X-Scanner-Signature: e5a023dad48cfed04c9aaaf8a25ccfed X-DrWeb-checked: yes X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108763 Archived-At: > 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/