<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-calibredb-epub-config.el, branch load-graph-classify-end</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-end</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=load-graph-classify-end'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-13T11:32:08+00:00</updated>
<entry>
<title>fix(calibredb-epub): point cj/nov--file-path at nov-file-name</title>
<updated>2026-05-13T11:32:08+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-13T11:32:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=3f44db4f7be24c6daacad0956f019610aeb5f868'/>
<id>urn:sha1:3f44db4f7be24c6daacad0956f019610aeb5f868</id>
<content type='text'>
The fallback chain was checking `nov-epub-filename` and `nov-epub-file`, but neither symbol exists in nov.el — the real var is `nov-file-name`, set by `nov-mode` from the visited file. Both `boundp` arms always returned nil, so the fallbacks were dead code. The bug was dormant rather than active: `buffer-file-name` always holds the EPUB path for normal nov buffers and covered the first arm of the `or`.

I replaced both wrong-named arms with a single live arm on `nov-file-name`, and added a Boundary test that exercises it.
</content>
</entry>
<entry>
<title>test(calibredb-epub): cover seven untested ebook helpers</title>
<updated>2026-05-13T11:31:01+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-13T11:31:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=7b371461119d5abafc5adcee06b71ce5629d6820'/>
<id>urn:sha1:7b371461119d5abafc5adcee06b71ce5629d6820</id>
<content type='text'>
I added tests for `cj/calibredb-clear-filters`, `cj/force-nov-mode-for-epub`, `cj/--nov-image-padding-cols` (the helper extracted in the previous commit), `cj/nov--natural-window-width`, `cj/nov--metadata-get`, `cj/nov--file-path`, and `cj/nov-jump-to-calibredb`. Each gets Normal, Boundary, and Error cases where they apply: 22 tests in all. The calibredb stubs sit in a new `test-calibredb-epub--with-calibredb-stubs` macro so the three jump-to-calibredb cases stay focused on their branch.

Coverage on `calibredb-epub-config.el` moves from 7/104 (6.7%) to 95/133 (71.4%).
</content>
</entry>
<entry>
<title>fix(nov): center the EPUB text by setting window margins directly</title>
<updated>2026-05-12T12:17:29+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-12T12:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=b7c6b2c59a2ad74e8e886471ea57b2e87f812d4a'/>
<id>urn:sha1:b7c6b2c59a2ad74e8e886471ea57b2e87f812d4a</id>
<content type='text'>
The 80% width from `4d9a206' 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.
</content>
</entry>
<entry>
<title>feat(nov): default the EPUB text column to 80% of the window</title>
<updated>2026-05-12T11:17:11+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-12T11:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=4d9a2066a26cc82e81855d9ad343d76fd715dcbf'/>
<id>urn:sha1:4d9a2066a26cc82e81855d9ad343d76fd715dcbf</id>
<content type='text'>
`1c5c8bd' had set `cj/nov-margin-percent' to 12 (~76% text); 10 gives a round 80%. Adjust per-buffer with the `+'/`-' keys; clamp is unchanged (0..25, i.e. 50%..100%).
</content>
</entry>
<entry>
<title>fix(nov): rework the EPUB reading-width layout</title>
<updated>2026-05-12T11:07:20+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-12T11:07:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=1c5c8bd4df3bd4fd71fad13b2b57e670a4e74355'/>
<id>urn:sha1:1c5c8bd4df3bd4fd71fad13b2b57e670a4e74355</id>
<content type='text'>
`cj/nov--text-width-for-window' computed the target column as a percentage of `(window-body-width)'. But body width is the column count *after* the display margins. `cj/nov-update-layout' runs from `window-configuration-change-hook': it sets `visual-fill-column''s margins, which changes the body width, which fires the hook, which re-runs the layout against the now-narrower body, and so on. It's a shrinking feedback loop that bottoms out at `cj/nov-min-text-width' (40 columns) no matter what `cj/nov-margin-percent' is. That's why the column was a thin strip regardless of the margin setting.

The width is now computed from the window's *natural* column count (body width plus any margins already set), so re-running the layout is idempotent. The margin math moved into a pure `cj/nov--text-width' helper, which is what the unit tests drive, and there's a regression test that the result is the same whether or not margins are already in place.

Also:
- `+'/`=' (`cj/nov-widen-text') and `-'/`_' (`cj/nov-narrow-text') step `cj/nov-margin-percent' by `cj/nov-margin-step' and re-lay-out, reporting the new percentage. `cj/nov-margin-percent' is now clamped to 0..25, so the text column runs from 50% (the floor) to 100% (the full window).
- `cj/nov-margin-percent' default is 12 (≈76% text) for a comfortable starting width.
- `cj/nov-apply-preferences' re-renders the document at the end again. `b3b537f' removed that on the theory `visual-fill-column' would re-trigger the render. The first page came up off-center until a manual resize, so it's back.
- `cj/nov-update-layout' is now a command.

The visible result (a ~75% centered column on first open, `+`/`-` to adjust) needs a restart to confirm. The tests cover the width math and clamping, idempotency, the adjust commands and their keybindings, the command status, and the re-render.
</content>
</entry>
<entry>
<title>test: close coverage gaps from the preceding batch</title>
<updated>2026-05-11T23:17:22+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-11T23:17:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=e0e0ecdb86e3ae1772adcedb50e6c9caa210cf17'/>
<id>urn:sha1:e0e0ecdb86e3ae1772adcedb50e6c9caa210cf17</id>
<content type='text'>
Untested paths surfaced while reviewing the preceding feature/fix commits:
- calendar-sync: a test that `-L' precedes `-l' in the worker command (separate `member' checks wouldn't catch a swap), plus a `:slow' tag on the real-subprocess worker test so it stays out of the default `make test' run.
- org-capture cache: a killed marker buffer invalidates the entry and the next resolution rescans without erroring on the stale marker, `cj/org-capture-clear-target-cache' actually empties the hash, and non-`file+headline' targets (`file', `file+olp', `file+function') fall through to the original `org-capture-set-target-location'.
- lorem-optimum: `cj/lipsum-title' on an empty chain returns "", not an error.
- calibredb-epub: a negative `cj/nov-margin-percent' is clamped up to 0 (text takes the full window width).
- mu4e attachments: the default save directory comes from the part's `:target-dir' and falls back to `~/Downloads/', and asking for the attachment at point on a header line fails with a `user-error'.
</content>
</entry>
<entry>
<title>refactor(epub): clean up calibredb-epub-config.el</title>
<updated>2026-05-11T22:17:54+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-11T22:17:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=b3b537fb74de7950ccd58d0f09cd7f5fbf39f546'/>
<id>urn:sha1:b3b537fb74de7950ccd58d0f09cd7f5fbf39f546</id>
<content type='text'>
Dropped the 1-second `:defer' from the calibredb use-package and the redundant explicit `nov-render-document' call in `cj/nov-apply-preferences'. Nov / visual-fill-column text width now recalculates on `window-configuration-change-hook'. `cj/nov--text-width-for-window' computes the (clamped, minimum-readable) width and `cj/nov-update-layout' installs it buffer-locally. Lowered `calibredb-search-page-max-rows' from 20000 to 500 (pagination was effectively disabled). Replaced the anonymous zathura keybinding with `cj/nov-open-external'. Tests cover the width computation and the external-open binding.
</content>
</entry>
</feed>
