emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: image.el doesn't associate image-mode with .JPG files


From: Juanma Barranquero
Subject: Re: image.el doesn't associate image-mode with .JPG files
Date: Wed, 13 Dec 2006 16:58:13 +0100

On 12/13/06, Jason Rumney <address@hidden> wrote:

The only problem with this method is that the actual regexp you need is
more complex

Yes, I downloaded the spec; I was just being sloppy in discussing it.
I'm not sure I like adding that to `magic-mode-alist'; why not PNG,
GIF, TIFF and other easily recognizable formats?

image-jpeg-p has a much more
relaxed check, basically "^\xFF\xD8\xFF[\xE0-\xEF]..+(JFIF|Exif)", but
with the search for JFIF|Exif limited based on the first two bytes of
the ..+ portion - which indicate the length of the file header.

Post-22.1, perhaps `magic-mode-alist' could be extended to also allow
(MATCHER . FUNCTION) pairs (MATCHER being a predicate on the text of
the current buffer, starting from the point) in addition to the
current (REGEXP . FUNCTION). That would allow reusing `image-jpeg-p'
(once suitable adapted).

                   /L/e/k/t/u




reply via email to

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