In auto-fill-mode, I want emacs to auto-fill paragraph with hanging indentation, like this:

```
This is an example of hanging indented
    paragraph. The first line is indented
    less than the following lines in a
    paragraph.

Another paragraph starts from here, and
    lines are broken.

```

How to do this?
['https://Stackoverflow.com/questions/14309502', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1261870/']
You can achieve the effect you want automatically by putting the following lines into you .emacs file:

```lisp
(setq adaptive-fill-function '(lambda () "    "))

```

The string at the end of the line is the width of the hanging indent.
You can do this interactively using `M-x set-fill-prefix`, bound by default to `C-x .` (that's a period, or full-stop, after the C-x).

Manually, *only once*, indent the second line of a single paragraph, and while your cursor (point) is at that position, press `C-x .`. All auto-fills from now on will indent anything past the first line accordingly.

In order to reset the behavior, move your cursor the beginning of a line and invoke `C-x .` again.

As a bonus, you aren't restricted to having this fill prefix be limited to spaces. For example you could include comment symbols or vertical lines or your $PS1.

You may also be interested in `M-x auto-fill-mode` which toggles *automatic* line-wrapping and justification. That will save you from having to manually selecting regions and typing `M-q`.

If you really want to get fancy, you can write your own custom function for this, and set variable `normal-auto-fill-function` to point to your function.