Skip to content

Add new text-inserter with transform-hook and -context#127

Merged
lordnik22 merged 1 commit intomasterfrom
106-add-transform-hooks
Mar 13, 2026
Merged

Add new text-inserter with transform-hook and -context#127
lordnik22 merged 1 commit intomasterfrom
106-add-transform-hooks

Conversation

@lordnik22
Copy link
Copy Markdown
Collaborator

@lordnik22 lordnik22 commented Mar 11, 2026

Fixes #106
Fixes #86

@lordnik22 lordnik22 force-pushed the 106-add-transform-hooks branch 8 times, most recently from 929df9d to fda99b9 Compare March 13, 2026 16:20
@lordnik22 lordnik22 marked this pull request as ready for review March 13, 2026 16:27
The new functions don't just pick text or bounds but rather insert
text and prepare the buffer to a final state. Making the text useable
for a speed-type session. No call to (buffer-string) is needed expect
when preparing a string.

Introduce an initial version of speed-type-transform-context to be
used by transform-hook. From this context various rules can be
defined, when to apply a function-hook.

Add text-type and repsective insert-functions:
+ transform-text => speed-type-insert-text
+ random-wordlist => speed-type-insert-wordlist
+ continue-text-section, random-text-section => speed-type-insert-text-section
+ quote => speed-type-insert-quote

Migrate existing tranformation-functions to transform-hook:
+ downcase
+ replace-strings
+ fill-region
+ filter-stop-words
+ trimming
+ delete-trailing-whitespace

Migrate speed-type--setup-calls to use quadruple instead of text:
content-buffer, start, end, text-type

Handle empty buffer case on speed-type--setup

Add new transformation-functions:
+ replace-regex-hook
+ left-align

Refactoring:
+ Rename speed-type--replace-map-adjust-properties to
  speed-type--forward-replace-map-adjust-properties and remove
  save-excursion and don't go to (point-min).

Documentation:
+ New Chapter: Text-Inserter / Text-Picker

Tests:
+ Adjust string-trim-test to use buffer
+ Add minimal and error cases for speed-type-prepare-buffer
+ Add for each text-type a default and transform empty case
+ Add edge case provoking endless loop in insert-wordlist
+ Add test and handle "random 0" in insert-wordlist

Package:
+ Increment version
@lordnik22 lordnik22 force-pushed the 106-add-transform-hooks branch from fda99b9 to 9d63d9f Compare March 13, 2026 16:36
@lordnik22 lordnik22 merged commit 0e22fe4 into master Mar 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redesign speed-type-wordlist-transform to be used for all-commands Issues with whitespace in typing-session

1 participant