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

2
  • Does this still happen? I tried replicating this in 2022 with org-mode + org-indent-mode + visual-fill-column-mode, and I didn't see the undesired overflow.
    – g-gundam
    Oct 15, 2022 at 16:17
  • @g-gundam This happens for me in Org 9.5.5 on Emacs 28.1. Oct 15, 2022 at 23:56

2 Answers 2

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.