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?

Drew
  • 75,699
  • 9
  • 109
  • 225
Norman Ramsey
  • 1,113
  • 6
  • 13
  • Use Org mode lists? – NickD Sep 14 '20 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](https://www.gnu.org/software/emacs/manual/html_node/emacs/Adaptive-Fill.html). And I too find this use case not handled well. But maybe I to am missing something. ;-) – Drew Sep 14 '20 at 21:54

1 Answers1

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.

Norman Ramsey
  • 1,113
  • 6
  • 13