I am writing a minor mode to complement haskell-mode, and I am trying to color subwords in camelCased identifiers with slightly different shades of the same color.

Perhaps this can be done by "recoloring" identifiers, that is, running a hook which redefines the font-locking after the major mode does its work.

But I have no idea how this can be achieved.

Any ideas or references are very welcome!

Edit: @phil's suggestion is working for me, so in the interest of saving time, I am leaving the minor-mode project on hold for now.

  • 1
    Not a solution, but does glasses-mode work in haskell-mode? If so, that may provide some insight into targeting camelCase words.
    – phils
    Oct 22, 2019 at 4:14
  • Indeed! Good enough for now (using Letter Low Vertical Line Unicode Character U+02CC as the separator).
    – Tássio
    Oct 22, 2019 at 18:51


Your Answer

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

Browse other questions tagged or ask your own question.