<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Let’s Discuss the Matter Further</title>
    <link>http://rhodesmill.org/brandon</link>
    <description>Thoughts and ideas from Brandon Rhodes</description>
    <pubDate>Tue, 08 May 2012 02:01:57 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Mounting Windows shares in Linux userspace</title>
      <link>http://rhodesmill.org/brandon/2010/mounting-windows-shares-in-linux-userspace/</link>
      <pubDate>Wed, 09 Jun 2010 17:33:30 EDT</pubDate>
      <category><![CDATA[emacs]]></category>
      <category><![CDATA[computing]]></category>
      <guid>http://rhodesmill.org/brandon/2010/mounting-windows-shares-in-linux-userspace/</guid>
      <description>Mounting Windows shares in Linux userspace</description>

      <content:encoded><![CDATA[
<p>
  A current project has forced me into the clunky world of Windows,
  to verify that a Python program compiles and runs there
  just like it runs under Linux.
  Instead of trying to port my entire development environment to Windows —
  which includes two decades of customizations
  and a small empire of tools like
  <a href="http://www.gnu.org/software/emacs/"
     >Emacs</a>,
  <a href="http://pypi.python.org/pypi/pyflakes"
     >pyflakes</a>, and
  <a href="http://rope.sourceforge.net/"
     >Rope</a> —
  I want to simply mount my Windows home directory under Linux
  so that I can run my normal editor and version control tools
  in a more familiar environment.
</p>
<p>
  I have worked out an elegant solution
  by combining <i>two</i> of the powerful user-space filesystems
  available through the <a href="http://fuse.sourceforge.net/">FUSE</a>
  mechanism in the Linux kernel.
  Let me take you through the story of how I put them together!
</p>
<p><a href="http://rhodesmill.org/brandon/2010/mounting-windows-shares-in-linux-userspace/">Read more</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Opening tabs remotely in Google Chrome</title>
      <link>http://rhodesmill.org/brandon/2010/remote-tabs-google-chrome/</link>
      <pubDate>Wed, 24 Feb 2010 23:07:06 EST</pubDate>
      <category><![CDATA[python]]></category>
      <category><![CDATA[emacs]]></category>
      <category><![CDATA[computing]]></category>
      <guid>http://rhodesmill.org/brandon/2010/remote-tabs-google-chrome/</guid>
      <description>Opening tabs remotely in Google Chrome</description>

      <content:encoded><![CDATA[
<p>
Now that I use
<a href="http://www.google.com/chrome">Google Chrome</a>
almost exclusively,
I miss the fact
that a running <a href="http://www.firefox.com">Firefox</a> instance
could be controlled from the command line so that Emacs could call for a new tab
when I clicked on a URL.
It would run a command something like this:
</p>
<pre>
firefox -remote 'openURL(http://example.com/, new-tab)'
</pre>
<p>
But after a few months of manually cutting and pasting URLs into Chrome —
which wasn't actually <i>that</i> bad,
since the address bar in Chrome is such a convenient and large target —
I decided that I needed a real solution.
After not finding anything like a <tt>-remote</tt> option,
I discovered that Chrome can at least be run
with a debugging port open:
</p>
<pre>
google-chrome --remote-shell-port=9222
</pre>
<p>
The protocol that Chrome speaks is primitive enough
that it was quick work to implement a small client in Python.
Rather than merely cutting and pasting its code here on my blog,
or even be satisfied with
<a href="http://bitbucket.org/brandon/chrome_remote_shell/"
   >making it available on bitbucket</a>,
I decided to place the code inside of a new Python package
and make it generally available on PyPI as <a href="http://pypi.python.org/pypi/chrome_remote_shell/"
   >chrome_remote_shell</a>.
</p>
<p>
Thanks to this simple package,
a four-line program (not counting the shebang and comment)
is now all that I need to ask Google Chrome to open a new tab:
</p>


<div class="pygments_autumn"><pre><span class="c">#!/usr/bin/env python</span>
<span class="c"># Name this file &quot;google-chrome-open-url&quot;</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">chrome_remote_shell</span>
<span class="n">shell</span> <span class="o">=</span> <span class="n">chrome_remote_shell</span><span class="o">.</span><span class="n">open</span><span class="p">()</span>
<span class="n">shell</span><span class="o">.</span><span class="n">open_url</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
</pre></div>



<p>
To teach Emacs to start using Google Chrome when I clicked on a link,
I only needed to supply it with two new settings:
</p>


<div class="pygments_autumn"><pre><span class="p">(</span><span class="nf">setq</span> <span class="nv">browse-url-browser-function</span>
      <span class="ss">&#39;browse-url-generic</span><span class="p">)</span>
<span class="p">(</span><span class="nf">setq</span> <span class="nv">browse-url-generic-program</span>
      <span class="s">&quot;google-chrome-open-url&quot;</span><span class="p">)</span>  
</pre></div>



<p>
And now everything works.
I hope that these notes prove useful to someone else.
Enjoy!
</p>
]]></content:encoded>
    </item>
    <item>
      <title>Installing Python packages for Emacs with virtualenv</title>
      <link>http://rhodesmill.org/brandon/2009/emacs-python-virtualenv/</link>
      <pubDate>Wed, 25 Feb 2009 18:25:15 EST</pubDate>
      <category><![CDATA[python]]></category>
      <category><![CDATA[emacs]]></category>
      <category><![CDATA[computing]]></category>
      <guid>http://rhodesmill.org/brandon/2009/emacs-python-virtualenv/</guid>
      <description>Installing Python packages for Emacs with virtualenv</description>

      <content:encoded><![CDATA[
The only rough edge I have found amidst the otherwise exceptional advice on Ryan McGuire's <a href="http://www.enigmacurry.com/">Enigma Curry blog</a> is that Ryan recommends installing Python packages with:
<pre>
$ sudo easy_install <i>package_url</i>
</pre>
This means that his Emacs configuration — which, very generously, <a href="http://www.enigmacurry.com/2009/01/19/my-emacs-config-on-github/">he has started maintaining as a project on github</a> so that other people can use it themselves, or branch their own versions — requires root access merely to install.

Like Ryan, I also keep my Emacs configuration under version control, so that improvements I check in from one account are easy to check out into all of my other accounts. Although my setup is probably too simple to be interesting as a public project, there is one aspect of it that I should share: unlike Ryan, I use the advanced technology of a <a href="http://pypi.python.org/pypi/virtualenv"><tt>virtualenv</tt></a> to hold the Python packages that Emacs needs. The virtual environment lives under my own account, and is easy to create, access, and rebuild, even in the absence of root privileges on a particular machine. Even better, packages that I install or upgrade inside of the virtual environment cannot interfere with Python programs running elsewhere on the system.

<p><a href="http://rhodesmill.org/brandon/2009/emacs-python-virtualenv/">Read more</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>

