Index: files.el =================================================================== RCS file: /sources/emacs/emacs/lisp/files.el,v retrieving revision 1.893 diff -u -c -r1.893 files.el cvs diff: conflicting specifications of output style *** files.el 13 Apr 2007 15:09:32 -0000 1.893 --- files.el 19 Apr 2007 01:29:06 -0000 *************** *** 2138,2144 **** (concat "[ \t\n]*<" comment-re "*!DOCTYPE ")) . sgml-mode) ("%!PS" . ps-mode) ! ("# xmcd " . conf-unix-mode)) "Alist of buffer beginnings vs. corresponding major mode functions. Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). After visiting a file, if REGEXP matches the text at the beginning of the --- 2138,2145 ---- (concat "[ \t\n]*<" comment-re "*!DOCTYPE ")) . sgml-mode) ("%!PS" . ps-mode) ! ("# xmcd " . conf-unix-mode) ! (archive-exe-p . archive-mode)) "Alist of buffer beginnings vs. corresponding major mode functions. Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). After visiting a file, if REGEXP matches the text at the beginning of the *************** *** 2150,2155 **** --- 2151,2167 ---- \"allow `auto-mode-alist' to decide for these files.\")") (put 'magic-mode-alist 'risky-local-variable t) + ;; this is here to avoid loading the whole arc-mode.el from magic-mode-alist + (defun archive-exe-p () + "Return true if the current buffer is a self-extracting .exe archive. + This is designed for use as a test in `magic-mode-alist'." + (let (case-fold-search) + (and (string-match "\\.\\(exe\\|EXE\\)\\'" (buffer-name)) + (save-excursion + (goto-char (point-min)) + ;; same regexp as in archive-find-type for `lzh-exe' + (looking-at "MZ\\(.\\|\n\\)\\{34\\}LH[aA]'s SFX "))))) + (defvar magic-mode-regexp-match-limit 4000 "Upper limit on `magic-mode-alist' regexp matches.")