Previous: , Up: Select and Move   [Contents][Index]


9.5 Accumulating Text

The following commands can be used for accumulating text from different buffers into one place or for copying one region of text into many buffers:

M-x append-to-buffer

Append region to contents of specified buffer (append-to-buffer). After you type in this command and press RET, Emacs will prompt you for a buffer name. You will see a message in the echo area:

Append to buffer: (default <buffer name>)

After you type in a buffer name, a copy of the region will be inserted at the location of the cursor into that buffer. If there is no buffer with the name given by you, Emacs will create a new buffer with that name. By default the cursor’s position in the <buffer name> is at the end.

M-x prepend-to-buffer

Prepend region to contents of specified buffer. This command is similar to the above command except that the cursor in the buffer (by default) is at the beginning rather than at the end.

M-x copy-to-buffer

Copy region into specified buffer, deleting that buffer’s old contents. This command will also prompt you for a buffer name.

M-x insert-buffer

Insert contents of specified buffer into current buffer at point. This command will prompt you for a buffer name which you want to be copied into the current buffer at the location of the cursor.

M-x append-to-file

This command will prompt you for a filename and append the region to the end of the contents of the specified file.

See Accumulating Text in SXEmacs User’s Manual, for more information regarding this topic.

You can also use rectangle commands for operating on rectangular areas of text. See Rectangles in SXEmacs User’s Manual, for more information regarding rectangle commands.

Emacs also provides registers which serve as temporary storage for text or positions. Each register has a one character name and they can store regions, a rectangle, or a mark i.e. a cursor position. Whatever you store in register stays there until you store something else in that register. To find out about commands which manipulate registers See Registers in SXEmacs User’s Manual.


Previous: , Up: Select and Move   [Contents][Index]