Last active
July 15, 2021 07:04
-
-
Save anton0xf/062ec656e66c88b5240dfb332ead82e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; run it by command | |
;; $ emacs -Q --script test-add-face-text-property.el | |
(setq line "asdf qwer") | |
(add-face-text-property 0 4 'a t line) | |
(add-face-text-property 0 4 'a t line) | |
(print line) | |
;; #("asdf qwer" 0 4 (face a)) | |
(add-face-text-property 0 5 'b t line) | |
(add-face-text-property 0 5 'b t line) | |
(add-face-text-property 0 5 'b t line) | |
(print line) | |
;; #("asdf qwer" 0 4 (face (a b b b)) 4 5 (face b)) | |
(setq word (substring line 0 4)) | |
(print word) | |
;; #("asdf" 0 4 (face (a b b b))) | |
(add-face-text-property 0 1 'c t word) | |
(add-face-text-property 0 2 'd t word) | |
(print word) | |
;; #("asdf" 0 1 (face (a b b b c d d)) 1 2 (face (a b b b c d d)) 2 4 (face (a b b b c d d))) | |
(print line) | |
;; #("asdf qwer" 0 4 (face (a b b b c d d)) 4 5 (face b)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example for cpitclaudel/company-coq#252
Tested on emacs 26.3