Next: , Up: Texinfo Support


6.2.2.1 Parsing Texinfo Documents

Predictive mode parses Texinfo files as you type (without any noticeable slow-down!), in order to identify different contexts. The main use for this information is to switch to the appropriate dictionary in different regions of a Texinfo document.

Four Texinfo dictionaries are provided: dict-texinfo containing the main Texinfo @-commands, dict-texinfo-env containing the environment names (things that are ended by ‘@end’), dict-texinfo-indicating containing just the Texinfo “indicating” commands (see Indicating), and dict-texinfo-math containing Texinfo @-commands that are specific to math-mode (‘@\’ is the only one!). In addition, dict-latex-math is used in math-mode1 (see see LaTeX Support). Finally, a dictionary of node names, a dictionary of locally defined Texinfo commands, add a dictionary of Texinfo flags, unique to each Texinfo file, are generated automatically (see Automatically Created Files for Texinfo).

Predictive mode will automatically complete words from the correct dictionary in different regions of your Texinfo document2. In the main body of the document it will complete from the main dictionary, as usual, and also from the dictionaries of Texinfo @-commands. After ‘@end’, it will offer environment names as completions, whereas after ‘@table’, ‘@vtable’, and ‘@ftable’ it will offer Texinfo “indicating” commands. Inside ‘@xref{...}’, ‘@pxref{...}’ and ‘@ref{...}’, it will use the dictionary of node names, which is created and updated automatically for each Texinfo document. Inside ‘@clear{...}’, ‘@ifset{...}’ and ‘@ifcler{...}’, it will use the automatically-generated dictionary of flag names. Inside ‘@math{...}’ it will offer standard TeX maths commands as completions3.

The behaviour of different character syntax classes, and the behaviour of certain individual characters, is set up appropriately for Texinfo (see Character Syntax and Key Bindings). Also, a special Texinfo completion browser menu, more appropriate for browsing Texinfo commands, is used instead of the default one.


Footnotes

[1] It ought to be dict-tex-math, but that will have to await TeX support. See Known Bugs.

[2] The automatic dictionary switching is implemented using the auto-overlays Elisp package.

[3] Currently, it actually offers LaTeX maths commands, see Known Bugs.