diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..5f0fc19 --- /dev/null +++ b/readme.md @@ -0,0 +1,21 @@ +### text properties layer +- tp-layer-set (name start end &optional object) +- tp-layer-push (name start end properties &optional object) +- tp-layer-delete (name start end &optional object) +- tp-layer-rotate (start end &optional object) +- tp-layer-pin (name start end &optional object) +- tp-layer-define (name properties) +- tp-layer-group-define (name &rest layers) + +### text properties propertize +- tp-propertize (string properties &optional layer) +- tp-layer-propertize (string layer) +- tp-layer-group-propertize (string layer-group) + +### text properties search +- tp-forward (property &optional value predicate not-current) +- tp-backward (property &optional value predicate not-current) +- tp-forward-do (function property &optional value predicate not-current) +- tp-backward-do (function property &optional value predicate not-current) +- tp-regions-map (function property &optional value predicate collect) +- tp-strings-map (function property &optional value predicate collect) diff --git a/tp.el b/tp.el index 6f4333d..1c7c1aa 100644 --- a/tp.el +++ b/tp.el @@ -254,8 +254,8 @@ function 的四个参数分别为:区间开始位置,区间结束位置,顶 (value (prop-match-value match))) (funcall function start end value))) -(defun tp-regions-map - (function property &optional value predicate collect) +(defun tp-regions-map (function property &optional + value predicate collect) "对属性匹配的开头和结尾 point 执行 function。collect 为 t 时返回结果列表" (save-excursion (goto-char (point-min)) @@ -268,8 +268,8 @@ function 的四个参数分别为:区间开始位置,区间结束位置,顶 (cl-incf idx 1)) (nreverse lst)))) -(defun tp-strings-map - (function property &optional value predicate collect) +(defun tp-strings-map (function property &optional + value predicate collect) "对属性匹配的字符串执行 function" (tp-regions-map (lambda (start end idx)