46: How do I tell Emacs to automatically indent a new line to the
indentation of the previous line?
One solution is Indented Text Mode (M-x indented-text-mode).
If you have auto-fill mode on (see question 30), you can tell Emacs to
prefix every line with a certain character sequence, the "fill prefix."
Type the prefix at the beginning of a line, position point after it, and
then type "C-x ." (set-fill-prefix) to set the fill prefix. Thereafter,
auto-filling will automatically put the fill prefix at the beginning of
new lines, and M-q (fill-paragraph) will maintain any fill prefix when
refilling the paragraph.
NOTE: If you have paragraphs with different levels of indentation, you
will have to set the fill prefix to the correct value each time you move
to a new paragraph. To avoid this hassle, try one of the many packages
available from the Emacs Lisp Archive (see question 87.) Look up "fill"
and "indent" in the Lisp Code Directory for guidance.