3

How can one enable org-indent-mode (or otherwise indent content to Org headings) while still maintaining a consistent visual fill column?

enter image description here

Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77

2 Answers2

0

One way of achieving this behavior is to disable org-indent-mode and set org-adapt-indentation to t. The side effect of this configuration is that spaces will be added to Org file, where org-indent-mode only acts at render time.

Matthew Piziak
  • 5,958
  • 3
  • 29
  • 77
0

The only way I found to do this is by overriding the function that returns the fill column.

(defun current-fill-column ()
      "Return the fill-column to use for this line.
Subtracts right margin and org indentation level from fill-column"
      (let ((indent-level (if (bound-and-true-p org-indent-mode)
                              (* org-indent-indentation-per-level
                                 (org-current-level))
                            0))
            (margin (or (get-text-property (point) 'right-margin) 0)))
        (- fill-column indent-level margin)))

This probably misses some edge cases, since the original function is more complex, but this is working for my purposes so far.

Drew
  • 75,699
  • 9
  • 109
  • 225