From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: Image autodetection Date: Tue, 30 Jan 2007 13:11:55 +0100 Message-ID: References: <878xflr6vd.fsf@stupidchicken.com> <45BF0A1B.70202@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1170159136 20800 80.91.229.12 (30 Jan 2007 12:12:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 30 Jan 2007 12:12:16 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: "Jason Rumney" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 30 13:12:09 2007 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 1HBrqL-0005Eu-0H for ged-emacs-devel@m.gmane.org; Tue, 30 Jan 2007 13:12:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBrqK-0000ZL-DR for ged-emacs-devel@m.gmane.org; Tue, 30 Jan 2007 07:12:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HBrq9-0000YT-Vv for emacs-devel@gnu.org; Tue, 30 Jan 2007 07:11:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HBrq8-0000Wi-Fq for emacs-devel@gnu.org; Tue, 30 Jan 2007 07:11:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBrq8-0000Wb-Do for emacs-devel@gnu.org; Tue, 30 Jan 2007 07:11:56 -0500 Original-Received: from an-out-0708.google.com ([209.85.132.247]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HBrq8-0007SL-0N for emacs-devel@gnu.org; Tue, 30 Jan 2007 07:11:56 -0500 Original-Received: by an-out-0708.google.com with SMTP id b8so642627ana for ; Tue, 30 Jan 2007 04:11:55 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tboilDUCDnID9Cs6r+hmF6SN86mVxGHZo5q+0ipaIE+BFDUish3maF+OGzjQbAtbYY/lMueHP1bBiidMQD+GqillR3Kw61TZXM/kxyL5/As04gIQX/t2ZZ0FdPXw/HQC3ATPZ9tKh3NHbTiz0EOfEHlXWk3nfIreHzD2wt+Ql18= Original-Received: by 10.114.46.1 with SMTP id t1mr29472wat.1170159115065; Tue, 30 Jan 2007 04:11:55 -0800 (PST) Original-Received: by 10.115.93.4 with HTTP; Tue, 30 Jan 2007 04:11:54 -0800 (PST) In-Reply-To: Content-Disposition: inline X-detected-kernel: Linux 2.6 (newer, 2) 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:65633 Archived-At: On 1/30/07, Juanma Barranquero wrote: > so I like Richard's idea of bypassing #1 of Chong's > proposals (no more options, please!) and just implementing #2 (with > image-toggle-display disabled, as you note). Something like the attached patch, which couldn't be simpler. /L/e/k/t/u Index: lisp/image-mode.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/image-mode.el,v retrieving revision 1.16 diff -u -2 -r1.16 image-mode.el --- lisp/image-mode.el 21 Jan 2007 03:53:11 -0000 1.16 +++ lisp/image-mode.el 30 Jan 2007 12:03:44 -0000 @@ -61,10 +61,5 @@ (use-local-map image-mode-map) (add-hook 'change-major-mode-hook 'image-toggle-display-text nil t) - (if (and (display-images-p) - (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 - (setq cursor-type nil truncate-lines t)) + (setq cursor-type nil truncate-lines t) (run-mode-hooks 'image-mode-hook) (if (display-images-p) @@ -180,4 +175,10 @@ (message "Repeat this command to go back to displaying the file as text"))))) +(put 'image-toggle-display 'disabled "\ + +WARNING: Displaying images can be a security risk. +Please make sure you're using up-to-date image libraries +and the images displayed come from a trusted source.") + (provide 'image-mode)