3.9 Inserting text
This section contains details of commands used to insert text from the kill ring -- see "Deleting and killing text" on page 40 -- and various other commands used to insert text and lines into the buffer.
Un-KillEditor Command
- Arguments: None
Key sequence:Ctrl+Y - Selects (yanks) the top item in the kill ring (which represents the last piece of text that was killed with a kill command or saved with
Save Region) and inserts it before the current point. The current point is left at the end of the inserted text, and the mark is automatically set to the beginning of the inserted text. - A prefix argument (
Ctrl+U number) causes the item at position number in the ring to be inserted. The order of items on the ring remains unaltered.
Rotate Kill RingEditor Command
- Arguments: None
Key sequence: +Y - Replaces the text that has just been un-killed with the item that is next on the kill ring. It is therefore possible to recover text other than that which was most recently killed by typing
Ctrl+Yfollowed by +Y the required number of times. IfUn-Kill was not the previous command, an error is signalled. - Note that the ring is only rotated and no items are actually deleted from the ring using this command.
- A prefix argument causes the kill ring to be rotated the appropriate number of times before the top item is selected.
New LineEditor Command
- Arguments: None
Key sequence:Return - Opens a new line before the current point. If the current point is at the start of a line, an empty line is inserted above it. If the current point is in the middle of a line, that line is split. The current point always becomes located on the second of the two lines.
- A prefix argument causes the appropriate number of lines to be inserted before the current point.
Open LineEditor Command
- Arguments: None
Key sequence:Ctrl+O - Opens a new line after the current point. If the current point is at the start of a line, an empty line is inserted above it. If the current point is in the middle of a line, that line is split. The current point always becomes located on the first of the two lines.
- A prefix argument causes the appropriate number of lines to be inserted after the current point.
Quoted Insert Editor Command
- Arguments: key
Key sequence:Ctrl+Qkey - Inserts key into the text literally. This can be used to enter control keys (such as
Ctrl+L) into a buffer as a text string. Note thatCtrl is represented by^ and by^].
Self InsertEditor Command
- Arguments: None
Key sequence: key
editor:self-insert-command p &optional char
- This is the basic command used for inserting each character that is typed. The character to be inserted is char. There is no need for the user to use this command explicitly.
Dynamic CompletionEditor Command
- Arguments: None
Key sequence: +/ - Tries to complete the current word, by looking backwards for a word that starts with the same characters as have already been typed. Repeated use of this command makes the search skip to successively previous instances of words beginning with these characters. A prefix argument causes the search to progress forwards rather than backwards. If the buffer is in Lisp mode then completion occurs for Lisp symbols as well as words.
Expand File NameEditor Command
- Arguments: None
Key sequence: +Tab - Expands the file name at the current point. Issuing this command twice in succession brings up a list of possible completions in a popup window.