emacs-devel
[Top][All Lists]
Advanced

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

Re: Image mode


From: Chong Yidong
Subject: Re: Image mode
Date: Mon, 05 Feb 2007 14:06:14 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

Jason Rumney <address@hidden> writes:

> Chong Yidong wrote:
>> How about this patch?
>>   
>
> I think we should take a step back and design this properly rather
> than introducing more patches.
>
> Your proposed patch breaks the display of xbm and xpm files, since you
> are repurposing image-mode-maybe to solve this problem, rather than
> its original purpose of letting the user switch between the applicable
> major-mode and image display with C-c C-c.

Indeed, xpm and xbm are special in that they can be treated as both C
files and images.  I think the solution is to handle them specially.

In its original form, image-mode-maybe, which applies to ALL
autodetected image files (not just xpm and xbm) tries to load the
image in a non-image major mode and turn on image-minor-mode.  This is
a mistake, because we are making the needs of a special case (xpm/xbm)
interfere with the more general situation (a file is either an image
or a non-image).

Clearly, the solution is to separate out the special case.  Let us
remove xpm/xbm detection from image-type-auto-detected-p, and add a
new entry to magic-mode-alist that specifically detects xpm/xbm
images, and turns on c-mode and image-minor-mode.  All other images
will be handled using my patch.

If people agree with this design, I can implement it quite easily.




reply via email to

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