Go to the first, previous, next, last section, table of contents.


Rectangular Editing

These functions are used to manipulate rectangular regions of buffers. Two position objects are used to define a rectangle, these represent opposite corners of the rectangle. Note that the corner on the right hand side of the rectangle specifies the column after the last column included in the rectangle.

Function: delete-rect start-pos end-pos &optional buffer
This function deletes a rectangle, defined by start-pos and end-pos, from the specified buffer.

Function: copy-rect start-pos end-pos &optional buffer
Returns a string containing the rectangle of text defined by the two positions start-pos and end-pos. Any TAB characters are expanded to SPC characters, newline characters mark the end of each line in the rectangle.

Function: cut-rect start-pos end-pos &optional buffer
A combination of the copy-rect and delete-rect functions; it makes a copy of the rectangle's contents which is returned after the rectangle is deleted from the buffer.

Command: insert-rect string &optional pos buffer
Inserts the string string into the buffer at the specified position, treating string as a rectangle of text. This means that each successive line of string (separated by newline characters) is inserted at the same column in successive lines.

If the end of the buffer is reached and there is still some of the string left to insert extra lines are created at the end of the buffer.

Command: yank-rectangle &optional dont-yank-block
This function is similar to the yank function (see section Insertion Functions), except that it uses the insert-rect function to insert the piece of text.


Go to the first, previous, next, last section, table of contents.