- CI: package-lint + checkdoc job, ASan/UBSan fuzz job (make DEBUG=1), macOS dylib build + full suite, Emacs snapshot (advisory) - readme: installation section, new commands and editor-integration behavior, JIS kinsoku option, HYPHENMIN note, refreshed perf table - add CHANGELOG.md and CONTRIBUTING.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4.3 KiB
4.3 KiB
Changelog
All notable changes to emacs-kp are documented here. The format follows Keep a Changelog, and the project aims to follow Semantic Versioning.
[Unreleased]
Editor integration
- Saving an auto-justified buffer now writes the logical text to disk; soft line breaks, glue spaces and break hyphens are layout, not content, and no longer reach the file.
isearchsearches the logical text, so CJK phrases and hyphenated words are found across the justified layout.- Copying/killing puts the logical text on the kill ring (via a
buffer-local
filter-buffer-substring-function). - Justification no longer flips
buffer-modified-pon an unmodified buffer — no stray lock files or auto-saves — and re-flow no longer fightsundo. - Text typed adjacent to synthesized glue/hyphens no longer inherits
the marker properties (
rear-nonsticky), so it is never mistaken for layout and deleted on the next re-flow. - Switching major mode or turning the minor mode off restores the logical text cleanly, widening first so narrowing leaves no justified orphans.
- Paragraphs containing
field/read-onlytext (comint prompts) are left verbatim.
New commands and options
ekp-justify-buffer/ekp-unjustify-buffer.ekp-justify-region/ekp-unjustify-regionact on the paragraph at point when no region is active (DWIM).ekp-org-setup/ekp-markdown-setupwire the verbatim-protection presets in one call;ekp-auto-justify-modeapplies the matching one automatically in Org/Markdown buffers.fill-paragraphis remapped toekp-refill-paragraphwhile the mode is on.- User options are now
defcustoms under theekp/ekp-regiongroups. ekp-cjk-no-line-start-extra: Japanese line-start prohibition for small kana, the prolonged sound mark and iteration marks (JIS X 4051).ekp-auto-justify-tick-budget: time budget per background re-flow tick.
Typography
- First-line indent (
ekp-first-line-indent) now runs on the fast 1D dynamic program and the C engine, instead of the heavy 2D path. - Dictionary
LEFTHYPHENMIN/RIGHTHYPHENMINare honored (English now keeps ≥2 before and ≥3 after a break, per its dictionary).
Performance
- Session-global box-width cache eliminates cross-paragraph duplicate
measurement (≈40% of
string-pixel-widthcalls on the Chinese sample); byte-compiled justify of that sample dropped ~40%. - Cache keys ignore volatile
fontifiedbookkeeping, restoring the paragraph-cache hit rate in font-locked buffers. - Large-buffer re-flow: huge edits chunk in the background, scrolled regions get priority, background ticks honor a time budget.
Fixed
- The DP cache no longer returns a stale layout after
ekp-loosenesschanges (results are keyed by looseness). - Changing a style variable (
ekp-alignment, …) invalidates the same-string fast path. - Missing
dictionaries/directory only disables hyphenation instead of breaking(require 'ekp).
C module (1.4 → 1.5)
- Breaking: the unused experimental C tokenization path
(
ekp-c-break-lines,ekp-c-hyphenate,ekp-c-load-hyphenator,ekp-c-set-spacing, and theekp_paragraph.c/ekp_hyphen.csources) is removed. It carried a heap overflow reachable from Lisp. Rebuild withmake -C ekp_c clean all. ekp-c-break-with-arraysgains a 15th argument,FIRST-LINE-WIDTH, supporting first-line indent in C.- Thread pool sized to the machine's cores, created lazily; a full queue blocks instead of dropping tasks.
- Allocation failures and bad arguments fail the call cleanly (Elisp fallback) instead of silently producing a different layout; extracted integers are clamped to int32.
Packaging
- Added
COPYING(GPL-3.0-or-later) and license headers to all sources; real author/maintainer metadata. - Autoload cookies on all interactive commands.
- Removed internal working files and an unused demo GIF from the repo.
Historical
Earlier work (the core KP overhaul and the P1/P2 typography wave — optimal line breaking, CJK kinsoku, hyphenation, pixel-exact justification, alignment modes, hanging punctuation, parshape, no-break atoms, verbatim protection, the C module) predates this changelog; see the git history.