New answers tagged

0

Try this: (font-lock-add-keywords 'org-mode '(("^rtfm .*$" 0 '(:foreground "red")))) (font-lock-add-keywords 'org-mode '(("'.*'" 0 '(:background "OrangeRed") 'keep))) See the Elisp manual, node Search-based Fontification - look for keep: (MATCHER . SUBEXP-HIGHLIGHTER) In this kind of element, SUBEXP-HIGHLIGHTER ...


0

It looks like you want to only specify the regexp and the string, so just write a little function to add all the rest. (defun myfun (regexp str) `(,regexp (1 (progn (compose-region (match-beginning 1) (match-end 1) ,str) nil)))) Then you can use it in your expression: (font-lock-add-keywords 'org-mode `(,(myfun "^\...


Top 50 recent answers are included