Skip to content

Shield ghostel buffers from global default-text-properties#535

Merged
dakra merged 1 commit into
mainfrom
fix/shield-default-text-properties
Jul 13, 2026
Merged

Shield ghostel buffers from global default-text-properties#535
dakra merged 1 commit into
mainfrom
fix/shield-default-text-properties

Conversation

@dakra

@dakra dakra commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Setting line geometry through default-text-properties, e.g.

(setq default-text-properties '(line-spacing 0.1 line-height 1.05))

inflates every rendered row via the text-property fallback, but those properties are invisible to window-screen-lines/default-line-height (Emacs' default_line_pixel_height deliberately ignores line-height properties). The grid is therefore sized for more rows than fit the window body, and the bottom anchor vscrolls the top rows out of view — reported in discussion #534 ("vscrolls up, hiding the first two lines").

Unlike the line-spacing variable (already pinned to 0 in ghostel-mode), this mechanism can't be tolerated by better sizing math: no supported metric exposes property-driven row heights, and measuring rendered pixels would diverge from the unit the standard window-adjust-process-window-size path uses, reintroducing the #192 dual-authority resize problem.

Fix: set default-text-properties buffer-locally to nil in the ghostel-mode body, next to the existing line-spacing override. The user's global value stays untouched for all other buffers.

Verified live (GUI Emacs, reporter's exact config): unpatched, rows render 15 px while all metrics report 14 px → 3 px vscroll and two hidden rows; patched, a fresh terminal renders 14 px rows, zero vscroll, all rows visible with the prompt bottom-aligned, and re-setting the global while the terminal runs cannot re-poison it. Includes a regression test asserting the buffer-local shield.

line-spacing/line-height text properties supplied through the
default-text-properties fallback inflate rendered rows invisibly to
the window-screen-lines sizing math, so the grid overcounts rows and
the bottom anchor vscrolls the top lines out of view (discussion #534).
Set the variable buffer-locally to nil, next to the existing
line-spacing override.
@dakra dakra merged commit 17b59d6 into main Jul 13, 2026
28 checks passed
@dakra dakra deleted the fix/shield-default-text-properties branch July 13, 2026 15:10
@dakra dakra temporarily deployed to github-pages July 13, 2026 15:11 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant