<?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>Deadpan Sincerity</title>
	<atom:link href="http://blog.deadpansincerity.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.deadpansincerity.com</link>
	<description>a weblog by david miller</description>
	<lastBuildDate>Wed, 02 Dec 2015 08:35:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.3.1</generator>
	<item>
		<title>Redecentralize 15</title>
		<link>http://blog.deadpansincerity.com/2015/12/redecentralize-15/</link>
		<comments>http://blog.deadpansincerity.com/2015/12/redecentralize-15/#comments</comments>
		<pubDate>Wed, 02 Dec 2015 07:40:19 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=614</guid>
		<description><![CDATA[I&#8217;ve been on the edges of Redecentralize for a while now. I watched with interest when Ross started compiling the Alternative Internet list back in 2013. Even though my only contribution was to somewhat snarkily add Books to the list, it was, and remains a fascinating list of new technologies, the impact of which we [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><div style="width: 522px" class="wp-caption aligncenter"><a href="http://hi-project.org/2015/10/decentralization-cannot-be-marketed/" target=_blank"><img src="http://hi-project.org/wp-content/uploads/2015/10/redecentralize_Oct_2015.png" width="512" height="175" class /></a><p class="wp-caption-text">Redecentralize 2015 collage from the Hi Project</p></div><br />
I&#8217;ve been on the edges of Redecentralize for a while now.</p>
<p>I watched with interest when Ross started compiling the <a href="https://redecentralize.github.io/alternative-internet/" target="_blank">Alternative Internet</a> list back in 2013. Even though my only contribution was to somewhat snarkily <a href="https://github.com/redecentralize/alternative-internet/commit/eb21b3950eef81674ccea664f8fe240ca6bb3ba8" target="_blank">add Books to the list</a>, it was, and <strong>remains</strong> a fascinating list of new technologies, the impact of which we won&#8217;t fully understand for a long minute yet.</p>
<p>A little later I sat in a <a href="http://les5portes.com/" target="_blank">downtown Geneva bar</a> with <a href="https://twitter.com/shevski" target="_blank">Ira</a>, <a href="https://twitter.com/rossjones" target="_blank">Ross</a> and <a href="https://twitter.com/frabcus" target="_blank">Francis</a>, discussing Ben Franklin and his habit of founding charter based civic institutions &#8211; the backdrop to the holy Redecentralize trinity of <strong>Privacy</strong>, <strong>Resiliance</strong> &amp; <strong>Fun</strong> taking form.</p>
<p><img class="aligncenter" src="https://pbs.twimg.com/media/BXrkDroIQAAtSx4.jpg:large" alt="" width="768" height="1024" /></p>
<p>At the tail end of 2013 &#8211; as the Snowden revelations just kept on coming, and we all started to internalise the fact that we were living in an international surveillance state of <strong>hitherto unimaginable pervasiveness</strong> &#8211; Redecentralize started to form itself into a community. </p>
<p>There were regular meetups in London, full of smart people who came together over a fascination with fresh developments in decentralizing tech, and a shared belief that somehow <strong>things could be different</strong>.</p>
<p>Although I may have turned up to the meetings &#8211; even helped to book rooms &#8211; I was only ever a tourist. </p>
<p>More of that later though.</p>
<p><img class="aligncenter" src="https://pbs.twimg.com/media/CRgfygsW0AAF1o0.jpg" alt="" width="600" height="450" /></p>
<p>Because just a few weeks ago, the Redecentralize community gathered itself in Soho, London for a full blown two day <a href="http://redecentralize.org/conference/" target="_blank">conference</a> &#8211; pulled together from nothing in just a couple of months thanks to the heroic volunteer efforts of <a href="https://twitter.com/shevski" target="_blank">Ira</a>, <a href="https://twitter.com/blaine" target="_blank">Blaine</a>, <a href="https://twitter.com/refset" target="_blank">Jeremy</a>, <a href="https://twitter.com/erika_owens" target="_blank">Erika</a>, &amp; co.</p>
<h2>What even is a Redecentralize?</h2>
<p>The first thing that strikes you is the sheer <strong>breadth</strong> of the Redecentralize movement. Self hosted email, political theory, blockchains, backup, web standards, journalism, messaging apps and much more besides.</p>
<p>As is the case with all broad churches, this can make it hard to figure out what exactly is bringing all of these things together. Talking to people over the weekend, the two most common seemed to be <strong>curiosity</strong> and <strong>politics</strong>. </p>
<p>For some, Redecentralize is interesting because much of the tech is so new &#8211; and for them, the intellectual exercise is simply fascinating.</p>
<blockquote><p>Point at a thing and then ask <br />&#8220;What happens if I Blockchain that?&#8221;</p></blockquote>
<p>(Feel free to substitute Distributed Hash Table, IPFS, et cetera for Blockchain.)</p>
<p>For most of the rest, the motivation seems to stem from a deep unease with the way in which our societies are organised. A feeling that the individual is <strong>disenfranchised</strong>, that we are less equal, less autonomous than we should be.</p>
<p>Technology has a profound ability to alter these structures &#8211; to re-write the rulebook. For people searching for a way to increase autonomy and reduce inequality, decentralization technologies often feel like they have the potential to be the <strong>early building blocks</strong>.</p>
<p>Which is where I start to get interested &#8211; for the most part I could care less about the technical details of decentralization tech.</p>
<p><img src="https://pbs.twimg.com/media/CRmhRY8WUAAfm0w.jpg:large" width="1024" height="768" class="aligncenter" /></p>
<h2>But, where is the button?</h2>
<p>One of the interesting things about this space &#8211; with such a deeply philosophical-political motivation for it&#8217;s existence &#8211; was the almost complete absence of conversations operating on those levels. </p>
<p>Rather, we seemed to spend our time dwelling on the <strong>How</strong>, without first setting out <strong>Why</strong>. When we jump straight to the hows of technology, it makes it hard to figure out what this is <strong>for</strong> &#8211; it leaves us asking <strong>So what?</strong></p>
<p>I think that&#8217;s what <a href="https://twitter.com/Adewunmi" target="_blank">Ade</a> was getting at when she exclaimed: </p>
<blockquote><p>If we&#8217;re going to help people, we really need to stop with the fetishization of complexity and technical details.</p></blockquote>
<p><small>My paraphrasing &#8211; apologies for errors therein</small></p>
<p>This is where something like <a href="http://redecentralize.org/" target="_blank">Redecentralize</a> as <strong>institution</strong> could help out redecentralization as <strong>movement</strong>.</p>
<p>Going beyond mapping the space of emerging decentralization technologies and popularising them to a wider audience, the value of bringing people together at events like Redecentralize 2015 is unlikely to be sharing the technical details of protocols, platforms or standards. Rather, it affords the opportunity to debate the deeper questions, to figure out what motivates us, what <strong>change</strong> we want to see in the world, and <strong>why</strong> that world might be <strong>better</strong>.</p>
<h2>So what.</h2>
<p>So that&#8217;s what I want to see more of at the next event. </p>
<p>The <strong>so what</strong> track. Which would ban acronyms, and encourage us to forge alliances with people who want to see the same changes in the world as we do.</p>
<p>Here&#8217;s what the schedule might look like: </p>
<ol>
<li>
          <strong>Autonomy &#8211; a primer:</strong> A brief history of the moral and political philosophy of autonomy, what it means for us in everyday life, and how we can achieve it.
        </li>
<li>
          <strong>How to talk about the ethics of tech: </strong>All technology is created, and operates within an ethical famework. Sometimes explicitly, sometimes implicitly. As a collective, technologists don&#8217;t do well at talking about that context. Let&#8217;s try and find some better ways to talk about the moral choices we make when we build things.</p>
<li>
          <strong>Why Decentralize?:</strong> A group exploration of when it helps to decentralize, and why. Understanding the dangers of centralization, as well as what you lose when you decentralize.
        </li>
<li>
          <strong>Defending Decentralization:</strong> Plenty of technologies that look like they disrupt existing power structures in a way that makes us more equal have the potential to create dynamics of power just as polarised as the things they &#8220;disrupt&#8221;. How do we design social and legal governance structures that protect us against future power grabs?
        </li>
</ol>
<p>Maybe that sounds like it could be your kind of thing? (Suggestions for more here very welcome!) If so, then maybe I&#8217;ll see you at Redecentralize 2016&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2015/12/redecentralize-15/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Setting up Emacs as a Javascript editing environment for Fun or Profit</title>
		<link>http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/</link>
		<comments>http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/#comments</comments>
		<pubDate>Sun, 29 May 2011 17:21:16 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[favourite things]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[editing]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[flymake]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[jslint]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[yasnippet]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=454</guid>
		<description><![CDATA[I&#8217;ve been doing a lot of Javascript lately, which has naturally led to a whole lot of trips down the .emacs rabbit-hole So, here are the steps you need to turn OOTB Emacs into the perfect environment for working on Javascript: Auto-completion First up, you&#8217;re going to want decent auto-completion, so install the straightforwardly named [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been doing a lot of Javascript lately, which has naturally led to a whole lot of trips down the .emacs rabbit-hole</p>
<p>So, here are the steps you need to turn OOTB Emacs into the perfect environment for working on Javascript:</p>
<h2>Auto-completion</h2>
<p><div id="attachment_479" style="width: 386px" class="wp-caption aligncenter"><a href="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/ac.png"><img src="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/ac.png" alt="" title="Emacs Auto completing" width="376" height="224" class="size-full wp-image-479" /></a><p class="wp-caption-text">Fizzing!</p></div><br />
<br \></p>
<p>First up, you&#8217;re going to want decent auto-completion, so install the straightforwardly named <a href="http://cx4a.org/software/auto-complete/">auto-complete-mode</a>. Due to some mode-name aliasing that goes on in the Emacs23 javascript mode, You&#8217;ll need to make sure it can find the relevant Javascript dictionary so</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>auto-complete<span style="color: #000000; font-weight: bold;">/</span>dict
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> javascript-mode js-mode</pre></td></tr></table></div>

<p>and then add to your .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/path-to/auto-complete&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">; Load the default configuration</span>
<span style="color: #66cc66;">&#40;</span>require 'auto-complete-config<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">; Make sure we can find the dictionaries</span>
<span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'ac-dictionary-directories <span style="color: #ff0000;">&quot;~/emacs/auto-complete/dict&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">; Use dictionaries by default</span>
<span style="color: #66cc66;">&#40;</span>setq-default ac-sources <span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'ac-sources 'ac-source-dictionary<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>global-auto-complete-mode t<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">; Start auto-completion after 2 characters of a word</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ac-auto-start <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">; case sensitivity is important when finding matches</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> ac-ignore-<span style="color: #b1b100;">case</span> <span style="color: #b1b100;">nil</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>You now have auto-completion for all variable names in all open Javascript buffers, as well as for standard syntax words (setTimeout, parseInt, onFocus etc).</p>
<h2>Snippeting</h2>
<p>Not content with that, we&#8217;ll also want some kind of intelligent snippet package right &#8211; how many times do you really want to type all those semicolons and curly braces? Once is good for me.</p>
<p>The excellent <a href="http://code.google.com/p/yasnippet/">Yasnippet</a> provides this (check out the <a href="http://www.youtube.com/watch%3Fv%3D76Ygeg9miao">youtube demo</a> if you&#8217;ve not come across it before)</p>
<p>Once you&#8217;ve got that downloaded and installed, you&#8217;ll want some Javascript snippets to load in, the ones I use, for standard Javascript and jQuery can be downloaded from <a href="https://github.com/davidmiller/yasnips/raw/master/jsnips.tgz">here</a>, and then the directory provided by that tarfile needs to go in yasnippet/snippets/text-mode</p>
<p>So for our .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/path/to/yasnippet&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Load the library</span>
<span style="color: #66cc66;">&#40;</span>require 'yasnippet<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>yas/initialize<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Load the snippet files themselves</span>
<span style="color: #66cc66;">&#40;</span>yas/load-directory <span style="color: #ff0000;">&quot;~/path/to/yasnippet/snippets/text-mode&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Let's have snippets in the auto-complete dropdown</span>
<span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'ac-sources 'ac-source-yasnippet<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<h2>Syntax Checking</h2>
<div id="attachment_484" style="width: 136px" class="wp-caption alignright"><a href="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/syntax.png"><img src="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/syntax.png" alt="" title="whoops..." width="126" height="79" class="size-full wp-image-484" /></a><p class="wp-caption-text">Whoops...</p></div>
<p>One of the problems with Javascript programming is that the feedback loop for syntax errors is *slow* &#8211; if you&#8217;re working with the web you have to wait for a whole pageload. So we&#8217;ll want on-the-fly error checking.</p>
<p><a href="http://keturn.net/">Kevin Turner</a> originally wrote <a href="https://github.com/keturn/lintnode#readme">Lintnode</a>, which runs a lighthweight node.js server that passes your file to <a href="http://www.crockford.com/">Douglas Crockford&#8217;s</a> <a href="http://www.jslint.com/">JSLint</a> to integrate with <a href="http://www.emacswiki.org/emacs/FlyMake">Flymake</a> &#8211; the Emacs solution for on-the-fly syntax checking. The fork I&#8217;m currently maintaining at <a href="https://github.com/davidmiller/lintnode">Github</a> contains some enhancements such as automatic initialization and JSLint options passed from Emacs that the original has yet to merge in. Given that JSLint frequently complains about things that you might like it to er, not complain about, the ability to change the options with the lintnode-jslint-excludes variable makes this far more useable.</p>
<p>So:</p>
<p>Install <a href="http://nodejs.org/">node.js</a> and <a href="http://npmjs.org/">npm</a> (The package manager for node)</p>
<p>Get lintnode and the dependencies</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git clone</span> https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>davidmiller<span style="color: #000000; font-weight: bold;">/</span>lintnode.git
<span style="color: #7a0874; font-weight: bold;">cd</span> lintnode
npm <span style="color: #c20cb9; font-weight: bold;">install</span> express connect-form haml underscore</pre></td></tr></table></div>

<p>Then we need this in our .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/path/to/lintnode&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>require 'flymake-jslint<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Make sure we can find the lintnode executable</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> lintnode-location <span style="color: #ff0000;">&quot;~/path/to/lintnode&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; JSLint can be... opinionated</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> lintnode-jslint-excludes <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">list</span> 'nomen 'undef 'plusplus 'onevar 'white<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Start the server when we first open a js file and start checking</span>
<span style="color: #66cc66;">&#40;</span>add-hook 'js-mode-hook
          <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #66cc66;">&#40;</span>lintnode-hook<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>Syntax errors will now be given a red background without having to leave the comfort of Emacs.</p>
<p>Even better, if we install the <a href="http://www.emacswiki.org/emacs/FlymakeCursor">Flymake Cursor</a> package, we get the error message in the minibuffer when the cursor is on a line with an error.</p>
<div id="attachment_485" style="width: 351px" class="wp-caption aligncenter"><a href="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/modeline.png"><img src="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/modeline.png" alt="" title="modeline" width="341" height="153" class="size-full wp-image-485" /></a><p class="wp-caption-text">Easy Mistake!</p></div>
<p>Get the source from http://www.emacswiki.org/emacs/flymake-cursor.el and then add to your .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/emacs/minor-modes&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Nice Flymake minibuffer messages</span>
<span style="color: #66cc66;">&#40;</span>require 'flymake-cursor<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p><b>Edit:</b></p>
<p>As Jesse and Magnar point out in the comments, it&#8217;s probably a better idea to not exclude &#8216;undef from the jslint errors, but rather to declare global variables at the top of your .js file</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #006600; font-style: italic;">/*global $ */</span></pre></td></tr></table></div>

<p>This way you can let jslint know about other libraries you are using, but still get the checks for undefined variables in your own code.</p>
<h2>Code folding</h2>
<div id="attachment_486" style="width: 484px" class="wp-caption aligncenter"><a href="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/hideshow.png"><img src="http://blog.deadpansincerity.com/wp-content/uploads/2011/05/hideshow.png" alt="" title="hideshow" width="474" height="144" class="size-full wp-image-486" /></a><p class="wp-caption-text">Underscore outline</p></div>
<p>Especially if you&#8217;re dealing with large projects, the ability to hide portions of code can be great for maintaining focus. Emacs comes with this built in, but you have to enable it, so returning to our .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-hook 'js-mode-hook
          <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #808080; font-style: italic;">;; Scan the file for nested code blocks</span>
            <span style="color: #66cc66;">&#40;</span>imenu-add-menubar-index<span style="color: #66cc66;">&#41;</span>
            <span style="color: #808080; font-style: italic;">;; Activate the folding mode</span>
            <span style="color: #66cc66;">&#40;</span>hs-minor-mode t<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>This means that when your cursor is in the function&#8230;</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> Foo <span style="color: #339933;">=</span> <span style="color: #CC0000;">42</span><span style="color: #339933;">;</span>
addFoo <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// Let's add the meaning of life to</span>
    <span style="color: #006600; font-style: italic;">// our `num` - it'll be fun!</span>
    <span style="color: #000066; font-weight: bold;">var</span> meaningful<span style="color: #339933;">;</span>
    meaningful <span style="color: #339933;">=</span> num <span style="color: #339933;">+</span> Foo<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>&#8230; and you M-x hs-hide-block, the function turns into:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;">Var Foo <span style="color: #339933;">=</span> <span style="color: #CC0000;">42</span><span style="color: #339933;">;</span>
addFoo <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>...<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>To my taste the default keybinding of C-c @ C-h to hide blocks is somewhat perverse, so I&#8217;d recommend this in your .emacs:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;; Show-hide</span>
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#40;</span>kbd <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> 'hs-show-block<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#40;</span>kbd <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> 'hs-show-all<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#40;</span>kbd <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> 'hs-hide-block<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#40;</span>kbd <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span> 'hs-hide-all<span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>YMMV.</p>
<h2>Javascript Console</h2>
<p>Having a REPL for the language you&#8217;re working with close to hand is basically required for me to enjoy working with it. Now that we&#8217;ve installed node.js, though, we can have us a Javascript console inside Emacs with <a href="http://js-comint-el.sourceforge.net/">js-comint</a>&#8230;</p>
<p>Once you&#8217;ve grabbed the file, your .emacs should have:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'load-path <span style="color: #ff0000;">&quot;~/path/to/js-comint&quot;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>require 'js-comint<span style="color: #66cc66;">&#41;</span>
<span style="color: #808080; font-style: italic;">;; Use node as our repl</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> inferior-js-program-command <span style="color: #ff0000;">&quot;node&quot;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">setq</span> inferior-js-mode-hook
      <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
        <span style="color: #808080; font-style: italic;">;; We like nice colors</span>
        <span style="color: #66cc66;">&#40;</span>ansi-color-for-comint-mode-on<span style="color: #66cc66;">&#41;</span>
        <span style="color: #808080; font-style: italic;">;; Deal with some prompt nonsense</span>
        <span style="color: #66cc66;">&#40;</span>add-to-<span style="color: #b1b100;">list</span> 'comint-preoutput-filter-functions
                     <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">lambda</span> <span style="color: #66cc66;">&#40;</span>output<span style="color: #66cc66;">&#41;</span>
                       <span style="color: #66cc66;">&#40;</span>replace-regexp-in-string <span style="color: #ff0000;">&quot;.*1G<span style="color: #000099; font-weight: bold;">\.</span><span style="color: #000099; font-weight: bold;">\.</span><span style="color: #000099; font-weight: bold;">\.</span>.*5G&quot;</span> <span style="color: #ff0000;">&quot;...&quot;</span>
                     <span style="color: #66cc66;">&#40;</span>replace-regexp-in-string <span style="color: #ff0000;">&quot;.*1G.*3G&quot;</span> <span style="color: #ff0000;">&quot;&amp;gt;&quot;</span> output<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>You can then run a Javascript REPL with M-x run-js and also send portions of files by selecting them and then running M-x send-region. Neat.</p>
<h2>By way of conclusion</h2>
<p>There are a few other tweaks that make my Javascripting just that little bit nicer, but they&#8217;re more personal Emacs setup than anything specific to Javascript. So, there you have it, the perfect Javascript editing environment.</p>
<p>Love regards etc</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2011/05/setting-up-emacs-as-a-javascript-editing-environment-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>80</slash:comments>
		</item>
		<item>
		<title>Announcing Pony Mode &#8211; a Django editing mode for Emacs</title>
		<link>http://blog.deadpansincerity.com/2011/05/announcing-pony-mode-a-django-editing-mode-for-emacs/</link>
		<comments>http://blog.deadpansincerity.com/2011/05/announcing-pony-mode-a-django-editing-mode-for-emacs/#comments</comments>
		<pubDate>Sat, 28 May 2011 11:33:10 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[favourite things]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=448</guid>
		<description><![CDATA[I&#8217;m pleased to announce the first beta &#8216;release&#8217; of Pony Mode, a minor mode for working on Django projects in Emacs. This mode provides integration with the django management commands within emacs, as well as test integration, a minor-mode with syntax highlighting for editing templates, will determine whether you are using Fabric or Buildout, as [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m pleased to announce the first beta &#8216;release&#8217; of <a href="https://github.com/davidmiller/pony-mode">Pony Mode</a>, a minor mode for working on <a href="www.djangoproject.com">Django</a> projects in <a href="http://www.gnu.org/software/emacs/">Emacs</a>.</p>
<p>This mode provides integration with the django management commands within emacs, as well as test integration, a minor-mode with syntax highlighting for editing templates, will determine whether you are using <a href="http://fabfile.org">Fabric</a> or <a href="http://www.buildout.org/">Buildout</a>, as well as much more!</p>
<p>This mode is under active development, so please file any bugs at the <a href="https://github.com/davidmiller/pony-mode/issues">Github page</a>, and feel free to provide any feedback/feature requests etc.</p>
<p>Current features include:</p>
<ul>
<li>Run dev server in an emacs buffer [C-c C-p r]</li>
<li>* Checks to see if runserver_plus is available</li>
<li>* If not uses in-built runserver</li>
<li>Jump to current project in browser (start server if required) [C-c C-p b]</li>
<li>Run test case at point in buffer [C-c C-p t]</li>
<li>Run tests for current app in buffer [C-c C-p t]</li>
<li>Run Syncdb on current project</li>
<li>Management commands for current project in interactive buffer</li>
<li>South integration &#8211; run south convert, schemamigration, migrate</li>
<li>Run django shell in buffer [C-c C-p s]</li>
<li>* Checks for shell_plus</li>
<li>* If not defaults to shell</li>
<li>Fabric integration [C-c C-p f]</li>
<li>Startapp and dumpdata on current project within emacs</li>
<li>Database integration with Emacs sql-mode interactive buffer [C-c C-c d</li>
<li>Django Template minor mode with syntax highlighting for django</li>
<p> template tags</p>
<li>Snippet collection for django</li>
<li>generate tags table for project</li>
<li>run manage commands in interactive buffer</li>
<li>Buildout integration</li>
<li>Generate TAGS table for project to enable quick navigation</li>
<li>Jump to template at point or from editing view [C-c C-p g t]</li>
</ul>
<p>Grab it while it&#8217;s hot!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2011/05/announcing-pony-mode-a-django-editing-mode-for-emacs/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Popper: Rulers</title>
		<link>http://blog.deadpansincerity.com/2010/06/popper-rulers/</link>
		<comments>http://blog.deadpansincerity.com/2010/06/popper-rulers/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 12:45:22 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>
		<category><![CDATA[Karl Popper]]></category>
		<category><![CDATA[leaders]]></category>
		<category><![CDATA[madness]]></category>
		<category><![CDATA[politics]]></category>
		<category><![CDATA[rulers]]></category>
		<category><![CDATA[The Open Society and its Enemies]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=291</guid>
		<description><![CDATA[It appears to me madness to base all our political efforts upon the faint hope that we shall be successful in obtaining excellent, or even competent rulers. The Open Society &#038; It&#8217;s Enemies &#8211; Popper]]></description>
				<content:encoded><![CDATA[<blockquote><p>It appears to me madness to base all our political efforts upon the faint hope that we shall be successful in obtaining excellent, or even competent rulers.</p></blockquote>
<p>The Open Society &#038; It&#8217;s Enemies &#8211; Popper</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2010/06/popper-rulers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lacanisms</title>
		<link>http://blog.deadpansincerity.com/2010/03/lacanisms/</link>
		<comments>http://blog.deadpansincerity.com/2010/03/lacanisms/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 22:32:51 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=331</guid>
		<description><![CDATA[The religious is not neurotic at all. He is religious. But he looks like a neurotic, because he too combines things around what really is the desire of the Other. The only difference is that, because this is an Other that does not exist, because it is God, we need proof. So we pretend the [&#8230;]]]></description>
				<content:encoded><![CDATA[<blockquote><p>The religious is not neurotic at all. He is religious. But he looks like a neurotic, because he too combines things around what really is the desire of the Other. The only difference is that, because this is an Other that does not exist, because it is God, we need proof. So we pretend the Other is asking for something. Victims, for example. That is why this gradually becomes confused with the attitude of the neurotic, and especially the obsessional neurotic. It looks terribly like all the techniques used in victimary ceremonies</p></blockquote>
<blockquote><p>You will say that I am now advancing something that is no more transparent for that. But I&#8217;m not looking for transparency, I am trying, first of all, to stick to what we find in our experience, and if it is not transparent, well that&#8217;s too bad.</p></blockquote>
<p>From <a href="http://www.amazon.co.uk/gp/product/1844672719?ie=UTF8&#038;tag=deadpsince-21&#038;linkCode=as2&#038;camp=1634&#038;creative=19450&#038;creativeASIN=1844672719">My Teaching</a><img src="http://www.assoc-amazon.co.uk/e/ir?t=deadpsince-21&#038;l=as2&#038;o=2&#038;a=1844672719" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, Jacques Lacan</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2010/03/lacanisms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eno on Zappa &#038; Metaphorical Archery</title>
		<link>http://blog.deadpansincerity.com/2010/01/eno-on-zappa-metaphorical-archery/</link>
		<comments>http://blog.deadpansincerity.com/2010/01/eno-on-zappa-metaphorical-archery/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 12:03:37 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>
		<category><![CDATA[Eno]]></category>
		<category><![CDATA[Guardian]]></category>
		<category><![CDATA[Hindsight]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[Morley]]></category>
		<category><![CDATA[Zappa]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=305</guid>
		<description><![CDATA[On Frank Zappa &#8220;Zappa was important to me because I realised I didn&#8217;t have to make music like he did. I might have made a lot of music like he did if he had not done it first and made me realise that I did not want to go there. I did not like his [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>On Frank Zappa</strong></p>
<blockquote><p>
&#8220;Zappa was important to me because I realised I didn&#8217;t have to make music like he did. I might have made a lot of music like he did if he had not done it first and made me realise that I did not want to go there. I did not like his music but I am grateful that he did it. Sometimes you learn as much from the things you don&#8217;t like as from the things you do like. The rejection side is as important as the endorsement part.
</p></blockquote>
<p><strong>On hindsight</strong></p>
<blockquote><p>
&#8220;Instead of shooting arrows at someone else&#8217;s target, which I&#8217;ve never been very good at, I make my own target around wherever my arrow happens to have landed. You shoot your arrow and then you paint your bulls eye around it, and therefore you have hit the target dead centre.&#8221;</p></blockquote>
<p><a href="http://www.guardian.co.uk/music/2010/jan/17/brian-eno-interview-paul-morley">Slightly expanded version of the Paul Morley interview that appeared in yesterday&#8217;s Observer Review</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2010/01/eno-on-zappa-metaphorical-archery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Well 2010</title>
		<link>http://blog.deadpansincerity.com/2010/01/the-well-2010/</link>
		<comments>http://blog.deadpansincerity.com/2010/01/the-well-2010/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 21:15:04 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>
		<category><![CDATA[economy]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[markets]]></category>
		<category><![CDATA[politics]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=299</guid>
		<description><![CDATA[Basically, the political class is waiting for the civil population to come back to the church of the free market and get over the fact that its cardinals walk in public with no clothes on. You&#8217;re starting to see weird forms of acting-out, neurotic displacement activities. Fetishes, even. Sarah Palin, for instance. I could go [&#8230;]]]></description>
				<content:encoded><![CDATA[<blockquote><p> Basically, the political class is waiting for the civil population to come back to the church of the free market and get over the fact that its cardinals walk in public with no clothes on.</p></blockquote>
<blockquote><p>You&#8217;re starting to see weird forms of acting-out, neurotic displacement activities.  Fetishes, even.  Sarah Palin, for instance. I could go on about that woman every day.  And so can everybody else, which is why they do.</p></blockquote>
<blockquote><p>Genocide has much more proven shelf-appeal than any of these hokum Rube Goldberg geo-schemes.  It&#8217;s by no means easy to kill off half of everybody, but we&#8217;ve already invented a wide variety of ingenious ways to attempt that, and almost all of &#8217;em are much simpler, more rugged and more plausible than putting the North Pole under a tinfoil hat.</p></blockquote>
<p><a href="http://www.well.com/conf/inkwell.vue/topics/373/Bruce-Sterling-State-of-the-Worl-page01.html">Bruce Sterling&#8217;s State of the World 2010</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2010/01/the-well-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quote: Popper</title>
		<link>http://blog.deadpansincerity.com/2009/12/quote-popper/</link>
		<comments>http://blog.deadpansincerity.com/2009/12/quote-popper/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 22:30:31 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=287</guid>
		<description><![CDATA[(Nobody will say that an orangeis an instrument, or a means to an end; but we often look upon oranges as means to ends, for example, if we wish to eat them, or, perhaps, to make our living by selling them.) &#8211; The Open Society And It&#8217;s Enemies]]></description>
				<content:encoded><![CDATA[<blockquote style="padding-top: 20px;"><p>
(Nobody will say that an orange<em>is</em> an instrument, or a means to an end; but we often <em>look upon</em> oranges as means to ends, for example, if we wish to eat them, or, perhaps, to make our living by selling them.)
</p></blockquote>
<p>&#8211; The Open Society And It&#8217;s Enemies</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2009/12/quote-popper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quote: Karl Popper</title>
		<link>http://blog.deadpansincerity.com/2009/09/quote-karl-popper/</link>
		<comments>http://blog.deadpansincerity.com/2009/09/quote-karl-popper/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 22:15:27 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>
		<category><![CDATA[Karl Popper]]></category>
		<category><![CDATA[quotes]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=243</guid>
		<description><![CDATA[If you know that things are bound to happen whatever you do, then you may feel free to give up the fight against them. You may, more especially, give up the attempt to control those things which most people agree to be social evils, such as war; or to mention a smaller but nevertheless important [&#8230;]]]></description>
				<content:encoded><![CDATA[<blockquote><p>If you know that things are bound to happen whatever you do, then you may feel free to give up the fight against them. You may, more especially, give up the attempt to control those things which most people agree to be social evils, such as war; or to mention a smaller but nevertheless important thing, the tyranny of the petty official.</p></blockquote>
<p><a href="http://en.wikipedia.org/wiki/Karl_Popper">Popper</a> &#8211; <a href="http://www.amazon.co.uk/gp/product/0415237319?ie=UTF8&amp;tag=deadpsince-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0415237319">The Open Society and Its Enemies</a><img width="1" height="1" border="0" style="border: medium none  ! important; margin: 0px ! important;" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=deadpsince-21&amp;l=as2&amp;o=2&amp;a=0415237319" class="qackxqmbpjlylfhyfsgs"/></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2009/09/quote-karl-popper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Paraquotes: Vonnegut</title>
		<link>http://blog.deadpansincerity.com/2009/08/paraquotes-vonnegut/</link>
		<comments>http://blog.deadpansincerity.com/2009/08/paraquotes-vonnegut/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 12:43:09 +0000</pubDate>
		<dc:creator><![CDATA[david miller]]></dc:creator>
				<category><![CDATA[wishful thinking]]></category>
		<category><![CDATA[democracy]]></category>
		<category><![CDATA[politicians]]></category>
		<category><![CDATA[quotes]]></category>
		<category><![CDATA[vonnegut]]></category>

		<guid isPermaLink="false">http://blog.deadpansincerity.com/?p=234</guid>
		<description><![CDATA[There is a tragic flaw with our precious &#8220;democracy&#8221;, and this is it: Only lunatics want to be politicians&#8221;]]></description>
				<content:encoded><![CDATA[<blockquote style="text-align: center;"><p>There is a tragic flaw with our precious &#8220;democracy&#8221;, and this is it:</p>
<p>Only lunatics want to be politicians&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.deadpansincerity.com/2009/08/paraquotes-vonnegut/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
