Emacs also has major modes for the programming languages Lisp, Scheme (a variant of Lisp) and the Scheme-based DSSSL expression language, Ada, Awk, C, C++, Delphi (Object Pascal), Fortran (free and fixed format), Icon, IDLWAVE, Java, Metafont (TeX's companion for font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Simula, VHDL, CORBA IDL, and Tcl. There is also a major mode for makefiles, called Makefile mode. An alternative mode for Perl is called CPerl mode. Modes are available for scripts for the common Unix shells, VMS DCL and MS-DOS/MS-Windows BAT files. In a similar fashion to programming languages, modes are provided for editing various sorts of configuration files.
Separate manuals are available for the modes for Ada (), C/C++/Objective C/Java/Corba IDL () and the IDLWAVE modes ().
Ideally, a major mode should be implemented for each programming language that you might want to edit with Emacs; but often the mode for one language can serve for other syntactically similar languages. The language modes that exist are those that someone decided to take the trouble to write.
There are several forms of Lisp mode, which differ in the way they interface to Lisp execution. Section 25.6.
Each of the programming language major modes defines the TAB key to run an indentation function that knows the indentation conventions of that language and updates the current line's indentation accordingly. For example, in C mode TAB is bound to c-indent-line. C-j is normally defined to do RET followed by TAB; thus, it too indents in a mode-specific fashion.
In most programming languages, indentation is likely to vary from line to line. So the major modes for those languages rebind DEL to treat a tab as if it were the equivalent number of spaces (using the command backward-delete-char-untabify). This makes it possible to rub out indentation one column at a time without worrying whether it is made up of spaces or tabs. Use C-b C-d to delete a tab character before point, in these modes.
Programming language modes define paragraphs to be separated only by blank lines, so that the paragraph commands remain useful. Auto Fill mode, if enabled in a programming language major mode, indents the new lines which it creates.
Turning on a major mode runs a normal hook called the mode hook, which is the value of a Lisp variable. Each major mode has a mode hook, and the hook's name is always made from the mode command's name by adding -hook. For example, turning on C mode runs the hook c-mode-hook, while turning on Lisp mode runs the hook lisp-mode-hook. Section 32.2.3.