[Top][All Lists]
[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: |
Sat, 16 Dec 2006 03:56:57 +0100 |
On 12/14/06, Richard Stallman <address@hidden> wrote:
That seems like a valid reason. Would someone please install that change?
It would be useful to recognize PNG and GIF as well this way.
image.el already defines `image-type-header-regexps' and
`image-type-from-buffer', so it seems wasteful to recreate that. It
would be better IMHO to simply use `image-type-from-buffer' from
`set-auto-mode'. Other than changes to docstrings and info files, the
path is as simple as this, and works quite well.
/L/e/k/t/u
Index: lisp/files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.868
diff -c -r1.868 files.el
*** lisp/files.el 11 Dec 2006 04:40:41 -0000 1.868
--- lisp/files.el 16 Dec 2006 02:51:21 -0000
***************
*** 2222,2230 ****
(narrow-to-region (point-min)
(min (point-max)
(+ (point-min)
magic-mode-regexp-match-limit)))
! (assoc-default nil magic-mode-alist
! (lambda (re dummy)
! (looking-at re))))))
(set-auto-mode-0 done keep-mode-if-same)
;; Compare the filename against the entries in auto-mode-alist.
(if buffer-file-name
--- 2222,2232 ----
(narrow-to-region (point-min)
(min (point-max)
(+ (point-min)
magic-mode-regexp-match-limit)))
! (if (image-type-from-buffer)
! 'image-mode
! (assoc-default nil magic-mode-alist
! (lambda (re dummy)
! (looking-at re)))))))
(set-auto-mode-0 done keep-mode-if-same)
;; Compare the filename against the entries in auto-mode-alist.
(if buffer-file-name
- Re: image.el doesn't associate image-mode with .JPG files, (continued)
- Re: image.el doesn't associate image-mode with .JPG files, Eli Zaretskii, 2006/12/20
- Re: image.el doesn't associate image-mode with .JPG files, Stefan Monnier, 2006/12/18
- Message not available
- Re: image.el doesn't associate image-mode with .JPG files, Stefan Monnier, 2006/12/19
- Re: image.el doesn't associate image-mode with .JPG files, Richard Stallman, 2006/12/20
- Re: image.el doesn't associate image-mode with .JPG files, Stefan Monnier, 2006/12/20
- Re: image.el doesn't associate image-mode with .JPG files, Miles Bader, 2006/12/20
- Re: image.el doesn't associate image-mode with .JPG files, Stefan Monnier, 2006/12/21
- Re: image.el doesn't associate image-mode with .JPG files, Jason Rumney, 2006/12/13
- Re: image.el doesn't associate image-mode with .JPG files, Richard Stallman, 2006/12/14
- Re: image.el doesn't associate image-mode with .JPG files, Richard Stallman, 2006/12/14
- Re: image.el doesn't associate image-mode with .JPG files,
Juanma Barranquero <=
- Re: image.el doesn't associate image-mode with .JPG files, Juanma Barranquero, 2006/12/15
- Re: image.el doesn't associate image-mode with .JPG files, Kim F. Storm, 2006/12/16
- Re: image.el doesn't associate image-mode with .JPG files, Juanma Barranquero, 2006/12/16
- Re: image.el doesn't associate image-mode with .JPG files, Richard Stallman, 2006/12/17
- Re: image.el doesn't associate image-mode with .JPG files, Juanma Barranquero, 2006/12/17
- Re: image.el doesn't associate image-mode with .JPG files, Richard Stallman, 2006/12/18
- Re: image.el doesn't associate image-mode with .JPG files, Juanma Barranquero, 2006/12/18
- Re: image.el doesn't associate image-mode with .JPG files, Kim F. Storm, 2006/12/19
- Re: image.el doesn't associate image-mode with .JPG files, Juanma Barranquero, 2006/12/19
- Re: image.el doesn't associate image-mode with .JPG files, Kim F. Storm, 2006/12/19