orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Fix wrong tag_column indentation

Open jgollenz opened this issue 3 years ago • 4 comments

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.

jgollenz avatar Jul 24 '22 12:07 jgollenz

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).

kristijanhusak avatar Jul 24 '22 19:07 kristijanhusak

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.

jgollenz avatar Jul 24 '22 20:07 jgollenz

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.

jgollenz avatar Jul 24 '22 20:07 jgollenz

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.

kristijanhusak avatar Aug 09 '22 11:08 kristijanhusak

I applied the changes you suggested. Indeed, the change in the unit test was not necessary :+1:

jgollenz avatar Aug 10 '22 13:08 jgollenz