# ml-bind-key(2)

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

## NAME

ml-bind-key - Create key binding for message line
ml-unbind-key - Remove key binding from message line

## SYNOPSIS

n ml-bind-key "command" "key"
n ml-unbind-key "key"

## DESCRIPTION

ml-bind-key creates a key binding local to the message line input buffer. There are several commands that can be used in message line input, each command is associated with a main buffer editing command and inherits all that commands global bindings, i.e. moving forward 1 character is associated with the command forward-char(2) and thus inherits the binding `C-f` (as well as any other like the right cursor key). The following is a list of available commands, what they do and their associated commands

## Cursor Movement

- move backwards 1 character, command: backward-char (C-b, left)
- move forwards 1 character, command: forward-char (C-f, right)
- move backwards 1 word, command: backward-word (esc b)
- move forwards 1 word, command: forward-word (esc f)
- move to beginning of buffer, command: beginning-of-line (C-a, home)
- move to the end of buffer, command: end-of-line (C-e, end)
- move to beginning of buffer, command: beginning-of-buffer (esc <)
- move to the end of buffer, command: end-of-buffer (esc >)

## Input

- Quote a character, command: quote-char (C-q)
- Yank kill buffer into message line, command: yank (C-y)
- insert current buffers current line into the buffer, command: insert-newline (C-o)
- insert current buffers file name into the buffer, command: insert-file-name (C-x C-y)
- insert current buffer name into the buffer, command: -1 insert-file-name (C-x y)
- get the previous item in the yank buffer, command: reyank (esc y)

## Deletion

- copy marked region, command: copy-region (esc w)
- delete marked region, command: kill-region (cw)
- delete backward 1 character, command: backward-delete-char (C-h, backspace)
- delete forward 1 character, command: forward-delete-char (C-d, delete)
- delete forward word, command: forward-kill-word (esc d)
- delete backward word, command: backward-kill-word (esc backspace)
- kill text from current position to end of line, the text is placed in the kill buffer. Command: kill-line (C-k).
- erase whole line, the text is placed in the kill buffer, command kill-region (C-w). Note that in incremental searches this is used to add the current word to the search string.

## History

MicroEmacs 2009 stores the last 20 entries of each kind (command, buffer, file, search and general which is also saved in the history file so the state of the history is retained when next loaded. The following commands can be used to manipulate the history.

- next history list entry (loop through history), command: forward-paragraph (esc n, C-n, down)
- previous history list entry, command: backward-paragraph (esc p, C-p, up)

## Completion

When entering a command, file, buffer or a mode name MicroEmacs 2009 creates a list of possible completions the following operations can be performed on this list.

- expand. This completes the given input until the first ambiguous character, command: a space (' ') or tab (C-i).
- expand to the previous completion (loops through the completion list), command: scroll-next-window-up (esc C-z)
- expand to the next completion (loops through the completion list), command: scroll-next-window-down (esc C-v)
- create a listing of all completions, command: a double expansion, i.e. 2 spaces or tabs. The first expands and the second creates the list.
- page up the completion list buffer, scroll-up (C-z, page-up)
- page down the completion list buffer, scroll-down (C-v, page-down)

## Miscellaneous

- abort input, returning failure to the input, abort-command (C-g)
- re-fresh the message line, command: recenter (C-l)
- finish input, command newline (C-m, return)
- set mark, command: set-mark (C-space)
- exchange point and mark, command: exchange-point-and-mark
- transpose previous character with current character, command: transpose-chars (C-t)
- capitalize the next word, command: capitalize-word (esc c)
- Turn the whole of the next word to lower case letters, command: upper-case-word (esc u)
- Turn the whole of the next word to upper case letters, command: lower-case-word (esc l)
- Cursor to mouse position, command: set-cursor-to-mouse (mouse select in window)
- Empty function, command: void

ml-unbind-key unbinds a user created message line key binding, this command effects only the message line key bindings. If a negative argument is given to ml-unbind-key then all message line bindings are removed.

## EXAMPLE

If expansion was required on the esc esc key binding then use the following:-

    ml-bind-key tab "esc esc"

## NOTES

The prefix commands cannot be rebound with this command.

Command key response time will linearly increase with each local binding.

## SEE ALSO

global-bind-key(2), buffer-bind-key(2), describe-bindings(2), osd-bind-key(2), global-unbind-key(2).

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

</HMTL>