<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gustaf Waldemarson (Posts about printf)</title><link>https://gustafwaldemarson.com/</link><description></description><atom:link href="https://gustafwaldemarson.com/tags/printf.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:gustaf.waldemarson@gmail.com"&gt;Gustaf Waldemarson&lt;/a&gt; </copyright><lastBuildDate>Sun, 11 May 2025 14:49:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Updated Format Specifier Highlighting in Emacs</title><link>https://gustafwaldemarson.com/posts/updated-format-specifier-highlighting-in-emacs/</link><dc:creator>Gustaf Waldemarson</dc:creator><description>&lt;div&gt;&lt;p&gt;
What feels like ages ago now, I wrote a short &lt;a href="/posts/printf-format-highlighting-in-emacs"&gt;post&lt;/a&gt; about improving the syntax
highlighting of format specifiers for &lt;code&gt;printf&lt;/code&gt; 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.
&lt;/p&gt;

&lt;p&gt;
The first item on the agenda however, is to make the original regexp,
&lt;i&gt;manageable&lt;/i&gt;. When we finished things up, we were left with the following:
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gustafwaldemarson.com/posts/updated-format-specifier-highlighting-in-emacs/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>elisp</category><category>emacs</category><category>printf</category><category>regexp</category><category>rx</category><guid>https://gustafwaldemarson.com/posts/updated-format-specifier-highlighting-in-emacs/</guid><pubDate>Sun, 18 Aug 2024 10:09:42 GMT</pubDate></item><item><title>Printf Format Highlighting</title><link>https://gustafwaldemarson.com/posts/printf-format-highlighting-in-emacs/</link><dc:creator>Gustaf Waldemarson</dc:creator><description>&lt;div&gt;&lt;p&gt;
Most of my work is done in either &lt;code&gt;C&lt;/code&gt; or &lt;code&gt;C++&lt;/code&gt;, so I frequently use the &lt;code&gt;printf&lt;/code&gt;
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 &lt;code&gt;elisp&lt;/code&gt; code to
achieve that:
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gustafwaldemarson.com/posts/printf-format-highlighting-in-emacs/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>elisp</category><category>emacs</category><category>printf</category><category>regexp</category><guid>https://gustafwaldemarson.com/posts/printf-format-highlighting-in-emacs/</guid><pubDate>Mon, 27 Feb 2017 08:24:55 GMT</pubDate></item></channel></rss>