逆引きxyzzy lisp(テキスト) - circleratio/xyzzy GitHub Wiki
(set-text-attribute 1 10 'attr1 :bold t)
=> t
(modify-text-attributes 'attr1 :foreground 1 :strike-out t :underline t)
=> t
list-text-attributes の結果は set-text-attributes に apply させることができる。
(list-text-attributes)
=> ((1 10 attr1 :foreground 1 :underline t :strike-out t))
(find-text-attribute-point 5)
=> 1
10
attr1
1
nil
nil
t
t
nil
nil
(delete-text-attributes 'attr1)
=> t
(delete-text-attribute-point 5)
=> nil
(clear-all-text-attributes)
=> t
(defun highlight-pattern (regexp color)
(interactive)
(delete-text-attributes 'all)
(goto-char (point-min))
(while (scan-buffer regexp :regexp t)
(let ((from (point))
(to (+ (point) (length (match-string 0)))))
(set-text-attribute from to 'all :foreground color :bold t))
(forward-char)))
(highlight-pattern ":[a-z]+" 4)