This commit is contained in:
Kinneyzhang 2026-01-05 17:43:34 +08:00
parent 63b58c6cf5
commit ec1619e047

18
tp.el
View File

@ -968,14 +968,16 @@ NEW-OBJECT is the new string object (only different for strings with tp-text)."
((stringp tp-text-val) ((stringp tp-text-val)
;; Apply transform if layer has one registered ;; Apply transform if layer has one registered
(let* ((layer-name (plist-get props 'tp-name)) (let* ((layer-name (plist-get props 'tp-name))
(transform-fn (when layer-name (cdr (assoc layer-name tp-layer-transforms)))) (transform-fn (when layer-name
(final-text (if transform-fn (cdr (assoc layer-name tp-layer-transforms))))
(condition-case err (final-text
(funcall transform-fn tp-text-val) (if transform-fn
(error (condition-case err
(message "tp: transform error for %s: %s" layer-name err) (funcall transform-fn tp-text-val)
tp-text-val)) (error
tp-text-val))) (message "tp: transform error for %s: %s" layer-name err)
tp-text-val))
tp-text-val)))
(if (stringp object) (if (stringp object)
;; For strings: create a new string with tp-text content ;; For strings: create a new string with tp-text content
;; The new string replaces the original, with props applied ;; The new string replaces the original, with props applied