Hi, Someone asked on the xml-resume-devel list about the problems they'd had because Emacs decided that their XML file (encoded in utf-8) should be encoded using `raw-text'. XML has an optional encoding="foo" parameter, used like: Wouldn't it be nice if Emacs could see that and automatically Do The Right Thing? The attached patch is an implementation. The reason why I had to put `sgml-xml-auto-coding-function' inside mule.el is because 1) we can't autoload it from sgml-mode.el, since that would be more or less equivalent to always loading sgml-mode.el, and 2) If we added it to `auto-coding-functions' when sgml-mode.el was loaded, then it wouldn't work the first time a user visited an XML file, since the encoding has already been determined. (Subsequently it would work, though). 2002-05-18 Colin Walters * international/mule.el (make-coding-system): Doc fixes. * international/mule.el (auto-coding-functions): New variable. (auto-coding-from-file-contents): Use it. (set-auto-coding): Update docs. (sgml-xml-auto-coding-function): New function.