3

I'm using auto-fill-mode with indented-text-mode to write numbered lists. I'm trying to figure out how to persuade the automatic indentation to move past an item number on the first line. I'm working with emacs -q and I have fill-column set to 70 (the default). I'm editing this line:

 2. Every value-projection function in `value.h` fails in the same way: by 

When I place the cursor at the end of the line and hit the space bar, I am hoping for the buffer to become like this, where the second line is indented past the 2.:

 2. Every value-projection function in `value.h` fails in the same way: by 

But instead, the second line is indented to the 2:

 2. Every value-projection function in `value.h` fails in the same way: by 

I have gotten as far as discovering the existence of adaptive-fill-first-line-regexp, but I have not figured out how to use it effectively---and I have a sneaking suspicion that it is actually intended to solve another problem.

How can I customize the automatic indentation to work the way I want?

2
  • Use Org mode lists? Commented Sep 14, 2020 at 20:57
  • 1
    Yep, it's complicated. Hopefully someone here will give you a clear and helpful answer. See also the Emacs manual, node Adaptive Fill. And I too find this use case not handled well. But maybe I to am missing something. ;-) Commented Sep 14, 2020 at 21:54

1 Answer 1

1

I customized variable adaptive-fill-regexp by adding 0-9. to the big character class. We'll see how it works out, but preliminary results look promising.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.