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: Richard Stallman
Subject: Re: Should `auto-coding-functions' be mode-specific?
Date: Tue, 02 Jan 2007 22:34:55 -0500

    The file itself is not an HTML file, but Emacs still uses the
    encoding specified in the HTML code to set the encoding.  (This is
    caused by `sgml-html-meta-auto-coding-function', which is present by
    default in the list of `auto-coding-functions' -- the functions are
    tried in the first 1K or last 3K bytes of the buffer.)

Emacs examines these parts of the file to determine the coding system
before it reads the whole file, so it can use the chosen coding system
to do the reading.  Choosing the major mode comes later, after reading
the whole file.

    but the submitter argues that the functions to get the
    encoding from the file's contents should only be enabled in modes
    where the content of the buffer is supposed to match -- i.e. don't
    use the META header function in buffers that aren't in html-mode (or
    equivalent).

It does sound more correct, but given the order in which things
are done, it would be very difficult.




reply via email to

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