Created
September 23, 2013 19:58
-
-
Save jiyoo/6676050 to your computer and use it in GitHub Desktop.
word boundary font lock test
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
;;; Example 4 | |
'(wxyz xy xy-xy end) | |
'(aabb ab ab-ab end) | |
(progn | |
(font-lock-add-keywords | |
nil | |
`(("\\bxy\\b" | |
(0 'success t)) | |
("\\<ab\\>" | |
(0 'success t)) | |
"end") | |
'set) | |
(font-lock-fontify-buffer) | |
(global-set-key (kbd "<f9>") 'describe-text-properties) | |
(global-set-key (kbd "<f10>") | |
(lambda () (interactive) | |
(describe-variable 'font-lock-keywords)))) | |
;; value of font-lock-keywords in emacs-lisp-mode buffer: | |
'(t | |
(("\\bxy\\b" | |
(0 'success t)) | |
("\\<ab\\>" | |
(0 'success t)) | |
"end") | |
("\\bxy\\b" | |
(0 'success t)) | |
("\\<ab\\>" | |
(0 'success t)) | |
("end" | |
(0 font-lock-keyword-face)) | |
("^\\s(" | |
(0 | |
(if | |
(memq | |
(get-text-property | |
(match-beginning 0) | |
'face) | |
'(font-lock-string-face font-lock-doc-face font-lock-comment-face)) | |
(list 'face font-lock-warning-face 'help-echo "Looks like a toplevel defun: escape the parenthesis")) | |
prepend))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment