Making CamelCase Readable with Glasses-Mode
If you’re working on a codebase that makes use of CamelCase identifiers
evenWorseLikeThisAbstractFactoryFactory you can make them readable by splitting up the words with
glasses-mode will insert a virtual underscore separator between the conjoined words, so
fooBarBaz will look like
The changes are not permanent and Emacs will keep track of the virtual separators and ensure they are never accidentally saved to disk.
glasses-mode is enabled, you should continue following the CamelCase style as Emacs will automagically insert the virtual separator, as needed, when you type a capitalized character.
There’s a handful of configurable options you can tweak to personalize
glasses-mode. To access them, type
M-x customize-group RET glasses.