aboutsummaryrefslogtreecommitdiff
path: root/modules/org-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-27 19:25:42 -0500
committerCraig Jennings <c@cjennings.net>2026-05-27 19:25:42 -0500
commit822e7a3798d431910eeff677ae751eff8b48731a (patch)
tree17f96c5bf5b0566d5d651a3e57a7978ff878a539 /modules/org-config.el
parenta6157f471c9d64c00f0a2e33224e373864a7ae80 (diff)
downloaddotemacs-822e7a3798d431910eeff677ae751eff8b48731a.tar.gz
dotemacs-822e7a3798d431910eeff677ae751eff8b48731a.zip
fix(org): stop folded property-drawer headings wrapping their tag indicators
A folded heading that also has a property drawer renders two glyphs after its right-aligned tag: the org-tidy inline dot (" ·") and the fold ellipsis (" ▾"). The tag-align reserve was 5 columns, and that " · ▾" spilled onto a second screen row, leaving a stray indicator line under the heading. The trailing glyphs measure 4 columns nominally, so the old 5-column reserve looked like it should fit. It didn't: the fallback triangle renders wider than its reported width and the :align-to stretch rounds, so the real overflow exceeds the column count. I sized the new reserve (9) from a rendered measurement, not arithmetic, and the docstring now says so and tells the next reader to verify by screenshot. That mismatch between column math and what actually renders is what let the earlier reserve ship broken. I verified the fix by rendering the real config off-screen at full width and reading the result: before, the two folded property-drawer headings wrapped "· ▾" to a second row; after, every heading is a single line. tests/manual/headline-wrap/ holds the fixture and a README so the check can be repeated by opening the file and looking, which is the only honest way to test a redisplay bug like this.
Diffstat (limited to 'modules/org-config.el')
-rw-r--r--modules/org-config.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/org-config.el b/modules/org-config.el
index 90a0a5d2..7d66acfd 100644
--- a/modules/org-config.el
+++ b/modules/org-config.el
@@ -108,12 +108,18 @@
Group 1 is the single gap character before the tags; group 2 is the tag
string itself.")
-(defconst cj/org-tag-right-margin 5
+(defconst cj/org-tag-right-margin 9
"Columns of gap left between right-aligned tags and the window's right edge.
At least 1 keeps a glyph out of the final column, which would wrap a
-non-truncated line. The extra columns leave room for the folded-heading
-ellipsis (`org-ellipsis', \" ▾\") that org appends after the tags, so it
-stays on the heading line instead of wrapping onto its own line.")
+non-truncated line. The remaining columns reserve room for the glyphs org
+appends AFTER the tags on a folded, property-drawer heading: the org-tidy
+inline symbol (`org-tidy-properties-inline-symbol', \" ·\") and the fold
+ellipsis (`org-ellipsis', \" ▾\"). Their nominal width is 4 columns, but the
+fallback font renders the triangle wider than its reported width and the
+`:align-to' stretch rounds, so the true overflow exceeds the nominal count.
+The value is set from rendered measurement (see the headline-wrap harness),
+not arithmetic -- that mismatch is what made the earlier 5-column reserve
+wrap. Verify changes with a screenshot, never column math alone.")
(defun cj/org--tag-align-spec (tag-string)
"Return a display spec that right-aligns TAG-STRING to the window edge.