From: Kim F. Storm Date: Tue, 19 Dec 2006 09:04:30 +0000 (+0000) Subject: (magic-mode-alist): Allow matching file type by X-Git-Tag: emacs-pretest-22.0.92~20 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=10ffa2a1cefca36dd67ef7cf4dfa1e7b143e87d3;p=emacs.git (magic-mode-alist): Allow matching file type by calling a function at bob. Check for image types by calling image-type-from-buffer. Suggested by Juanma Barranquero. (set-auto-mode): Do it. --- diff --git a/lisp/files.el b/lisp/files.el index 6c9b9a7542e..71f33e5f1a1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2115,7 +2115,8 @@ of the regular expression. The mode is then determined as the mode associated with that interpreter in `interpreter-mode-alist'.") (defvar magic-mode-alist - `(;; The < comes before the groups (but the first) to reduce backtracking. + `((image-type-from-buffer . image-mode) + ;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16