Function: align-newline-and-indent

align-newline-and-indent is an autoloaded, interactive and byte-compiled function defined in align.el.gz.

Signature

(align-newline-and-indent)

Documentation

A replacement function for newline-and-indent, aligning as it goes.

The alignment is done by calling align on the region that was indented.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/align.el.gz
;;;###autoload
(defun align-newline-and-indent ()
  "A replacement function for `newline-and-indent', aligning as it goes.
The alignment is done by calling `align' on the region that was
indented."
  (interactive)
  (let ((separate (or (if (and (symbolp align-region-separate)
			       (boundp align-region-separate))
			  (symbol-value align-region-separate)
			align-region-separate)
		      'entire))
	(end (point)))
    (call-interactively 'newline-and-indent)
    (save-excursion
      (forward-line -1)
      (while (not (or (bobp)
		      (align-new-section-p (point) end separate)))
	(forward-line -1))
      (align (point) end))))