Variable: auto-coding-functions

auto-coding-functions is a customizable variable defined in mule.el.gz.

Value

(sgml-xml-auto-coding-function
 sgml-html-meta-auto-coding-function)

Documentation

A list of functions which attempt to determine a coding system.

Each function in this list should be written to operate on the current buffer, but should not modify it in any way. The buffer will contain the text of parts of the file. Each function should take one argument, SIZE, which says how many characters
(starting from point) it should look at. The function might be
called both when the file is visited and Emacs wants to decode its contents, and when the file's buffer is about to be saved and Emacs wants to determine how to encode its contents.

The name of the file is provided to the function via the variable auto-coding-file-name.

If one of these functions succeeds in determining a coding system, it should return that coding system. Otherwise, it should return nil.

If a file has a coding: tag, that takes precedence over these functions, so they won't be called at all.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule.el.gz
;; See the bottom of this file for built-in auto coding functions.
(defcustom auto-coding-functions '(sgml-xml-auto-coding-function
				   sgml-html-meta-auto-coding-function)
  "A list of functions which attempt to determine a coding system.

Each function in this list should be written to operate on the
current buffer, but should not modify it in any way.  The buffer
will contain the text of parts of the file.  Each function
should take one argument, SIZE, which says how many characters
\(starting from point) it should look at.  The function might be
called both when the file is visited and Emacs wants to decode
its contents, and when the file's buffer is about to be saved
and Emacs wants to determine how to encode its contents.

The name of the file is provided to the function via the variable
`auto-coding-file-name'.

If one of these functions succeeds in determining a coding
system, it should return that coding system.  Otherwise, it
should return nil.

If a file has a `coding:' tag, that takes precedence over these
functions, so they won't be called at all."
  :group 'files
  :group 'mule
  :type '(repeat function))