1

I'm using org-mode to write a novel and I would like to have any text between "quotes" to be a different color, just to be able to easily see when a character is talking.

Also, if I could have a list of names (in document) that are character names, and have those names highlighted too that would be awesome. Bonus if I can click them to go to a (in document) description of them.

1

You can use the font-lock-add-keywords function to add keywords to any face you like, in any mode. In fact, the keywords are regular expressions, so quotes are also possible:

(font-lock-add-keywords 'org-mode '(
  ("Herbert" 'org-warning)
  ("Caesar" 'org-warning)
  ("\"[^\"]*\"" . 'org-ellipsis)
  ("«[^»]*»" . 'org-ellipsis)
))

Multi-line quotes may behave somewhat strange, though, especially the non-paired quotes (" and '), as opposed to paired ones (e.g. «guillemots»).

To find suitable faces for your keywords, you can use M-x customize-faces.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.