[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-line highlighting
From: |
Stefan Monnier |
Subject: |
Re: multi-line highlighting |
Date: |
Sun, 28 Feb 2021 11:00:41 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> I have in an org-mode file a need to color the face of the string
> between 'Alpha:' and a period. To achieve this I have
>
> #+begin_src elisp
> (add-hook 'org-mode-hook (lambda ()
> (font-lock-add-keywords nil
> '(("\\(Alpha:\\)\\([^\n\r\t]+\\)\\(.\\)"
^^^
This is not the regexp for a "period".
Also this regexp will clearly not match multiple lines since you
explicitly exclude \n from the matched chars.
> as a local variable, but to no avail. I have searched online, but all
> the examples I've found are based on adding keywords, which is not what
> I want. I'm probably overlooking something simple.
Have you looked at the ELisp reference manual that comes with your Emacs?
It has a section called "Font Lock Multiline".
Stefan