16 lines
1.5 KiB
Org Mode
16 lines
1.5 KiB
Org Mode
:PROPERTIES:
|
||
:ID: 57fcd48a-de61-4ced-8a4c-943cb78595db
|
||
:END:
|
||
#+title: major-mode
|
||
|
||
|
||
Each [[id:c7747161-284c-4882-bd11-80bc2a990814][buffer]] in [[id:5f1df0e1-384f-4685-ae1e-fec2431b04e5][emacs]] is in a (single) major mode. Different kinds of buffer have different major modes. For example, if you edit an EmacsLisp file, the major mode (by default) is emacs-lisp-mode. The mode for a file is determined by the SetAutoMode function.
|
||
|
||
Each major mode customises Emacs’s behaviour to make it appropriate for the type of buffer by providing appropriate commands, display and key bindings. For example, in emacs-lisp-mode, commands are available that are appropriate to editing EmacsLisp code. In DiredMode, commands are available for manipulating files and directories. Major modes often have SyntaxHighlighting for the visually unimpaired.
|
||
|
||
The name of the current major mode is displayed in the mode line. You can change to a different major mode by executing its command. For TextMode (indicated by “Text” in the mode-line), for example, do ~M-x text-mode~. You can use ~C-h m~ for help on the current major mode, and ~C-h b~ to see all the bindings in effect. The symbol identifying the current major mode is stored in the variable major-mode.
|
||
|
||
Although many major modes ship with Emacs, sometimes you will need to download an elisp package off the Internet and install it. See InstallingPackages.
|
||
|
||
There are also minor modes. Minor modes are orthogonal to major modes. There can be any number of [[id:f2b5ce00-009f-4ae5-bac4-da9d22c79927][minor_mode]]s in a buffer.
|