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
is a list which
specifies how to highlight matches found by MATCHER
. It has the
form:
(SUBEXP FACESPEC [OVERRIDE [LAXMATCH]])
The CAR
, SUBEXP
, is an integer specifying which subexpression of
the match to fontify (0
means the entire matching text). The
second subelement, FACESPEC
, is an expression whose value specifies
the face, as described above.
The last two values in SUBEXP-HIGHLIGHTER
, OVERRIDE
and LAXMATCH
,
are optional flags. If OVERRIDE
is t
, this element can override
existing fontification made by previous elements of
font-lock-keywords
. If it is keep
, then each character is
fontified if it has not been fontified already by some other
element. If it is prepend
, the face specified by FACESPEC
is
added to the beginning of the font-lock-face
property. If it is
append
, the face is added to the end of the font-lock-face
property.
If you want both faces used for the text that both regexps match then use prepend
or append
instead of keep
. That will combine the OrangeRed background with the Red foreground. (It's not clear from your question just what behavior you really want.)