(UI-add-menu menu-ID position name [position name] ...)

UI-add-menu adds a single menu item to the existing menus. The menu-id is the two character string to bind the menu item to. When selected the menu will send the string "\(menu)<menu-id>".

The values of <menu-ID> are restricted to a set of known menu-IDs and a range of user values. There can be 100 user defined values. Any ID that is not one of the built in ones can be used. To avoid picking a built-in value use an upper case letter as the first character of the ID. The known menu IDs correspond to menu actions that require some special support from Emacs. The following table lists the known IDs:

Name ID Special Action
Edit Copy "ec" Enabled only if mark is set
Edit Cut "ex" Enabled only if mark is set
Edit Clear "er" Enabled only if mark is set
Edit Paste "ev" Enabled when text in clipboard
Search Find "sf" Enabled if the find dialog can be started
Search Replace "sr" Enabled if the replace dialog can be started
File Open "fo" none
File Save "fs" Enabled only if buffer is modified
File Save As "fa" none

There can be up to 9 pairs of the <position> and <name> parameters. Each pair describes one level of menu hierarchy. A menu item named <name> is inserted at position <position>. The first menu position is numbered 0. Use a large <position> value to insert at the end of a menu when you do not know how many items are in the menu.

You cannot insert a first level menu after the "&Help" menu.

The <name> parameter has one special value, "-", which is will cause a menu separating line to be inserted. Otherwise the <name> parameter can be any string. Place an "&" before the character in name string that you wish to be the menu accelerator character.

Example:

This example adds the Project menu with two items, Make and Debug with a separator line between them.

(UI-add-menu "Pm" 999 "&Project" 999 "&Make")
(UI-add-menu "" 999 "&Project" 999 "-")
(UI-add-menu "Pd" 999 "&Project" 999 "De&bug")

See also:

(UI-add-to-recent-file-list filename)

Add the given filename to the recent file list that emacs maintains under the File menu. Recent files are remembered across runs of emacs.

(UI-edit-copy)

Copy the current buffers region to the clipboard.

See also:

(UI-edit-paste)

Insert the contents of the clipboard into the current buffer at dot.

See also:

(UI-file-open)

Pop up the standard file open dialog and allows the users to select a file. The UI-filter-file-list variable is read to setup the file filters. The UI-open-file-name variable is used to initialise the file name and path parts of the dialog box.

On completion UI-file-open returns 1 if the user clicked "OK" and 0 if the user clicked "Cancel". The file selected by the user is returned in the UI-open-file-name variable. The UI-open-file-readonly variable is true if the readonly check box was set on.

Example:

(setq UI-open-file-name "d:\\fred\\joe.txt")
(if (UI-file-open)
    (progn
        (visit-file UI-open-file-name)
        (setq read-only-buffer UI-open-file-readonly)
    )
)

See also:

(UI-file-save-as)

Pop up the standard file save as dialog and allows the users to select where to save the file. The UI-filter-file-list variable is read to setup the file filters. The UI-save-as-file-name variable is used to initialise the file name and path parts of the dialog box.

On completion UI-file-open returns 1 if the user clicked "OK" and 0 if the user clicked "Cancel". The file selected by the user is returned in the UI-save-as-file-name variable.

Example:

(setq UI-save-as-file-name current-buffer-file-name)
(if (UI-file-save-as)
    (write-named-file UI-save-as-file-name)
)

See also:

(UI-find)

Pop up the find string modeless dialog box. The UI-search-string variable is used to initialise the "Find what" field.

Example:

(setq UI-search-string "find me")
(UI-find)

See also:

(UI-find-and-replace)

Pop up the find and replace modeless dialog box. The UI-search-string variable is used to initialise the "Find what" field. And the UI-replace-string variable is used to initialise the "Replace with" field.

Example:

(setq UI-search-string "find me")
(setq UI-replace-string "new string")
(UI-find-and-replace)

(UI-frame-maximize)

Maximize the frame window.

See also:

(UI-frame-minimize)

Minimize the frame window.

See also:

(UI-frame-restore)

Restore the frame window.

See also:

(UI-frame-to-foreground)

Bring Emacs to the foreground allowing mouse and keybaord input to go to Emacs.

(UI-list-menus)

List the menu structure that is currently in effect.

See also:

(UI-remove-menu)

UI-remove-menu removes a single menu item from the existing menus.

There can be up to 9 <name> parameters, one for each level of menu hierarchy. A menu item named <name> will be removed.

The <name> parameter can be any string. Place an "&" before the character in the name string that is a menu accelerator character.

See also:

(UI-switch-buffer)

Displays a list of the current buffers. You can select, from the list, a buffer to switch to, or you can enter the name of a new buffer to switch to.

See also:

(UI-view-scroll-bars)

Call this command to toggle the scroll bars on and off.

See also:

(UI-view-status-bar)

Call this command to toggle the status bar on and off.

See also:

(UI-view-tool-bar)

Call this command to toggle the tool bar on and off.

(UI-window-cascade)

Cascade the document windows.

See also:

(UI-window-new)

Create a new document windows.

(UI-window-next)

Select the next document windows.

(UI-window-maximize)

Maximize the document window.

See also:

(UI-window-minimize)

Minimize the document window.

See also:

(UI-window-restore)

Restore the document window.

See also:

(UI-window-tile-horizontal)

Horizontally tile the document windows.

See also:

(UI-window-tile-vertical)

Vertically tile the document windows.

See also:

(UI-windows-execute-program command show)

This command will start a windows program executing named in command. The program will be stated in the show state named in show. show can be one of the strings "minimized", "maximized" or "normal".

Example:

Start the windows file manager in a maximized window.

(UI-windows-execute-program "winfile" "maximized")

See also:

(UI-windows-shell-execute operation file parameters directory show)

This command will process file named in file according to the operation.

The program to process the file will be started with the parameters, in the named directory using the show state named in show.

The operation is one of "open", "print" or "explore".

show can be one of the strings "minimized", "maximized" or "normal".

Example:

View an HTML file.

(UI-windows-shell-execute "open" "c:\\website\\index.html" "" "." "normal")

See also:

(UI-windows-help help-file cmd data)

The UI-windows-help command is an interface to the Windows Help system. The help-file parameter is the file name of the help file that will be used. What is done with the help file is determined by the cmd and data parameters. The following table details the cmd values and any required data.

cmd Value Description
"context" Display help for context number data.
"contents" Display the help file contents.
"setcontents" Select contents number data.
"contextpopup" Display in a pop-up window help for context number data.
"key" Display help for topic string data.
"partialkey" Display help for topic string data.If data is the string "" then display the search dialog.
"command" Execute the help macro in string data.
"forcefile" Force Windows Help to display the correct help file.
"helponhelp" Open Window Help Help file
"quit" Quit Windows Help

For more information about these cmd and data values see the documentation for Windows function WinHelp and the Windows Help compiler.

Example: Display the help topic for commands from the Windows help file:

(UI-windows-help "windows.hlp" "key" "commands")

See also:

(undo) ^X-^U

Undoes editing changes made to modified buffers. The command starts off a sequence of undo operations which are continued with the use of the undo-more function. Each undo or undo-more undoes one more series of changes to the next undo-boundary. An undo-boundary is planted before each keyboard key stroke.

(undo-boundary)

All operations between a pair of calls to undo-boundary will be undone by undo and undo-more. undo-boundary is called automatically between key sequences.

(undo-more)

Each time undo-more is called, the state of the buffers is restored to the previous undo-boundary. If called from the keyboard processor, it will simply undo the first call to undo.

(unlink-file file-spec)

Deletes the specified file.

(unset-mark) ^X-^@

Un-sets the mark.

(up-window repeat-count)

Moves the cursor into the window that is above the current window, unlike previous-window, which moves the cursor without regard to the physical position of the windows on the screen.

If the repeat-count is given then the command is repeated that number of times.

up-window reports an error of there is not a window above the current window.

(use-abbrev-table abbrev-table-name)

Sets the current local abbreviation table to the specified table.

(use-global-map keymap-name)

Specifies that the named keymap will be used for the global interpretation of all keystrokes. (use-local-map is used to change the local interpretation of keystrokes.)

(use-local-map keymap-name)

Specifies that the named keymap to be used for the local interpretation of all keystrokes. (use-global-map is used to change the global interpretation of key strokes.)

(use-old-buffer buffer-name) ^X-^O

Associates an existing buffer with the current window.

(use-syntax-table syntax-table-name)

Associates the named syntax table with the current buffer.

(use-variables-of-buffer buffer-name expression)

Allows an MLisp procedure to access the buffer-specific variables of any buffer without switching to it.

The function takes two parameters: the first is a buffer name, the second is an MLisp expression to execute.

This function is useful when writing packages that need to maintain context in the buffer-specific variables of one buffer but use many buffers.

The following example inserts the file name of buffer fred into the buffer joe:

(switch-to-buffer "joe")
(use-variables-of-buffer "fred")
(insert-string current-buffer-file-name)

(users-full-name)

Returns the user's full name as a string.

(users-login-name)

Returns the users login name as a string.