<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="/assets/rss.xsl" type="text/xsl"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"

>
<channel>
	<title>Sacha Chua - tag - tweak</title>
	<atom:link href="https://sachachua.com/blog/tag/tweak/feed/index.xml" rel="self" type="application/rss+xml" />
	<atom:link href="https://sachachua.com/blog/tag/tweak" rel="alternate" type="text/html" />
	<link>https://sachachua.com/blog/tag/tweak/feed/index.xml</link>
	<description>Emacs, sketches, and life</description>
  
	<lastBuildDate>Mon, 06 Jul 2026 16:20:27 GMT</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>daily</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>11ty</generator>
  <item>
		<title>Emacs tweaks: Export Org checkboxes using UTF-8 symbols</title>
		<link>https://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/</link>
		<dc:creator><![CDATA[Sacha Chua]]></dc:creator>
		<pubDate>Thu, 27 Mar 2014 12:00:32 GMT</pubDate>
    <category>emacs</category>
<category>org</category>
<category>tips</category>
		<guid isPermaLink="false">https://sachachua.com/blog/?p=27119</guid>
		<description><![CDATA[<div class="update">UPDATE 2014-03-28: Newer versions of org have the <code>org-html-checkbox-type</code> variable, which you can set to <code>unicode</code>. Use <kbd>M-x customize-variable org-html-checkbox-type</kbd> to see if you have it.</div>
<p>This snippet turns <code>- [X]</code> into ☑ and <code>- [ ]</code> into ☐.</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">(<span class="org-keyword">defun</span> <span class="org-function-name">sacha/org-html-checkbox</span> (checkbox)
  <span class="org-doc">"Format CHECKBOX into HTML."</span>
  (<span class="org-keyword">case</span> checkbox (on <span class="org-string">"&lt;span class=\"check\"&gt;&amp;#x2611;&lt;/span&gt;"</span>) <span class="org-comment-delimiter">; </span><span class="org-comment">checkbox (checked)</span>
        (off <span class="org-string">"&lt;span class=\"checkbox\"&gt;&amp;#x2610;&lt;/span&gt;"</span>)
        (trans <span class="org-string">"&lt;code&gt;[-]&lt;/code&gt;"</span>)
        (t <span class="org-string">""</span>)))
(<span class="org-keyword">defadvice</span> <span class="org-function-name">org-html-checkbox</span> (around sacha activate)
  (setq ad-return-value (sacha/org-html-checkbox (ad-get-arg 0))))</pre>
</div>
<p>To find this code, I searched <code>ox-html.el</code> for <code>[</code>. Eventually I found <code>org-html-checkbox</code>, which is directly called by <code>org-html-format-list-item</code> instead of being a function variable that you can change. So that meant I needed to override the behaviour of <code>org-html-checkbox</code> through <code>defadvice</code>. You can see above how I wrap advice around <code>org-html-checkbox</code> and replace the return value with my own function. For more about advice, read the Emacs Lisp Intro manual.</p>
<p>To find the hex codes for the UTF-8 characters, I searched Google for <a href="https://www.google.ca/search?q=utf8+checkbox+check">UTF-8 checkbox</a> and found <a href="http://www.fileformat.info/info/unicode/char/2611/index.htm">BALLOT BOX WITH CHECK</a>. I used the hex code so that I didn't have to worry about encoding issues. I tested it by updating one of my weekly reviews. Tada!</p>
<p>Inspired by Grant from <a href="http://www.wisdomandwonder.com/article/8284/creation-and-conservation-of-computer-files-c3f/comment-page-1#comment-1086101">Wisdom and Wonder</a>.</p>

<p>You can <a href="https://sachachua.com/blog/2014/03/emacs-tweaks-export-org-checkboxes-using-utf-8-symbols/#comment">view 7 comments</a> or <a href="mailto:sacha@sachachua.com?subject=Comment%20on%20https%3A%2F%2Fsachachua.com%2Fblog%2F2014%2F03%2Femacs-tweaks-export-org-checkboxes-using-utf-8-symbols%2F&body=Name%20you%20want%20to%20be%20credited%20by%20(if%20any)%3A%20%0AMessage%3A%20%0ACan%20I%20share%20your%20comment%20so%20other%20people%20can%20learn%20from%20it%3F%20Yes%2FNo%0A">e-mail me at sacha@sachachua.com</a>.</p>]]></description>
		</item>
	</channel>
</rss>