# major-mode-setup(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

major-mode-setup - Configures the current buffer settings

## SYNOPSIS

major-mode-setup

## DESCRIPTION

The Major Mode defines the operational mode of the buffer, controlling highlighting and additional commands that are available. The Major Mode is determined by the file type content and is determined from the file extension or Magic String in the first few lines of the file.

major-mode-setup provides a dialog interface to configuring the setup of the current buffer's file type within MicroEmacs. major-mode-setup may be invoked from the main Tools menu or directly from the command line using execute-named-command(2).

The changes made to a configuration in major-mode-setup are maintained in future MicroEmacs sessions by storing them within the user's setup registry file, "<logname>`.erf`". Note that not all file types may be supported by major-mode-setup, if not the help menu item will not be available.

The contents of the dialog change, depending on the features the current buffer's file type supports. These features are implemented and installed within the buffer's file hook. The following buttons are always present at the bottom of the dialog:

`Save`

Saves the changes made to the configuration back to the users registry file, i.e. "<Log-Name>`.erf`" but does not re-initialize the current buffer. No changes made will effect the current buffer unless the Current button is pressed. Buffers of the same type created after the save may inherrit some of the changes.

`Current`

Makes the current buffer reflect the changes made, dismissing the major-mode-setup dialog. This also performs the above 'Save' operation. Some changes such as dialog creation changes, will only take effect when MicroEmacs is restarted.

`Cancel`

Quits major-mode-setup, if changes where not Saved or made Current they will be lost.

Following is a list of configurable features which may be available:

Create Help Page

Enables/disables the creation of a help page dialog for the tools available for the current file type.

Create Tools Menu

Enables/disables the creation of a file type specific sub menu located within the main menu's Tools sub-menu.

Use Author Mode

For file types which have an automatic formatter/viewer (currently only html) enabling this will simply load the file enabling the source code to be viewed and edited. When disabled files of this type will be automatically processed giving a more readable 'formatted' representation.

Insert New Template

When creating a new buffer/file of this type, a default template will be inserted if this is enabled. When disabled the buffer will remain empty.

Fence Display

Enables or disables the displaying of matching fences for this file type. Note that the way in which the matching fence is display is determined by the Fence Display option on the Platform page of user-setup(3); the major-mode-setup option is ignored if this option is set to "`Never Display`".

Setup Hilighting

Creates and enables the token hilighting for the current file type.

Setup Auto Indent

Enables automatic formating (indenting) for the current file type. The indentation rules are either the built in 'C' indentation or created explicitly using the indent(2) command. When enabled the tab(2m) is still adhered to, but the indent(2m) mode is ignored; when disabled the indent mode can be used.

Setup Auto Spell

Enables the setting up of auto-spell(3). When enabled the auto-spell key bindings are created and auto-spell is enabled if enabled within the user-setup dialog.

Setup Folding

Enables the setting up of section folding, when enabled the folding key bindings are created.

Add Abbreviations

Adds the file type's abbreviation file to the buffer using buffer-abbrev-file(2)

Search Modes: Exact

Enables/disables the exact(2m) mode over-riding the setting within the user-setup(3) dialog. If this setting is changed the setting within user-setup will be ignored for the current file type.

Search Modes: Magic

Enables/disables the magic(2m) mode over-riding the setting within the user-setup(3) dialog. If this setting is changed the setting within user-setup will be ignored for the current file type.

Buffer Modes: Auto

Enables/disables the auto(2m) mode.

Buffer Modes: Backup

Enables/disables the backup(2m) mode.

Buffer Modes: Indent

Enables/disables the indent(2m) mode.

Buffer Modes: Justify

Enables/disables the justify(2m) mode.

Buffer Modes: Tab

Enables/disables the tab(2m) mode over-riding the setting within the user-setup(3) dialog. If this setting is changed the setting within user-setup will be ignored for the current file type.

Buffer Modes: Time

Enables/disables the time(2m) mode.

Buffer Modes: Undo

Enables/disables the undo(2m) mode over-riding the setting within the user-setup(3) dialog. If this setting is changed the setting within user-setup will be ignored for the current file type.

Buffer Modes: Wrap

Enables/disables the wrap(2m) mode.

## NOTES

major-mode-setup is a macro using osd(2), defined in `majormod.emf`. This macro configures the user settings of the `hkXXX.emf` files via buffer-init(3).

## SEE ALSO

buffer-init(3), major-mode-help(3), user-setup(3). File Hooks.

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>