5

org-mode automatically indents description lists, but it uses two different schemes. For short labels, the second line of the description is aligned with the first character of the description. For long labels, the second line of the description is indented to five spaces, regardless of the first line. e.g.:

- short label :: description description description description  
                 description description description description  

- very long label :: description description description description
     description description description description

This produces ugly formatting for lists with a mix of description lengths. How can I control this behaviour for consistent indenting?

4

This behaviour is controlled by the variable org-list-description-max-indent. It's not documented in the manual, but its documentation string reads:

Maximum indentation for the second line of a description list.
When the indentation would be larger than this, it will become
5 characters instead.

So we can force description list indentation to always be 5 spaces by setting the maximum to 5:

(setq org-list-description-max-indent 5)

This produces:

- short label :: description description description description
     description description description description

- very long label :: description description description description
     description description description description

Different values will shift the threshold that switches indenting between 5 spaces and aligning with the first line.

As far as I can tell, there is no built-in way to change the default indent - it's always 5 spaces.

  • 1
    As an aside: the 5 spaces appears to be hard-coded into org-list-item-body-column. In the absence of a feature request to make this customizable, the workaround would be to redefine that function with a default size more to your liking. (The function is about 20 lines long, FYI). – Dan Apr 16 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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