Re: How to add font-lock keywords

2021-12-23 Thread Daniel Fleischer
Bruno Barbier [2021-12-21 Tue 20:35] wrote: > The following works for me, in an org mode buffer: > > , > | (font-lock-add-keywords nil '(("books" . 'org-level-4)) t) > ` > No need to call font-lock-update or restart: any new or modified text > gets the new fontification. Thanks, it works

Re: How to add font-lock keywords

2021-12-21 Thread Bruno Barbier
Hi, Daniel Fleischer writes: > Hi, I want to add custom keywords to be highlighted. I used > (font-lock-add-keywords nil '(("books" . org-level-4)) t) > > but nothing happens after I restart orgmode or call 'font-lock-update'. The following works for me, in an org mode buffer: , | (f

How to add font-lock keywords

2021-12-11 Thread Daniel Fleischer
Hi, I want to add custom keywords to be highlighted. I used (font-lock-add-keywords nil '(("books" . org-level-4)) t) but nothing happens after I restart orgmode or call 'font-lock-update'. -- Daniel Fleischer

Re: [O] how to add font-lock keywords

2011-08-23 Thread Le Wang
Thanks for the hint, I tried this, but all my beautiful salad bowl colours went away. (font-lock-add-keywords 'org-mode '(("\"\\(\\(?:.\\|\n\\)*?[^\\]\\)\"" 0 font-lock-string-face))) Notice that I made a bad attempt to handle escaped quotation mark in the string. Does anyone know a better solut

Re: [O] how to add font-lock keywords

2011-08-23 Thread John Wiegley
> John Wiegley writes: > Le Wang writes: >> I wasn't able to google a clear examples of how to do this. For example, >> I'd like to highlight all text between double-quotes. > Typically it looks something like this: > (font-lock-add-keywords org-mode [...] Sorry, that should be 'or

Re: [O] how to add font-lock keywords

2011-08-23 Thread John Wiegley
> Le Wang writes: > I wasn't able to google a clear examples of how to do this. For example, > I'd like to highlight all text between double-quotes. Typically it looks something like this: (font-lock-add-keywords org-mode (list (list (concat "\\(\"[^\"]+\"\\)")

[O] how to add font-lock keywords

2011-08-23 Thread Le Wang
Hi all, I wasn't able to google a clear examples of how to do this. For example, I'd like to highlight all text between double-quotes. -- Le