emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should `auto-coding-functions' be mode-specific?


From: Juri Linkov
Subject: Re: Should `auto-coding-functions' be mode-specific?
Date: Sun, 07 Jan 2007 01:33:55 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.90 (gnu/linux)

>> 2006-06-02  Juri Linkov  <address@hidden>
>
>>      * international/mule.el (sgml-html-meta-auto-coding-function):
>>      Remove the condition `(search-forward "<html" size t)'.
>
> Thanks for noticing this Kevin, I had missed it.  I think this
> change should be reverted, it's okay to make Emacs handle Mozilla's
> broken HTML, but only as long as it doesn't get in the way of valid
> use cases!
>
> And your proposed change to also recognize a doctype at the
> beginning of the buffer looks good to me.
>
> So unless someone objects, I'll revert Juri's change and extend the
> function as Kevin suggests.  Perhaps I'll also make it recognize
> Mozilla's specific doctype ('<!DOCTYPE NETSCAPE-Bookmark-file-1>').

The reported bug can occur even without my change because "<html" was
not anchored at the beginning of the buffer and can match "<html" in
the presented HTML snippet near the top.

Your change is an improvement since it reduces the false positive
rate while not significantly increasing the false negative rate.
But then why not to go further and use the same regexp as used for
detecting HTML files in `magic-mode-alist'?  It seems reasonable
to detect the HTML encoding exactly in the same files that later
recognized as HTML according to the file contents.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]