aboutsummaryrefslogtreecommitdiff
path: root/modules/diff-config.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-12 07:17:29 -0500
committerCraig Jennings <c@cjennings.net>2026-05-12 07:17:29 -0500
commitf9720c657217ea421d91caf326e756aabe2aad44 (patch)
tree485fa23251c666ddb1e7665f29454fbe91796451 /modules/diff-config.el
parent1181103a558abdb6d1da4602ef31035cb2d48bc5 (diff)
downloaddotemacs-f9720c657217ea421d91caf326e756aabe2aad44.tar.gz
dotemacs-f9720c657217ea421d91caf326e756aabe2aad44.zip
fix(nov): center the EPUB text by setting window margins directly
The 80% width from `12c11f1' wasn't actually narrowing the page: `cj/nov-apply-preferences' set `nov-text-width' to t (nov renders the text unfilled, one long line per paragraph) and counted on `visual-fill-column-mode' to set the window's display margins, but those margins never got applied in nov-mode buffers (even after manually re-running the layout), so the text wrapped at the full window width. The cause is still unknown. This drops `visual-fill-column' from nov entirely: - `nov-text-width' is a column count (~80% of the window's natural width), so nov's `shr' fills the text itself. - `cj/nov-update-layout' sets the window's left/right margins directly to `(natural - text-width) / 2' each, centering the block, and pushes the fringes out to the window edge so they don't show as thin lines beside the text. When the width changes it re-renders, restoring the reading position approximately. - `cj/nov-apply-preferences' adds a `kill-buffer-hook' that drops the margins and fringes when the EPUB buffer goes away, so a later buffer in that window isn't left indented. - `+'/`=' and `-'/`_' adjust `cj/nov-margin-percent' and re-flow + re-center. The text-width math moved into a `cj/nov--natural-window-width' helper alongside the existing `cj/nov--text-width'. Known nit: the centering is a touch left-of-center because shr wraps at word boundaries, so the rendered text is a bit narrower than `nov-text-width' and the right margin ends up slightly larger. Logged as a follow-up.
Diffstat (limited to 'modules/diff-config.el')
0 files changed, 0 insertions, 0 deletions