Created
July 14, 2021 21:01
-
-
Save anton0xf/d73c2d7c535b19a160243bf0e430f31a to your computer and use it in GitHub Desktop.
This file contains 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 test2.el | |
(setq line "asdf qwer") | |
(add-face-text-property 0 4 'a t line) | |
(add-face-text-property 0 5 'b t line) | |
(print line) | |
;; #("asdf qwer" 0 4 (face (a b)) 4 5 (face b)) | |
(setq word (substring line 0 4)) | |
(print (eq (cadr (text-properties-at 0 line)) | |
(cadr (text-properties-at 0 word)))) | |
;; t | |
(setq word1 (concat word "_")) | |
(print (eq (cadr (text-properties-at 0 line)) | |
(cadr (text-properties-at 0 word1)))) | |
;; t | |
(add-face-text-property 0 2 'c t word1) | |
(print (eq (cadr (text-properties-at 0 line)) | |
(cadr (text-properties-at 0 word1)))) | |
;; t | |
(print line) | |
;; #("asdf qwer" 0 4 (face (a b c)) 4 5 (face b)) | |
(add-face-text-property 0 4 'd t word) | |
(print line) | |
;; #("asdf qwer" 0 4 (face (a b c 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