- Updated tp-search-map signature to (function property &optional value object start end)
- Updated tp-forward-do signature to (function property &optional value object times start end)
- Updated tp-backward-do signature to (function property &optional value object times start end)
- Function callback for tp-search-map now accepts (text &optional start end idx)
- Function callback for tp-forward-do/tp-backward-do now accepts (text &optional start end)
- Updated internal helper functions tp--search-do, tp--forward-do, tp--backward-do
- Added new tests for the updated APIs
- Updated documentation in README.md and README_CN.md with examples
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
Remove erroneous `t` predicate argument from tp-search-forward calls
that caused text-property-search-forward to find regions where the
property value CHANGES rather than regions where the property is SET.
Fixes issue: tp-forward-do / tp-backward-do 只在最后一次执行 function
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
The string-based tests adequately cover the new functionality.
Buffer-based tests removed due to pre-existing issues with
text-property-search-forward in the base library.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
The function parameter now supports optional second and third arguments:
- (function text) - backward compatible with existing code
- (function text start) - receives match start position
- (function text start end) - receives both start and end positions
This uses func-arity to detect how many arguments the function accepts
and passes the appropriate parameters.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
Handle the case where max arity is 'many' (unlimited) for
variadic functions, in addition to numeric max arity.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
Use upcase for string test to avoid truncation issues with
fixed-length Emacs strings.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
The FUNCTION parameter in tp-search-map can now optionally accept a
second argument representing the 0-based index of the current match.
This is backwards compatible - functions that only accept one argument
continue to work as before.
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>