Sven Joachim <[EMAIL PROTECTED]> writes: > I think this is a bug in emacs-snapshot after all. The problem is > that Emacs is a bit too clever: it sees the file's contents and, > noticing that it is a HTML file (e.g., it has <!DOCTYPE HTML ...> or > <html> as first text), decides to put it in html-mode, without even > looking at auto-mode-alist which tells otherwise.
Ah, thanks Sven. I had missed the connection with `magic-mode-alist' in this report... I don't think this is a bug, `magic-mode-alist' *voluntarily* overrides `auto-mode-alist', it's mentioned in the docstring: ,----[ C-h v magic-mode-alist RET ] | | Documentation: | Alist of buffer beginnings vs. corresponding major mode functions. | Each element looks like (REGEXP . FUNCTION). After visiting a file, | if REGEXP matches the text at the beginning of the buffer, | `normal-mode' will call FUNCTION rather than allowing `auto-mode-alist' | to decide the buffer's major mode. | | If FUNCTION is nil, then it is not called. (That is a way of saying | "allow `auto-mode-alist' to decide for these files.") `---- and in the manual: | Sometimes the major mode is determined from the way the file's text | begins. The variable `magic-mode-alist' controls this. Its value is a | list of elements of this form: | | (REGEXP . MODE-FUNCTION) | | This looks like an element of `auto-mode-alist', but it doesn't work | the same: this REGEXP is matched against the text at the start of the | buffer, not against the file name. `magic-mode-alist' takes priority | over `auto-mode-alist'. So the problem here is that html-helper-mode should replace the html-mode entry with one of its own in `magic-mode-alist', or just remove it to let `auto-mode-alist' decide. What do you think? -- ,''`. : :' : Romain Francoise <[EMAIL PROTECTED]> `. `' http://people.debian.org/~rfrancoise/ `- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]