Function: mark-paragraph

mark-paragraph is an interactive and byte-compiled function defined in paragraphs.el.gz.

Signature

(mark-paragraph &optional ARG ALLOW-EXTEND)

Documentation

Put point at beginning of this paragraph, mark at end.

The paragraph marked is the one that contains point or follows point.

With argument ARG, puts mark at end of a following paragraph, so that the number of paragraphs marked equals ARG.

If ARG is negative, point is put at end of this paragraph, mark is put at beginning of this or a previous paragraph.

Interactively (or if ALLOW-EXTEND is non-nil), if this command is repeated or (in Transient Mark mode) if the mark is active, it marks the next ARG paragraphs after the ones already marked.

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/paragraphs.el.gz
(defun mark-paragraph (&optional arg allow-extend)
  "Put point at beginning of this paragraph, mark at end.
The paragraph marked is the one that contains point or follows point.

With argument ARG, puts mark at end of a following paragraph, so that
the number of paragraphs marked equals ARG.

If ARG is negative, point is put at end of this paragraph, mark is put
at beginning of this or a previous paragraph.

Interactively (or if ALLOW-EXTEND is non-nil), if this command is
repeated or (in Transient Mark mode) if the mark is active,
it marks the next ARG paragraphs after the ones already marked."
  (interactive "p\np")
  (unless arg (setq arg 1))
  (when (zerop arg)
    (error "Cannot mark zero paragraphs"))
  (cond ((and allow-extend
	      (or (and (eq last-command this-command) (mark t))
		  (and transient-mark-mode mark-active)))
	 (set-mark
	  (save-excursion
	    (goto-char (mark))
	    (forward-paragraph arg)
	    (point))))
	(t
	 (forward-paragraph arg)
	 (push-mark nil t t)
	 (backward-paragraph arg))))