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


41.1 Point

Point is a special buffer position used by many editing commands, including the self-inserting typed characters and text insertion functions. Other commands move point through the text to allow editing and insertion at different places.

Like other positions, point designates a place between two characters (or before the first character, or after the last character), rather than a particular character. Usually terminals display the cursor over the character that immediately follows point; point is actually before the character on which the cursor sits.

The value of point is a number between 1 and the buffer size plus 1. If narrowing is in effect (see Narrowing), then point is constrained to fall within the accessible portion of the buffer (possibly at one end of it).

Each buffer has its own value of point, which is independent of the value of point in other buffers. Each window also has a value of point, which is independent of the value of point in other windows on the same buffer. This is why point can have different values in various windows that display the same buffer. When a buffer appears in only one window, the buffer’s point and the window’s point normally have the same value, so the distinction is rarely important. See Window Point, for more details.

Function: point &optional buffer

This function returns the value of point in buffer, as an integer. buffer defaults to the current buffer if omitted.

(point)
     ⇒ 175
Function: point-min &optional buffer

This function returns the minimum accessible value of point in buffer. This is normally 1, but if narrowing is in effect, it is the position of the start of the region that you narrowed to. (See Narrowing.) buffer defaults to the current buffer if omitted.

Function: point-max &optional buffer

This function returns the maximum accessible value of point in buffer. This is (1+ (buffer-size buffer)), unless narrowing is in effect, in which case it is the position of the end of the region that you narrowed to. (see Narrowing). buffer defaults to the current buffer if omitted.

Function: buffer-end flag &optional buffer

This function returns (point-min buffer) if flag is less than 1, (point-max buffer) otherwise. The argument flag must be a number. buffer defaults to the current buffer if omitted.

Function: buffer-size &optional buffer

This function returns the total number of characters in buffer. In the absence of any narrowing (see Narrowing), point-max returns a value one larger than this. buffer defaults to the current buffer if omitted.

(buffer-size)
     ⇒ 35
(point-max)
     ⇒ 36
Variable: buffer-saved-size

The value of this buffer-local variable is the former length of the current buffer, as of the last time it was read in, saved or auto-saved.


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