<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-dirvish-config-ediff-pair.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-10T18:41:27+00:00</updated>
<entry>
<title>refactor(dirvish): extract cj/--ediff-pair-from-files; fix 0-files crash</title>
<updated>2026-05-10T18:41:27+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-10T18:41:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=09f3349af22c932a01f0788787cee9ab4f3c38a7'/>
<id>urn:sha1:09f3349af22c932a01f0788787cee9ab4f3c38a7</id>
<content type='text'>
`cj/dired-ediff-files' had its pair-determination logic inline: count check, prompt fallback when only one file was marked, and the older-first ordering for `ediff-files'.  Lift it into `cj/--ediff-pair-from-files' -- pure given the file list, an injected prompt thunk, and a newer-than-p comparator -- so tests stay independent of mtimes and the dired prompt.

While extracting, surface a latent bug: with zero marked files the original code fell through to `(file-newer-than-file-p nil nil)' and crashed with a wrong-type-argument error.  Replace the crash with a clear `user-error' ("No files marked"), and add a regression test.  The 3+ files case keeps its existing user-error message.

Five Normal/Boundary/Error tests cover both ordering directions, the one-file prompt path, and both error counts.
</content>
</entry>
</feed>
