11.2 Commands to Mark Textual Objects
Here are commands for placing point and the mark around a textual object such as a word, list, paragraph or page:
M-@
Set mark at the end of the next word ( mark-word
). This does not
move point.
C-M-@
Set mark after end of following balanced expression
( mark-sexp
). This does not move point.
M-h
Move point to the beginning of the current paragraph, and set mark at
the end ( mark-paragraph
).
C-M-h
Move point to the beginning of the current defun, and set mark at the
end ( mark-defun
).
C-x C-p
Move point to the beginning of the current page, and set mark at the
end ( mark-page
).
C-x h
Move point to the beginning of the buffer, and set mark at the end
( mark-whole-buffer
).
M-@
( mark-word
) sets the mark at the end of the next
word (see Words, for information about words). Repeated
invocations of this command extend the region by advancing the mark
one word at a time. As an exception, if the mark is active and
located before point, M-@
moves the mark backwards from its
current position one word at a time.
This command also accepts a numeric argument n, which tells it to advance the mark by n words. A negative argument -n moves the mark back by n words.
Similarly, C-M-@
( mark-sexp
) puts the mark at the end
of the next balanced expression (see Expressions with Balanced Parentheses). Repeated
invocations extend the region to subsequent expressions, while
positive or negative numeric arguments move the mark forward or
backward by the specified number of expressions.
The other commands in the above list set both point and mark, so as
to delimit an object in the buffer. M-h
( mark-paragraph
)
marks paragraphs (see Paragraphs), C-M-h
( mark-defun
)
marks top-level definitions (see Moving by Defuns), and C-x C-p
( mark-page
) marks pages (see Pages). Repeated
invocations again play the same role, extending the region to
consecutive objects; similarly, numeric arguments specify how many
objects to move the mark by.
C-x h
( mark-whole-buffer
) sets up the entire buffer as
the region, by putting point at the beginning and the mark at the end.