Following my previous question on making custom highlight rules here: Color-code a new generic character combination , I have stumbled on a new issue, that possibly merits another question.
I have a group of three rules that I would like to apply (code below). The first one works, the other two (also when alone) seem to break down something in coloring. Under each Org-mode heading, where these particular instances are found, the headline and its subheadings lose coloring. The instances themselves are not highlighted in any way.
The regular expressions are tested with the inbuilt regexp-builder. Example instances would be:
_Theorem 1:
(Author & Author, 2012)
Comment:
While for the first rule, the system seems to work, for the other two rules, it instead breaks down the heading coloring.
(add-hook 'org-mode-hook
(lambda ()
(font-lock-add-keywords nil
'((
"\\(^\\|\\s-+\\)\\(_\\([a-zA-Z0-9]+\\s-?\\)\\{0,4\\}:\\)" 2
font-lock-type-face t)))
(font-lock-add-keywords nil
'((
"(\\w+\\(\\s-&\\s-\\w+\\)?,\\s-[0-9]\\{4\\})" 2
font-lock-string-face t)))
(font-lock-add-keywords nil
'((
"^\\w+:" 2
font-lock-constant-face t)))
))
Unfortunately I am new enough to Emacs that I don't know where exactly the problem should lie. Many thanks if you can point it out, or provide some advice.