$buffer-major-mode(5)$uffer-major-mode - Define buffer major-modem
$uffer-major-mode MajorModeId
The $uffer-major-mode variable defines the current buffer's active major mode. The variable cannot be directly set and is largely redundant as it must be configured by calling major-mode(2). Its main use is within macros which wish to ascertain what type of buffer it is executing on, i.e. if a command was to be executed only on C files then the follow ensures that this is the case:
!iif ¬ &seq $buffer-major-mode "c" -8 ml-write "Error: Not a C file!"
The variable and buffer's current major mode can be configured by calling major-mode or buffer-setup(3). When a buffer first becomes active, the system uses the buffer's content and file name to determine the initial major-mode to apply, this in turn sets the initial value of this variable. See help on major-mode(2) for more information on how this auto-assignment process works and is configured.
The value of this variable must stay in sync with the buffer's major-mode and the variable $buffer-fhook(5).
(c) Copyright JASSPA 2026
Last Modified: 2026/01/18
Generated On: 2026/01/31