orgmode
orgmode copied to clipboard
Fix wrong tag_column indentation
The tags_width was being subtracted in any case, which resulted in flushright alignment per default. When a negative tag_column value was given, the tags_width was subtracted twice, resulting in a broken alignment.
tag_column is not meant to be negative. Flushright alignment is how Emacs aligns it. Initial implementation was wrong, but I fixed it some time ago. Agenda is also aligned that way (kind of).
If it's not meant to be negative, then 1) the DOCS.md is wrong and 2) there is no real reason for this subtraction, or is there? Actually, I think there should be no math.abs either in this case, just a default value.
My emacs says this:
org-tags-column is a variable defined in ‘org.el’.
Its value is -77
Documentation:
The column to which tags should be indented in a headline.
If this number is positive, it specifies the column. If it is negative,
it means that the tags should be flushright to that column. For example,
-80 works well for a normal 80 character screen.
When 0, place tags directly after headline text, with only one space in
between.
I have not customized anything (unless Spacemacs did), so -77 seems to be the default for me.
You are completely right, I misunderstood it. I thought it always behaves as flushright.
I think what we need to do here is to change the default for org_tags_column to -80 instead of 80, and to apply your fix. Test with :ARCHIVE: tag shouldn't need to be changed since it should pass with your fix and the default value change.
I applied the changes you suggested. Indeed, the change in the unit test was not necessary :+1: