| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
XEmacs is language sensitive. It has several major and minor modes. The major modes customize Emacs to edit text of a particular sort. There are major modes for C, Lisp, Emacs Lisp, LaTeX, English etc. Within each major mode, certain functions and keys are redefined to "suit" that particular sort of text. The minor modes provide certain features which can be turned off or on at any time. Emacs can only be in one major mode at any time, but it can turn on several minor modes at the same time. After you have selected any major or minor mode, you can select Describe Mode from the Help menu and you will get documentation about those modes.
| 6.1 Major Modes | Choosing Major Modes | |
| 6.2 Minor Modes | Auto-Fill, Abbrev and other minor modes |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Emacs has several major modes which customize Emacs to edit text of various sorts. You can have only one major mode at any time. Within each major mode, Emacs redefines certain functions (like cursor movement, indentation and text killing) to suit the needs of the text being edited. When you are editing a specific type of text you should switch to the appropriate mode. If you are working with C code, you should switch to C mode; if you are working with Lisp code, then switch to lisp mode and if you are working with English text switch to Text mode.
When you open a file to work on, Emacs usually selects the appropriate mode. For example, if you open a file called `guide.c' then Emacs will select the C mode because of the ".c" extension of the file. To explicitly select a mode type the following command:
;;; selects lisp mode M-x lisp-mode ;;; selects C mode M-x c-mode |
To select any other mode, just add the major mode name before the '-mode'. The current mode in which you are in will be displayed in parenthesis in the mode-line at the bottom of the frame. All major modes have some special keybindings and you can get a listing of those keybindings by selecting List Keybindings from the Help menu on the menu bar.
Some of the available modes in XEmacs are :
This info file which you are reading right now is produced by 'Texinfo'
There are some other modes and commands for working with other kinds of text or programs. Emacs also provides commands for reading and sending Mail. For more information on these features look at the XEmacs Manual. Emacs also provides the functions of a desk calendar, with a diary of past or planned events. For more information on the calendar mode look at the manual for Calendar Mode and Diary.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The minor modes in Emacs provide some optional features which you can turn on or off. Any number of minor modes can be active at the same time with any major mode. You can enable a minor mode in one buffer and disable it in other mode. To enable a minor mode, for example the font-lock mode type the following command:
M-x font-lock-mode |
The following are some of the minor modes available in XEmacs. To enable any one of them type "M-x" in front of them.
You can also choose this mode by selecting the Syntax Highlighting menu item from the Options menu on the menu-bar at the top. If you wish to have this mode enabled permanently, choose Save Options from the Options menu. See section 2.2.3 The Options Menu, for more information on the Options menu. You can also add statements in your `init.el' file. For each major mode in which you wish to enable this minor mode, you need a statement in your `init.el' file. The following example shows how to enable the font-lock mode when the major mode is c-mode.
(add-hook 'c-mode-hook 'turn-on-font-lock) |
See section 8. Other Customizations.
When you enable this mode, the text will be displayed in different colors and fonts depending on the type of the text. This makes the text very easy to read and understand. For example, comments might be displayed in red, variables in black, functions in blue and other keywords in different colors and fonts. When you select More from the Syntax Highlighting option, you get very detailed display of colors and fonts; function names within comments themselves might appear in a different font and color.
expand SPC |
See section `Abbrevs' in XEmacs User's Manual, for more information on this mode and on defining abbreviations.
M-x blink-paren |
Do not add the "-mode" to it. You can also select the Paren Highlighting option from the Options menu. After you enable this command, put your cursor on one of the left parenthesis. The other matching parenthesis will start blinking. See section 2.2.3 The Options Menu, for more information on the Paren Highlighting option.
For information on some other modes, look at the XEmacs User's Manual and the associated files.
| [ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |