Function: center-region

center-region is an interactive and byte-compiled function defined in text-mode.el.gz.

Signature

(center-region FROM TO)

Documentation

Center each nonblank line starting in the region.

See center-line for more info.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/text-mode.el.gz
(defun center-region (from to)
  "Center each nonblank line starting in the region.
See `center-line' for more info."
  (interactive "r")
  (if (> from to)
      (let ((tem to))
	(setq to from from tem)))
  (save-excursion
    (save-restriction
      (narrow-to-region from to)
      (goto-char from)
      (while (not (eobp))
	(or (save-excursion (skip-chars-forward " \t") (eolp))
	    (center-line))
	(forward-line 1)))))