File: latexenc.el.html

This code tries to guess the correct coding system of a LaTeX file.

First it searches for a \inputencoding{...} or
\usepackage[...]{inputenc} line in the file and looks up the ... in
latex-inputenc-coding-alist to find the corresponding coding system.

If this fails it will search for AUCTeX's TeX-master or tex-mode's tex-main-file variable in the local variables section and visit that file to get the coding system from the master file. This check can be disabled by setting latexenc-dont-use-TeX-master-flag to t.

If we have still not found a coding system we will try to use the standard tex-mode's tex-guess-main-file and get the coding system from the main file. This check can be disabled by setting latexenc-dont-use-tex-guess-main-file-flag to t.

The functionality is enabled by adding the function latexenc-find-file-coding-system to file-coding-system-alist like this

(add-to-list 'file-coding-system-alist
'("\\\\.\\\\(tex\\\\|ltx\\\\|dtx\\\\|drv\\\\)\\\\'" . latexenc-find-file-coding-system))

Defined variables (3)

latex-inputenc-coding-alistMapping from LaTeX encodings in "inputenc.sty" to Emacs coding systems.
latexenc-dont-use-TeX-master-flagNon-nil means don’t follow TeX-master to find the coding system.
latexenc-dont-use-tex-guess-main-file-flagNon-nil means don’t use tex-guessmain-file to find the coding system.

Defined functions (3)

latexenc-coding-system-to-inputenc(CS)
latexenc-find-file-coding-system(ARG-LIST)
latexenc-inputenc-to-coding-system(INPUTENC)

Defined faces (0)