Commit Graph

192 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
35d570f021 Update tp-forward-do, tp-backward-do with point parameter and extend tp-at
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 10:33:39 +00:00
copilot-swe-agent[bot]
2128f78509 Fix tp-search-map to properly copy text properties for strings
store-substring only copies text content, not properties.
Added explicit property copying after store-substring to ensure
both text content and property modifications are applied.

Also updated tp-forward-do and tp-backward-do with the same fix.
Added test for property modification via tp-search-map.

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 09:42:11 +00:00
copilot-swe-agent[bot]
798c88e559 Add documentation for string replacement length limitation
Documented that for string objects, the replacement text must have the
same length as the original matched text due to store-substring limitations.

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 09:03:15 +00:00
copilot-swe-agent[bot]
0b0bfedc6b Refactor tp-forward/backward and tp-search-do API
- tp-forward and tp-backward now support string objects
- Renamed tp-forward-do to tp--forward-do (private) with string support
- Renamed tp-backward-do to tp--backward-do (private) with string support
- New public tp-forward-do and tp-backward-do: function receives matched text only
- Renamed tp-search-do to tp--search-do (private)
- New public tp-search-map: function receives matched text only
- Updated English and Chinese documentation
- Updated and added tests for all new functionality

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 09:00:13 +00:00
Kinneyzhang
a41ad171a0 format 2025-12-15 16:20:51 +08:00
copilot-swe-agent[bot]
bca7d4a41c Reorganize tp.el code to match API Quick Reference order
Functions are now organized in the following order:
1. Core Property Functions: tp-set, tp-reset, tp-add, tp-set-face, tp-set-display, tp-get, tp-at, tp-remove, tp-clear
2. Pattern Matching Functions: tp-match, tp-match-reset, tp-match-add, tp-regexp, tp-regexp-reset, tp-regexp-add
3. Search & Navigation Functions: tp-search-forward, tp-search-backward, tp-forward, tp-backward, tp-forward-do, tp-backward-do, tp-search, tp-search-do
4. Query Functions: tp-intervals, tp-empty-p, tp-plist
5. Layer Definition Functions: tp-define-layer, tp-layer-props, tp-group-props, tp-layer-undefine, tp-group-undefine, tp-layer-reset
6. Layer Placement Functions: tp-put-layer, tp-push-layer
7. Layer Deletion Functions: tp-delete-layer, tp-pop-layer
8. Layer Movement Functions: tp-raise-layer, tp-rotate-layer, tp-pin-layer, tp-switch-layer
9. Layer Merging Functions: tp-merge-layers, tp-flatten-layers
10. Layer Query Functions: tp-layer-list, tp-layer-count, tp-layer-exists-p, tp-layer-top

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 08:08:59 +00:00
copilot-swe-agent[bot]
ad6ec58305 Fix code review issues: use with-current-buffer, fix documentation, improve property detection
- Use with-current-buffer instead of set-buffer in tp-forward and tp-backward
- Fix tp-search documentation to correctly describe return type as list of (START END VALUE)
- Improve property detection in tp-search to handle falsy property values (0, nil, empty string)

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 07:38:20 +00:00
copilot-swe-agent[bot]
11e6201bc1 Implement new text property search and navigation functions
- Modified tp-empty-p to support optional OBJECT parameter (nil = current buffer)
- Modified tp-plist to support two formats: (tp-plist start end &optional OBJECT) and (tp-plist string)
- Added tp-forward and tp-backward with new API (property &optional value object n)
- Added tp-forward-do and tp-backward-do for applying functions to matches
- Added tp-search for searching all matching properties in range or string
- Added tp-search-do for executing function on all matches
- Updated documentation (README.md and README_CN.md)
- Updated test cases (tp-tests.el)
- Removed obsolete function references (tp-next, tp-prev, tp-goto-next, tp-goto-prev, tp-in, tp-all, tp-regions-map, tp-strings-map)

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 07:35:41 +00:00
Kinneyzhang
7357ac120f delete unused code 2025-12-15 15:24:08 +08:00
Kinneyzhang
d748534bd9 delete unused code 2025-12-15 12:00:34 +08:00
Kinneyzhang
6bcc0b5c8d delete unused code 2025-12-15 11:07:49 +08:00
copilot-swe-agent[bot]
9ed2aafe23 Address code review feedback: clarify private function comment
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 02:56:24 +00:00
copilot-swe-agent[bot]
62b5e47548 Remove internal APIs from public interface, delete tp-remove-list, fix tp-remove nested sub-property bug, add links in API Quick Reference
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-15 02:53:58 +00:00
Kinneyzhang
02d1875330 update test and readme 2025-12-15 00:44:50 +08:00
copilot-swe-agent[bot]
f02a3d6ace Address code review: add seq require and improve nil checks
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 16:24:36 +00:00
copilot-swe-agent[bot]
808fa94214 Refactor tp layer API to new specification, remove old API
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 16:17:29 +00:00
copilot-swe-agent[bot]
dbd790d0fd Start implementing new layer API, removing old compatibility
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 16:06:57 +00:00
copilot-swe-agent[bot]
52999a2807 Fix tp--get-nested to handle face values with symbol prefix like (shadow :foreground ...)
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 15:37:47 +00:00
copilot-swe-agent[bot]
85c8c5365b Remove unnecessary reverse in multiple key extraction
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 15:27:35 +00:00
copilot-swe-agent[bot]
3f7f8cd9b9 Add support for deeply nested sub-properties and multiple key extraction in tp-get
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 15:25:53 +00:00
copilot-swe-agent[bot]
b31077e486 Fix tp-get to return intervals for entire strings and support property path lists
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 15:15:12 +00:00
copilot-swe-agent[bot]
932585da3f Fix tp-get to return intervals and tp-match/tp-regexp string parsing
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 13:50:45 +00:00
copilot-swe-agent[bot]
13b73b1dbc Address code review feedback: improve docstrings and comments
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 13:09:52 +00:00
copilot-swe-agent[bot]
5994ce3a2a Fix tp-add face prepending, tp-remove and tp-get string support, update docs
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 13:06:08 +00:00
copilot-swe-agent[bot]
39c1c6333b Refactor: Extract helper functions to reduce code duplication in match/regexp functions and single-property setters
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 11:42:07 +00:00
copilot-swe-agent[bot]
58daa712db Implement new tp.el API: tp-reset, tp-set, tp-set-face, tp-set-display, tp-add, tp-match-reset, tp-match-add, tp-regexp-reset, tp-regexp-add, enhanced tp-get and tp-remove with nested sub-property support
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-14 11:37:42 +00:00
copilot-swe-agent[bot]
243904f490 Improve tp-put parameter naming for clarity
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-13 10:04:41 +00:00
copilot-swe-agent[bot]
c285fb20eb Add enhanced tp-get with range support and fine-grained property functions
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-13 10:02:54 +00:00
copilot-swe-agent[bot]
2fce83315b Update tp-put API and tests to new format
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-13 09:59:27 +00:00
copilot-swe-agent[bot]
519a5ec42f Improve zero-width match handling in tp-match and tp-regexp
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-12 03:39:26 +00:00
copilot-swe-agent[bot]
a34c1ee625 Fix code review issues: infinite loop prevention and consistent return values
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-12 03:37:30 +00:00
copilot-swe-agent[bot]
73f65e294b Optimize function naming and add object parameter support
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-12 03:34:13 +00:00
copilot-swe-agent[bot]
99f50d4fee Shorten function names for clarity: tp-group-* and tp-layer-props
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-11 03:16:09 +00:00
copilot-swe-agent[bot]
7614916aca Update Emacs version requirement to 28.1+ for object-intervals support
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-11 02:45:55 +00:00
copilot-swe-agent[bot]
d1428a0748 Optimize and extend tp.el with layer system and text property functions
Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
2025-12-11 02:42:53 +00:00
Kinneyzhang
cea0e3b6b3 update 2025-10-23 01:29:04 +08:00
Kinneyzhang
d4efd44aa0 update 2025-10-16 12:56:13 +08:00
Kinneyzhang
48e9eb9c01 update 2025-10-16 00:01:52 +08:00
Kinneyzhang
7dbdc89541 update 2025-10-13 20:58:11 +08:00
Kinneyzhang
b23967c359 add readme 2025-10-13 13:02:54 +08:00
Kinneyzhang
bfc007e5d3 add search functions 2025-10-13 12:57:47 +08:00
Kinneyzhang
9fd5ba552f first commit 2025-10-13 00:15:18 +08:00