diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 07:26:20 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 07:26:20 -0500 |
| commit | a7cc89482cc931f60d4b43d5c7b875542cbe2538 (patch) | |
| tree | 8f313e84bfcefd4ed4f83e36aa9c4e8b25c180db /modules/prog-training.el | |
| parent | 9135298c45f2f03ab92903edb242c8f5f94396d5 (diff) | |
| download | dotemacs-a7cc89482cc931f60d4b43d5c7b875542cbe2538.tar.gz dotemacs-a7cc89482cc931f60d4b43d5c7b875542cbe2538.zip | |
refactor(text-enclose): extract shared region-or-buffer bounds helper
The append/prepend/indent/dedent *-in-region-or-buffer commands each inlined the same (if (use-region-p) (region-beginning) (point-min)) / (region-end)/(point-max) block — four copies of the "operate on the region, else the whole buffer" contract. Extracted cj/--region-or-buffer-bounds as the single source of that decision and routed all four through it. Behavior is unchanged; the public-wrapper tests still pass.
This was the "extract a shared helper that decides the target range" option from the reconcile task. The sibling custom-ordering.el helpers (cj/--arrayify, cj/--unarrayify) already document an explicit (start end) contract accurately and are region-required by design, so they needed no docstring change — each pair now has one clear, consistent contract. Tests cover the helper for the region case, the no-region whole-buffer case, and an empty buffer.
Diffstat (limited to 'modules/prog-training.el')
0 files changed, 0 insertions, 0 deletions
