<?xml version="1.0" encoding="UTF-8"?>
<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>n8blog &#187; QLColorCode</title>
	<atom:link href="http://www.n8gray.org/blog/category/projects/qlcolorcode/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.n8gray.org</link>
	<description>distraction in action</description>
	<lastBuildDate>Thu, 01 Jul 2010 18:21:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Brush-off via Bug Report</title>
		<link>http://www.n8gray.org/blog/2009/09/24/brush-off-via-bug-report/</link>
		<comments>http://www.n8gray.org/blog/2009/09/24/brush-off-via-bug-report/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 17:20:49 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/?p=182</guid>
		<description><![CDATA[As QLColorCode fans are aware, Snow Leopard&#8217;s version of Xcode has caused some trouble for me.  To wit, Xcode 3.2 shipped a Quick Look plugin that registered for the public.source-code uniform type identifier1 (UTI), which is the primary UTI that QLCC registers for so it can do it&#8217;s magic.  In the world of [...]]]></description>
			<content:encoded><![CDATA[<p>As <span class="caps">QLC</span>olorCode fans are aware, <a href="http://www.n8gray.org/blog/2009/09/16/qlcolorcode-20-and-snow-leopard-woes/">Snow Leopard&#8217;s version of Xcode has caused some trouble for me</a>.  To wit, Xcode 3.2 shipped a Quick Look plugin that registered for the public.source-code uniform type identifier<sup class="footnote"><a href="#fn1">1</a></sup> (UTI), which is the primary <span class="caps">UTI </span>that <span class="caps">QLCC </span>registers for so it can do it&#8217;s magic.  In the world of applications it&#8217;s possible to bring up the Finder&#8217;s Get Info dialog on a file of a given type and assign it and it&#8217;s kin to some application, but there&#8217;s no such interface for Quick Look plugins.  Thus, there is no way to express a preference for <span class="caps">QLCC </span>over Xcode without <a href="http://code.google.com/p/qlcolorcode/wiki/ImportantNoteForXcodeUsers">removing or renaming the Xcode plugin</a>.</p>

<p>To make matters worse, the system&#8217;s top-secret non-configurable algorithm for resolving conflicts appears to work backwards from what users might hope for.  The Xcode plugin lives inside an Apple-supplied app bundle in a system directory.  It&#8217;s installed automatically if you choose to install Xcode itself, so it can easily up on your system without you even knowing it.  Compare this to <span class="caps">QLCC. </span> You, the user, have actively downloaded it and installed it for the express purpose of handling source code files in the Quick Look system.  You can easily remove it if you decide you don&#8217;t like it anymore.  Which plugin do you think should win if they conflict?  Apple thinks different.  The system always picks the Xcode plugin over <span class="caps">QLCC.</span></p>

<p>But come on, if you&#8217;re going to have a system like this there ought to be a way of saying &#8220;I want plugin X to handle <span class="caps">UTI</span> Y.&#8221;  This could be a nice shiny user interface somewhere or a down-n-dirty terminal command, but it needs to exist.  I sent a bug report to Apple saying as much (rdar://7240036, mirrored <a href="http://openradar.appspot.com/7240036">here</a>).  I described my problem and made it clear that the solution ought to be a preference system for Quick Look.  At the very least, I said, user-installed plugins should rule supreme.</p>

<p>Apple engineering&#8217;s response?  You can register for more specific <span class="caps">UTI</span>s than public.source-code.  Nothing about why they don&#8217;t want to have a preference system or let user-installed plugins override others.  Just &#8220;register for more specific <span class="caps">UTI</span>s.&#8221;  The idiocy of this suggestion is staggering.  The whole purpose of the hierarchical nature of the <span class="caps">UTI </span>system is to allow folks like me to say &#8220;I handle source code&#8221; without having to list every type of source code.  Highlight, the library that <span class="caps">QLCC </span>is based on, can colorize about 140 programming languages.  Apple engineering, with a straight face, is telling me that I should be registering for 140 <span class="caps">UTI</span>s because Xcode decided to register for the one I actually need.</p>

<p>It gets worse.  Even if I decided to take Apple&#8217;s advice, it&#8217;s impossible to say what those 140 <span class="caps">UTI</span>s should actually be, because there&#8217;s no central authority for registering <span class="caps">UTI</span>s.  (This is another glaring flaw with the <span class="caps">UTI </span>system as implemented by Apple.)  <span class="caps">UTI</span>s like <code>org.ocaml.ocaml-source</code> are generally defined and bound to file extensions like <code>.ml</code> by applications or other entities like Quick Look plugins.  So what happens if you install one app that binds <code>.ml</code> to <code>org.ocaml.ocaml-source</code> and another that binds it to <code>fr.inria.ocaml-source</code>?  Your guess is as good as mine.  That&#8217;s another bit of non-configurable secret sauce.  But I think it&#8217;s safe to say that only one will win.</p>

<p>So let&#8217;s go back to my hypothetical 140-UTI plugin.  Imagine the confusion and headaches when a user&#8217;s <code>.ml</code> files stop being highlighted just because she happened to download some random app that bound <code>.ml</code> to <code>fr.inria.ocaml-source</code> and my plugin has registered for <code>org.ocaml.ocaml-source</code>.  Can you imagine trying to solve these problems for random users of 140 programming languages, of which you actively use maybe 10?</p>

<p>But really, this is just an example of brush-off via bug report.  Despite my slagging I do believe the engineers at Apple are generally quite talented and bright.  They must know that the problem exists, but for whatever reason they&#8217;ve decided it&#8217;s not worth solving.  Furthermore, they&#8217;ve decided it&#8217;s not worth telling some no-name hacker why they think it&#8217;s not worth solving.  But the most insulting thing is that they didn&#8217;t even bother to mark my issue as a duplicate of some other issue requesting a prefs system for Quick Look.  (You&#8217;d better believe that one exists.)</p>

<p>&#8220;Go register for more specific <span class="caps">UTI</span>s, kid, yer bothering me.&#8221;</p>

<p class="footnote" id="fn1"><sup>1</sup> If you&#8217;re unfamiliar with the <span class="caps">UTI </span>system, John Siracusa&#8217;s encyclopedic review of Tiger has <a href="http://arstechnica.com/apple/reviews/2005/04/macosx-10-4.ars/11">a detailed description</a>.</p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2009%2F09%2F24%2Fbrush-off-via-bug-report%2F&amp;linkname=Brush-off%20via%20Bug%20Report"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2009/09/24/brush-off-via-bug-report/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>QLColorCode 2.0 and Snow Leopard woes</title>
		<link>http://www.n8gray.org/blog/2009/09/16/qlcolorcode-20-and-snow-leopard-woes/</link>
		<comments>http://www.n8gray.org/blog/2009/09/16/qlcolorcode-20-and-snow-leopard-woes/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 06:56:19 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/?p=180</guid>
		<description><![CDATA[Update: Thanks to a misconfiguration on my part, QLCC 2.0.0 didn&#8217;t work on Leopard.  The problem is solved in QLCC 2.0.2.


Continuing on my &#8220;update side projects for Snow Leopard&#8221; theme, I&#8217;ve just rolled a new release of QLColorCode.  I added support for a few new languages, including Scala, which is a personal fave. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><strong>Update:</strong> Thanks to a misconfiguration on my part, <span class="caps">QLCC</span> 2.0.0 didn&#8217;t work on Leopard.  The problem is solved in <span class="caps">QLCC</span> 2.0.2.
</blockquote>

<p>Continuing on my &#8220;update side projects for Snow Leopard&#8221; theme, I&#8217;ve just rolled a new release of <span class="caps">QLC</span>olorCode.  I added support for a few new languages, including Scala, which is a personal fave.  I also fixed a bug or two and finally upgraded the bundled version of Highlight from 2.6.6 to 2.12, which was long overdue.</p>

<p>On the &#8216;meta&#8217; side, I moved the project&#8217;s source code from google code&#8217;s subversion to github.  I&#8217;ve been using git a lot lately so I expect I&#8217;ll do the same for my other projects as well.  Once you&#8217;ve gotten used to firing off branches for every little thing that crosses your mind and seamlessly switching between them at a moment&#8217;s notice it becomes hard to work in the <span class="caps">SVN </span>mindset again.</p>

<p>Unfortunately, <span class="caps">QLCC </span>has hit a bit of a roadblock with Snow Leopard.  More specifically, it&#8217;s not SnoLep that&#8217;s giving me a headache, it&#8217;s Xcode 3.2.  With the new Xcode Apple decided to include their own QL plugin for source code.  That&#8217;s great, I say, more choice is good!  <span class="caps">QLCC </span>will render everything that Xcode renders plus OCaml files, Scala files, and all sorts of other interesting languages that Xcode can&#8217;t handle.  I&#8217;m not worried about <span class="caps">QLCC </span>losing in a fair fight.  But no, Apple doesn&#8217;t fight fair.</p>

<p>It turns out that Quick Look always picks the Xcode plugin when rendering source code files (on my machine, at least).  I don&#8217;t think the Xcode plugin gets special treatment, it just happens to win in the algorithm QL uses to resolve plugin conflicts.  What is that algorithm?  Nobody outside of Apple knows.  It could be a coin-flip for all we know.  Heck, after a reboot it&#8217;s possible <span class="caps">QLCC </span>will always win!  In any case, when there are two plugins that both want to render files of type <code>public.source-code</code> it seems like maybe letting the user pick one would be a good idea, right?  Apple doesn&#8217;t think so.  No, they don&#8217;t want users to worry their pretty little heads about such matters.  Don&#8217;t worry about the algorithm, don&#8217;t worry about making choices, it&#8217;ll all be juuust fine.  Have a lollipop.</p>

<p>Except it&#8217;s not all fine.  Because let&#8217;s say a user decides that they prefer <span class="caps">QLCC </span>over the Xcode plugin.  Their only option for getting <span class="caps">QLCC </span>consistently and predictably is to somehow disable Xcode&#8217;s plugin.  They could remove it, rename it, or move it somewhere that <code>quicklookd</code> won&#8217;t find it.  But who wants to do something like that to an Apple-supplied file?  Nobody.  Even worse, Xcode&#8217;s application bundle is cryptographically signed.  <del datetime="2009-09-18T06:50:27+00:00">I believe that disabling the plugin by any of those means will invalidate the signature, though I haven&#8217;t confirmed this as fact.</del></p>

<p><strong>Update:</strong> After further research, it appears that disabling the plugin will <strong>not</strong> invalidate the signature on Xcode itself, so there shouldn&#8217;t be any terrible consequences if you choose to do so.  The plugin is located at: <code>/Developer/Applications/Xcode.app/Contents/Library/QuickLook/SourceCode.qlgenerator</code></p>

<p>So anyhow, <span class="caps">QLC</span>olorCode 2.0 is out.  It works with Snow Leopard.  If you have Xcode 3.2 installed you&#8217;ll probably never get to see it do its thing, but maybe one or two of you will still get something out of it.</p>

<p>For what it&#8217;s worth, quick look still sends .plist files to <span class="caps">QLCC. </span> Xcode&#8217;s plugin won&#8217;t touch those things.</p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2009%2F09%2F16%2Fqlcolorcode-20-and-snow-leopard-woes%2F&amp;linkname=QLColorCode%202.0%20and%20Snow%20Leopard%20woes"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2009/09/16/qlcolorcode-20-and-snow-leopard-woes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>QLColorCode 1.0</title>
		<link>http://www.n8gray.org/blog/2008/03/26/qlcolorcode-10/</link>
		<comments>http://www.n8gray.org/blog/2008/03/26/qlcolorcode-10/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 06:18:40 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/blog/2008/03/26/qlcolorcode-10/</guid>
		<description><![CDATA[I just put up the latest release of QLColorCode, and it&#8217;s a doozy!  Well, not really, but it does (probably) fix a crash bug that was biting me pretty frequently.  It also adds some more miscellaneous language UTIs and lets you put a cap on the size of rendered files so you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I just put up the latest release of <span class="caps">QLC</span>olorCode, and it&#8217;s a doozy!  Well, not really, but it does (probably) fix a crash bug that was biting me pretty frequently.  It also adds some more miscellaneous language <span class="caps">UTI</span>s and lets you put a cap on the size of rendered files so you don&#8217;t accidentally render massive 50MB <span class="caps">SQL </span>dumps and such.  All in all, it seems like this project has reached a stable point so I&#8217;ve gone ahead and called it version 1.0.</p>

<p><a href="http://qlcolorcode.googlecode.com/">Get it at the goog</a>.</p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2008%2F03%2F26%2Fqlcolorcode-10%2F&amp;linkname=QLColorCode%201.0"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2008/03/26/qlcolorcode-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>QLColorCode 0.4.1</title>
		<link>http://www.n8gray.org/blog/2008/01/07/qlcolorcode-041/</link>
		<comments>http://www.n8gray.org/blog/2008/01/07/qlcolorcode-041/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 23:32:44 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/blog/2008/01/07/qlcolorcode-041/</guid>
		<description><![CDATA[QLColorCode 0.4.1 is out now.  I briefly released 0.4 but then realized that it was completely and utterly broken by an untested, last-minute, &#8220;this can&#8217;t possibly break anything&#8221; change.  You think I would&#8217;ve learned by now&#8230;

The change list is short and sweet.  I&#8217;ve added UTIs for a few more languages (Tcl, JSP, [...]]]></description>
			<content:encoded><![CDATA[<p><span class="caps">QLC</span>olorCode 0.4.1 is out now.  I briefly released 0.4 but then realized that it was completely and utterly broken by an untested, last-minute, &#8220;this can&#8217;t possibly break anything&#8221; change.  You think I would&#8217;ve learned by now&#8230;</p>

<p>The change list is short and sweet.  I&#8217;ve added <span class="caps">UTI</span>s for a few more languages (Tcl, <span class="caps">JSP,</span> Lua) and improved some highlighting modes.  But the nicest change <span class="caps">IMHO </span>is the ability to configure the highlighting parameters with &#8220;defaults write &#8230;&#8221; commands.  This means I can finally use my slateGreen theme day-to-day without worrying that I&#8217;m going to accidentally push it out as the default theme for the next release.  It also means you can enable line numbers, wrapping, etc. without hacking on files in the <span class="caps">QLCC </span>bundle and worrying about your changes being overwritten on the next update.</p>

<p><span class="caps">BTW, QLCC </span>has been downloaded over 5,000 times since I first released it.  If only I had a dollar for each download&#8230;  <img src='http://www.n8gray.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>

<p>Anyhow, get it at the <a href="http://qlcolorcode.googlecode.com">project page</a>.</p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2008%2F01%2F07%2Fqlcolorcode-041%2F&amp;linkname=QLColorCode%200.4.1"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2008/01/07/qlcolorcode-041/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>QLColorCode 0.2 0.3</title>
		<link>http://www.n8gray.org/blog/2007/12/16/qlcolorcode-02-03/</link>
		<comments>http://www.n8gray.org/blog/2007/12/16/qlcolorcode-02-03/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 19:51:35 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/blog/2007/12/16/qlcolorcode-02-03/</guid>
		<description><![CDATA[There&#8217;s a new QLColorCode out.  Two actually!  Soon after releasing 0.2 I found a few annoying problems so I went ahead and released 0.3.

Thumbnailing  is supported now, and the syntax highlighting engine has changed from Pygments to Highlight, mainly because it&#8217;s about 10x faster but also because it covers more languages.  [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a new <a href="http://www.n8gray.org/blog/2007/12/03/announcing-qlcolorcode/"><span class="caps">QLC</span>olorCode</a> out.  Two actually!  Soon after releasing 0.2 I found a few annoying problems so I went ahead and released 0.3.</p>

<p>Thumbnailing <a class="imagelink" href="http://www.n8gray.org/wp-content/uploads/2007/12/thumbnailshot-02.png" title="Thumbnails!"><img id="image157" src="http://www.n8gray.org/wp-content/uploads/2007/12/thumbnailshot-02.thumbnail.png" alt="Thumbnails!" style="float:right; margin: 10px;" /></a> is supported now, and the syntax highlighting engine has changed from <a href="http://pygments.org">Pygments</a> to <a href="http://www.andre-simon.de/index.html">Highlight</a>, mainly because it&#8217;s about 10x faster but also because it covers more languages.  It also has an <code>ide-xcode</code> theme that does a pretty decent job of imitating Xcode&#8217;s default colors!</p>

<p>Get it at <a href="http://code.google.com/p/qlcolorcode/">the Goog</a>.</p>

<div align="center"><img id="image155" src="http://www.n8gray.org/wp-content/uploads/2007/12/previewshot-02.png" alt="The preview window." /></div><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2007%2F12%2F16%2Fqlcolorcode-02-03%2F&amp;linkname=QLColorCode%20%3Cdel%3E0.2%3C%2Fdel%3E%200.3"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2007/12/16/qlcolorcode-02-03/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing QLColorCode</title>
		<link>http://www.n8gray.org/blog/2007/12/03/announcing-qlcolorcode/</link>
		<comments>http://www.n8gray.org/blog/2007/12/03/announcing-qlcolorcode/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 00:11:50 +0000</pubDate>
		<dc:creator>n8</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[QLColorCode]]></category>

		<guid isPermaLink="false">http://www.n8gray.org/blog/2007/12/03/announcing-qlcolorcode/</guid>
		<description><![CDATA[One of the features I&#8217;ve really liked in Leopard has been Quick Look.  It&#8217;s a really nice way to browse files quickly, without opening up a bunch of random apps.  However, the QL plugin that Apple provides for reading source code is, well, just plain boring.  You just get the text, in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the features I&#8217;ve really liked in Leopard has been Quick Look.  It&#8217;s a really nice way to browse files quickly, without opening up a bunch of random apps.  However, the QL plugin that Apple provides for reading source code is, well, just plain boring.  You just get the text, in black &#038; white.  We all know how nice syntax highlighting is, so why didn&#8217;t they give us some of that?</p>

<p>Well, it turns out to be trivially easy to do a QL plugin that renders <span class="caps">HTML. </span> Mix in <a href="http://pygments.org/">Pygments</a>, the very capable syntax highlighting engine that can output <span class="caps">HTML, </span>and you&#8217;ve got a syntax highlighting QL plugin in under 100 lines of code!</p>

<p><img id="image153" src="http://www.n8gray.org/wp-content/uploads/2007/12/qlcolorcodeminisnapshot.png" alt="A Small Snapshot of QLColorCode" /></p>

<p>Rather than host this project myself I&#8217;ve decided to try making a Google Code project.  You can find it here:</p>

<p><a href="http://code.google.com/p/qlcolorcode/">http://code.google.com/p/qlcolorcode/</a></p>

<p>Enjoy!</p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.n8gray.org%2Fblog%2F2007%2F12%2F03%2Fannouncing-qlcolorcode%2F&amp;linkname=Announcing%20QLColorCode"><img src="http://www.n8gray.org/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.n8gray.org/blog/2007/12/03/announcing-qlcolorcode/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
