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


41.2.2 Motion by Words

These functions for parsing words use the syntax table to decide whether a given character is part of a word. See Syntax Tables.

Command: forward-word &optional count buffer

This function moves point forward count words (or backward if count is negative). Normally it returns t. If this motion encounters the beginning or end of the buffer, or the limits of the accessible portion when narrowing is in effect, point stops there and the value is nil.

count defaults to 1 and buffer defaults to the current buffer.

In an interactive call, count is set to the numeric prefix argument.

Command: backward-word &optional count buffer

This function is just like forward-word, except that it moves backward until encountering the front of a word, rather than forward. buffer defaults to the current buffer if omitted.

In an interactive call, count is set to the numeric prefix argument.

Variable: words-include-escapes

This variable affects the behavior of forward-word and everything that uses it. If it is non-nil, then characters in the “escape” and “character quote” syntax classes count as part of words. Otherwise, they do not.