# MainMenu(3)

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

## NAME

Main Menu - The top main menu

## SYNOPSIS

n osd
toolbar

## FRAME COMPOSIOTION

The frame composition presented by MicroEmacs is defined as follows:-

              +--------------------------------------------+
              | File  Edit .. .                   Help     | Menu Line
              +-----+-+----------------------------------+-+
              |     |=|                                  |=|Split Vertically
              |  T  |^|                                  |^|
              |  O  |||         CURRENT WINDOW           |#|Scroll Bar
              |  O  |#|                                  |#|
              |  L  |#|                                  |V|
              |  B  |#||=* file = 17:30 04/1/11 (Aeb) == |*| Mode Line
              |  A  |#|^  Split Horizontally             |^|
              |  R  | |  ^ Buffer edit(*) Read Only(%)   |#|
              |     | |                                  |#|
              |     | |          OTHER WINDOW            | |
              |     |v|                                  |v|
              +<--->+*+|-- file - 17:30 04/1/11 (AeB) ---+*| Mode Line
              |f-isearch..: forw                           | Message Line
              +--------------------------------------------+

Menu Line

The Menu Line appears at the top of the buffer. A left click of the mouse on the menu line shows a menu dialog for user selection.

Window

The windows appear at the center of the frame, typically with a scroll bar to the right of the window and a Mode Line at the bottom of the window. The mouse interactions with the window are defined as follows:-

Left mouse in window - Selecting a region

Regions may be selected with the mouse. Select a position with the left mouse, keep the left button pressed move the mouse to the desired region end and release the left button. Theregion is hilighted, the text is copied the user does not need to perform any other selection operation to copy the text.

Right mouse in window - Pop up Dialog

A right mouse click in the window brings up a context sensitive pop-up menu. A right click on a spelling error, with auto-spell(3) enabled shows a list of possible corrections.

Right mouse on mode line - Pop up Dialog

A right mouse click on the Mode Line brings up a pop-up menu to control the buffer.

Left mouse on mode line - split and resize window

If the `|` character is selected on the Mode Line then the window is split into two horizontally. If the mode line is dragged with the mouse then the buffer is re-sized. If the window is dragged into another window then the other window is deleted.

Left mouse on scroll bar - Up/down action

A left click on the scroll bar moves the window up/down. If the `=` component of the scroll bar is selected then the window is split into two vertically. Dragging the scroll-bar with the mouse horizontally causes the window to be re-sized. Selecting the `*` in the corner of the window allows the window to be resized both horizontally and vertically.

Right mouse on scroll bar - Scroll bar size

A right click of the mouse on the scroll bar allows the scroll bar width to be altered.

Message Line

The message line is used from command entry and messages. On entering a command such as isearch-forward(2) then the user enters text into the Message Line until the command completes. Messages are also displayed in the message line using ml-write(2).

Toolbar

The toolbar window is displayed if toolbar mode is enabled in user-setup(3). The mouse interaction is a little different from a conventional mode line, a mouse right click on the toolbar Mode Line allows the tollbar to be configured. A Right click on the `<` and `>` characters of the toolbar mode line moves to the next or previous tool.

## MAIN MENU

The main menu is provided to give an easier access to parts of MicroEmacs functionality, the menu is not burnt into MicroEmacs but defined on start-up in `me.emf` and `osd.emf`. The user-setup(3) command can be used to set whether the menu is always visible and if the Alt-Hotkeys are enabled (i.e. '`A-f`' to open the File menu).

The main menu is osd(2) dialog number `0` so key bindings can be made which will open the main menu, an argument of `0` will simply open the main menu, an argument of `0x0n0000` will not only open the main menu but also the `n`th sub menu, e.g. to open the edit menu use:

        0x020000 osd

Following is a brief description of the main menu items:

## File Menu

`New`

Changes the current buffer to a new buffer.

`Open`

Opens a dialog enabling the user to select files for opening into MicroEmacs. By default the dialog opens the selected file using command find-file(2), but if the view option is selected the view-file(2) command is used. The binary or encrypt options configure whether the files are to be loaded with binary(2m) or crypt(2m) modes enabled.

`Quick Open`

Opens a sub-menu list all user file types (defined in user-setup(3)). Selecting one will open another sub-dialog list all files of that type in the current directory, selecting a file will open it using command find-file(2).

`Favorites`

Opens a sub-menu enabling the user to add new favorite files, edit the existing list of favorite files, or select an existing favorite file in which case the file is opened using command find-file(2). The favorite file using to store the list is "$MENAME`.eff`" and is saved in the first path given in the $search-path(5). Each favorite file takes 2 lines in the file, the first is the text displayed in the dialog (note that characters '`\`' and '`&`' must be protected with a '`\`' and the '`&`' can be used to set the Hot key) and the second line is the file name. A line with a single '`-`' character creates a separater line in the dialog.

`Close`

Closes the current buffer, executes a dialog form of the command delete-buffer(2).

`Attributes`

Opens a dialog enabling the user to set the current buffers file attributes, i.e. read and write permissions. See command file-attrib(3) for more information.

`Save`

Saves the current buffer, executes a dialog form of the command save-buffer(2).

`Save As`

Saves the contents of the current buffer as a new file, executes a dialog form of the command write-buffer(2).

`Save All`

Saves all changes buffers and session history, executes a dialog form of the command save-all(3).

`Reread File`

Reloads the contents of the current buffer from the file system, discarding any changes, executes reread-file(3).

`Print Setup`

Opens a dialog which enables the user to configure the printer driver, output location and page layout (executes command print-setup(3)).

`Print`

Prints the contents of the current buffer to the printer, executes command print-buffer(2).

`File Browser`

Launches the file browser which enables the file system to be manipulated and traversed, executes command file-browser(3).

`FTP Browser`

Launches the FTP browser, an FTP client, executes command ftp(3).

`Load Session`

Loads a new session into MicroEmacs, the current session is saved and closed and the new session is loaded. The user is prompted from the command line to provide the name of the new session to load. See read-session(3).

`Exit`

Exits the editor, prompting the user to save any unsaved buffers, executes command save-buffers-exit-emacs(2).

## Edit Menu

`Undo`

Undoes the last edit in the current buffer (executes command undo(2)).

`Redo`

Redo the last undo, only available immediately after an undo. This is also done via the undo(2) command.

`Undo All`

Undo all edits in the current buffer until the last save or no more undo history is available. Executes the command undo(2) with a 0 numerical argument.

`Set Mark`

Sets the position of start of a selected region, executes command set-mark(2).

`Copy Region`

Copies a marked up region, executes command copy-region(2).

`Kill Region`

Deletes a marked up region and places the deleted text in the kill buffer which may be retrieved using Paste, executes command kill-region(2).

`Delete Region`

Deletes a marked up region but the deleted text is not saved in the the kill buffer and cannot be retrieved using Paste.

`Paste`

Inserts text from the clipboard into the buffer at the current cursor position, executes command yank(2).

`Cut Rectangle`

Deletes a selected rectangular region from the buffer, the vertical extents of the cut are determined by the column position of the start and end of the selected region, executes command kill-rectangle(2).

`Copy Rectangle`

Copies a selected rectangular region from the buffer, the vertical extents of the copy are determined by the column position of the start and end of the selected region, executes command copy-rectangle(3).

`Paste Rectangle`

Inserts a rectangle region into the buffer at the current cursor position (and for the subsequent lines at the given column position), executes the command yank-rectangle(2).

`Insert Symbol`

Dialog presented to select a character symbol for insertion, executes the command insert-symbol(3).

`Insert Date/Time`

Inserts the current date and time at the cursor position, a sub-menu is used to determine the format of the insertion string.

`Insert File Name`

Inserts the name of the file at the current cursor position, executes the command insert-file-name(2).

`Insert File`

Inserts the contents of a file into the buffer at the cursor position, the user is prompted for the name of the file to insert. Executes the command insert-file(2).

`Draw Lines`

Moves into line drawing mode, the cursor keys are used to control the line drawing, use esc-h for help, return to exit draw mode and C-g to quit draw mode without making changes. Executes the command draw(3).

`Toggle Insert Mode`

Modifies character entry behavior, moves between overwrite and insertion mode, changes the buffer mode over(2m).

`Toggle View Mode`

Toggles the buffer between view mode and edit mode, in view mode the contents of the buffer may not be altered. Change the buffer mode view(2m).

## Search Menu

`Incremental Search`

Initiates an incremental search, the user is prompted to enter the string to search for, execute the command isearch-forward(2).

`Hilight Search`

Opens a dialog which allows lines of the buffer to be searched and highlighted by changing the line color. Setting a line highlight is a temporary change, it does not effect any files and is lost when the buffer is deleted, see osd-search(3).

`Find`

Opens a dialogue for searching the buffer for a given string, see osd-search(3).

`Find Next`

Finds the next string in the buffer using the last search string, uses hunt-forward(2).

`Find Prev`

Finds the previous string in the buffer using the last search string, uses hunt-backward(2).

`Replace`

Opens a dialogue for searching and replacing the buffer for a given string, see osd-search(3).

`Find in Files`

Initiates a string search of the file system, in the directory of the current buffer using grep(3).

`Replace in Files`

Initiates a string search and replace of the file system, in the directory of the current buffer using query-replace-all-string(3).

`Set Bookmark`

Places a bookmark in the buffer which provides a quick method of returning to the buffer position, the user is prompted for a single character to identify the position the buffer. Executes command set-alpha-mark(2).

`Goto Bookmark`

Moves the cursor to a book mark position defined with Set Bookmark, the user is prompted for a single character that identifies the bookmark. Executes command goto-alpha-mark(2).

`Goto Fence`

When the cursor is on a fence character (i.e. `{`, `}`, `(`, `)`, `[`, `]`, ...) then the other matching fence is located and the buffer position is changed to the other fence character. Executes command goto-matching-fence(2).

`Goto Line`

Moves cursor to the specified line number or relative line position, executes a dialog form of the command goto-line(2).

`Goto Tag`

Only active when a `tags` file is found in the current directory, a dialog is presented with the tags, on selection of a tag then the file is opened and the cursor position is moved to the definition of the tag. See command find-tag(2) for more information.

## View Menu

`Narrow Out`

Hides the selected region of the buffer, executes command narrow-buffer(2) with a numeric argument of `4`.

`Narrow To`

Hides all of the buffer with the exception of the selected region, executes command narrow-buffer(2) with a numeric argument of `3`.

`Remove Single Narrow`

Removes a single narrowed region of the buffer under the cursor. Executes command narrow-buffer(2) with a numeric argument of `2`.

`Remove All Narrows`

Removes all of the narrowed regions in the buffer, executes command narrow-buffer(2) with a numeric argument of `1`.

`Buffer Info`

Provides information on the buffer current cursor position on the mode line including line number, character under the cursor etc. See buffer-info(2).

`Word Count`

Counts the number of words in the selected region (between point and mark), executes count-words(2).

`Occurrences`

Finds all occurrences of a given string in the buffer. The user is prompted for the string to find. A second window opens and all occurrences of the string in the buffer are presented, selecting an item from this list, using the mouse, moves the cursor to the specified occurrence. See occur(3).

`Buffer`

Lists the current buffers in the editor, selecting one changes the current buffer to the selection.

`Main Menu`

Hides or shows the Main Menu. If the main menu has been hidden then F1 brings up the menu, the main menu may be re-activated then if necessary.

`Scroll Bars`

Hides or shows scroll bars within the buffer.

`Tool Bar`

Hides or shows the tool bar window, see toolbar(3).

`White Characters`

Hides or shows the white space characters in the buffer.

## Format Menu

`Restyle Buffer`

Re-styles the layout of the buffer based on the major-mode setting. Executes the command restyle-buffer(3).

`Restyle Region`

Re-styles the layout of a selected region of the buffer based on the major-mode setting. Executes the command restyle-region(3).

`Increase Indent`

Increases the indentation of a line or region by a single single Tab stop position. Executes the command indent-increase(3).

`Decrease Indent`

Decreases the indentation of a line or region by a single single Tab stop position. Executes the command indent-decrease(3).

`IQ Fill Paragraph`

Reformat a paragraph using the current fill mode, handling embedded bullets with no line separation. Executes the command ifill-paragraph(3).

`Fill Paragraph`

Reformat a paragraph using the current fill mode using the standard paragraph fill mode. Executes the command fill-paragraph(2).

`Fill All Paragraphs`

Reformats all paragraphs in the buffer using the standard paragraph filling mode. Executes command fill-paragraph(2) with a very large positive numerical argument. Note that this only effects paragraphs from the current position onwards.

`All Paragraphs to Lines`

Converts all paragraphs to a single line, one line per original paragraph. Paragraphs are typically converted to a single line before copying into a Word Processor (i.e. Word, StarOffice etc.). The Word Processor performs its own text wrapping therefore it is important that MicroEmacs paragraphs with new lines in them are not copied.

`Change Character Set ...`

Converts the ASCII text from one character set to another, this allows diacritical marks to be maintained.

`Tabs to Spaces`

Converts `TAB` characters to spaces whilst retaining the correct tab stop positions within the file. Note that if the tab stops appear to be incorrect then the tab width should be temporarily changed using buffer-setup(3) before converting to spaces.

`Clean Buffer`

Cleans up the buffer by removing white space from the ends of all lines, see clean(3).

`Capitalize Word`

Capitalizes the characters from the cursor position, or next word, to the end of the word using capitalize-word(2).

`Lower Case Word`

Changes characters to lowercase from the cursor position, or next word, to the end of the word using lower-case-word(2).

`Upper Case Word`

Changes characters to uppercase from the cursor position, or next word, to the end of the word using upper-case-word(2).

`Lower Case Region`

Lowercase all characters in the current region using lower-case-region(2).

`Upper Case Region`

Uppercase all characters in the current region using upper-case-region(2).

## Tools Menu

`Current Buffer Tools`

For some file formats MicroEmacs provides a file format specific set of tools, see the file type help page for more specific information.

`Spell Word`

Spell checks a word entered on the command line, executes the command spell-word(3).

`Spell Buffer`

Spell checks the buffer from the current cursor position onwards, executes command spell-buffer(3).

`Word Complete`

Takes the incomplete word to the left of the cursor and attempts to complete the word by using the users current language dictionary, use `TAB` for a list of possible completions. Executes the command expand-word(3).

`Compare Windows`

Compares the contents of two buffers, the comparison starts from the current cursor position in each buffer and the cursor position should be aligned before starting the comparison, executes the command compare-windows(2).

`Diff Changes`

Compares the current buffer with the last backup version of the buffer, the buffer has to be saved before the comparison may be performed, executes the command diff-changes(3).

`Diff`

Runs a diff(3) command to difference two files, the user is prompted each of the files before running the command. The results of the difference are presented in a new buffer window.

`Graphical Diff`

Runs a graphics difference between two files where the files are presented side by side. The user is prompted for the two files to compare. See also gdiff(3) which uses a command line prompt for the files rather than a dialog.

`Compile`

Starts a compilation or build process, executes the command compile(3).

`Sort Lines`

Performs an alphabetical case sensitive sort of the lines in a selected region, the lines are re-ordered in ascending alphabetic order. Executes the command sort-lines(2).

`Sort Lines (Ignore Case)`

Performs an alphabetical case insensitive sort of the lines in a selected region, the lines are re-ordered in ascending alphabetic order. Executes the command sort-lines(2).

`Unique Lines`

Removes duplicated adjacent lines in a region. The region should be sorted before uniq(3).

`User Setup`

Runs a dialog interface to configure MicroEmacs, executes the command user-setup(3).

`Buffer Setup`

Runs a dialog interface to change the session configuration of a buffer i.e. assignment of the major-mode etc. This command changes the current buffer only and does not affect other buffers. Executes the command buffer-setup(3).

`Major Mode Setup`

Runs a dialog interface which allows the major mode to be changed. Executes the command major-mode-setup(3).

`Scheme Editor`

Runs a dialog which allows the current highlighting scheme to be edited, modification of the scheme affects all buffers. Executes the command scheme-editor(3).

## Advanced Menu

`Record Macro`

Starts recording the key strokes to create a keyboard macro, see start-kbd-macro(2).

`Execute Macro`

Executes a previously recorded keyboard macro, see execute-kbd-macro(2).

`Name Macro`

Allows a keyboard macro to be named, see name-kbd-macro(2).

`Execute Command`

Executes a named MicroEmacs command, the user is prompted to enter the command to be executed, see execute-named-command(2).

`Execute File`

Executes a MicroEmacs macro file, typically used to load and install Macros into the editor, see execute-file(2).

`Calculate`

Invokes a simple command line calculator, see calc(3).

`Notes`

Invokes the notes(3) tool which may be used to organize and store miscellaneous information (i.e. short notes).

`Organizer`

Invokes the organizer(3) tool which provides a calendar and address book.

`Send Mail`

Create and send a electronic mail message, this requires that the mail tool has been configured, see mail(3).

`View Mail`

Start the mail reading tool vm(3).

`Ipipe command`

Start a incremental shell command, the command runs in the background and the results are collected in a new buffer window, using ipipe-shell-command(2).

`Shell`

Creates a new shell command window outside of the editor using shell(2).

## Window Menu

`Split Window V`

Splits the current buffer window into two vertically (stacked), executes the command split-window-vertically(2).

`Grow Window V`

Increases the height of the current buffer window by a single line, executes the command change-window-depth(2) with an argument of 1.

`Shrink Window V`

Reduces the height of the current buffer window by a single line, executes command change-window-depth(2) with an argument of -1.

`Split Window H`

Splits the current buffer window into two horizontally (side by side), executes command split-window-horizontally(2).

`Grow Window H`

Increases the width of the current buffer window by a single character, executes the command change-window-width(2) with an argument of 1.

`Shrink Window H`

Reduces the width of the current buffer window by a single character, executes the command change-window-width(2) with an argument of -1.

`One Window`

Makes the current buffer the only window on the screen, the other buffers are removed from the screen, executes the command delete-other-windows(2).

`Delete Window`

Removes the current buffer window from the screen, other windows are re-organized to occupy the space created by deleting the window, executes the command delete-window(2).

`Previous Window`

Moves focus to the previous window using previous-window(2).

`Next Window`

Moves focus to the next window using next-window(2).

`Create New Frame`

Create an new external frame, only available on version which support multiple-window frames. Executes command create-frame(2).

`Close This Frame`

Closes the current frame, only available on version which support multiple-window frames. The command will fail if this is the only frame, use File -> Exit to exit MicroEmacs, executes command delete-frame(2).

`Next Frame`

Shows the next internal frame, see next-frame(2).

## Help Menu

`Major Mode Help`

Display the help information associated with the current buffer. For some major mode (file format) MicroEmacs provides a major mode specific help page providing details of key-bindings and tools specific to the current buffers file type.

`General Help`

Starts the osd-help(3) dialog which allows the help pages to the searched.

`List Bindings`

Lists the key bindings associated with the current buffer, the bindings are displayed in a separate window and include the buffer and global key bindings. Executes the command describe-bindings(2).

`List Buffers`

Lists the buffers currently active within MicroEmacs, the list is presented in a new buffer window and shows the buffer name, size, associated files and current mode. Executes the command list-buffers(2).

`List Commands`

Lists all of the available commands and key bindings in a new buffer window, executes the command list-commands(2).

`List Registry`

Presents the registry hierarchy in a separate buffer window, executes the command list-registry(2).

`List Variables`

Presents a list of all of the global variables and their assigned values in a new window, executes the command list-variables(2).

`Command Apropos`

Produces a list of commands that contain a given string as part of their name, the user is prompted to enter the string to search for. Executes the command command-apropos(2).

`Describe key`

Determines the command that is bound to a specific key, user is prompted for the key sequence, the command bound to that key is displayed. executes the command describe-key(2).

`Describe Variable`

Determine the value of a MicroEmacs variable, user is prompted for the variable name. Executes the command describe-variable(2).

`Describe Word`

A dictionary function that looks up the meaning of a word specified on the command line, executes the command describe-word(3).

`Help on Command`

Provides help on a specific MicroEmacs command, user prompted for the command name. Executes the command help-command(2).

`Help on Variable`

Provides help on a specific MicroEmacs variable, user prompted for the variable name. Executes the command help-variable(2).

`Games`

Opens a sub-menu listing all available games, see Games for more information.

`Product Support`

Opens on-line Contact information.

`About MicroEmacs`

Version and status information on the editor, executes the command about(2).

## NOTES

The main menu is defined using osd(2) in macro files me.emf and osd.emf.

General user extensions to the main menu can be added to the user file `myosd.emf` which is executed once when the main menu is first opened. The macro file can add new items to any of the main sub menus and can delete most existing items (some are dynamically added when appropriate, these should not be deleted). See `osd.emf` for examples of how to add items to the menu.

New sub-menus should be added in the company or user setup files as this must be done at start-up. The content on the menu is not required until the main menu is used so populating the new sub-menu can be done in `myosd.emf`.

## SEE ALSO

user-setup(3).

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

</HMTL>