Next: , Previous: , Up: Text   [Contents][Index]


43.20 Registers

A register is a sort of variable used in SXEmacs editing that can hold a marker, a string, a rectangle, a window configuration (of one frame), or a frame configuration (of all frames). Each register is named by a single character. All characters, including control and meta characters (but with the exception of C-g), can be used to name registers. Thus, there are 255 possible registers. A register is designated in SXEmacs Lisp by a character that is its name.

The functions in this section return unpredictable values unless otherwise stated.

Variable: register-alist

This variable is an alist of elements of the form (name . contents). Normally, there is one element for each SXEmacs register that has been used.

The object name is a character (an integer) identifying the register. The object contents is a string, marker, or list representing the register contents. A string represents text stored in the register. A marker represents a position. A list represents a rectangle; its elements are strings, one per line of the rectangle.

Function: get-register register

This function returns the contents of the register register, or nil if it has no contents.

Function: set-register register value

This function sets the contents of register register to value. A register can be set to any value, but the other register functions expect only certain data types. The return value is value.

Command: view-register register

This command displays what is contained in register register.

Command: insert-register register &optional beforep

This command inserts contents of register register into the current buffer.

Normally, this command puts point before the inserted text, and the mark after it. However, if the optional second argument beforep is non-nil, it puts the mark before and point after. You can pass a non-nil second argument beforep to this function interactively by supplying any prefix argument.

If the register contains a rectangle, then the rectangle is inserted with its upper left corner at point. This means that text is inserted in the current line and underneath it on successive lines.

If the register contains something other than saved text (a string) or a rectangle (a list), currently useless things happen. This may be changed in the future.


Next: , Previous: , Up: Text   [Contents][Index]