Posts about printf

Updated Format Specifier Highlighting in Emacs

What feels like ages ago now, I wrote a short post about improving the syntax highlighting of format specifiers for printf style functions (actually, all strings). While it has worked great for a long time, it is about time to give it a bit of a face-lift and at the same time make it even more general.

The first item on the agenda however, is to make the original regexp, manageable. When we finished things up, we were left with the following:

Read more…

Printf Format Highlighting

Most of my work is done in either C or C++, so I frequently use the printf family of functions to write a wide variety of stuff to the display. Naturally, I'd like the format specifiers to stand out from the rest of the characters in the strings, so for the longest time I used this piece of elisp code to achieve that:

Read more…