Romain Francoise wrote:
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?

Now that I learned about magic-mode-alist ;-), that sounds absolutely right.
I think it's best for html-helper-mode to replace the html-mode entry in
auto-mode-alist; that needs to be done in its startup file,
/etc/emacs/site-start.d/50html-helper-mode.el.

I'm afraid my lisp knowledge is too limited to come up with a patch.
Would you like to write one?



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to