<?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>Made of Bugs &#187; emacs</title>
	<atom:link href="http://blog.nelhage.com/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nelhage.com</link>
	<description>It's software. It's made of bugs.</description>
	<lastBuildDate>Thu, 18 Aug 2011 21:57:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress tricks: Disabling editing shortcuts</title>
		<link>http://blog.nelhage.com/2010/06/disable-wordpress-edit-shortcuts/</link>
		<comments>http://blog.nelhage.com/2010/06/disable-wordpress-edit-shortcuts/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 00:07:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=250</guid>
		<description><![CDATA[One of the major reasons I can&#8217;t stand webapps is because I&#8217;m a serious emacs junkie, and I can&#8217;t edit text in anything that doesn&#8217;t have decent emacs keybindings. Fortunately, on Linux, at least, GTK provides basic emacs keybindings if you add gtk-key-theme-name = "Emacs" to your .gtkrc-2.0. However, some webapps think that they deserve [...]]]></description>
			<content:encoded><![CDATA[<p>One of the major reasons I can&#8217;t stand webapps is because I&#8217;m a
serious emacs junkie, and I can&#8217;t edit text in anything that doesn&#8217;t
have decent emacs keybindings.</p>

<p>Fortunately, on Linux, at least, GTK provides basic emacs keybindings
if you add</p>

<pre><code>gtk-key-theme-name = "Emacs"
</code></pre>

<p>to your <code>.gtkrc-2.0</code>. However, some webapps think that they deserve
total control over your keys, and grab key combinations for a WYSIWYG
editor of some sort. And so whenever I try to edit a post in WordPress
(most of them are written in emacs and then copied over), I find
myself trying to go backwards a word, and inserting random
<code>&lt;strong&gt;</code> tags all over my post (Because <code>M-b</code> is
bound to make text bold, by WordPress&#8217;s editor). I finally got annoyed
enough to do some source-diving, and discovered that WordPress&#8217;s
editor constructs keyboard shortcuts using the HTML <a href="http://www.w3.org/TR/html5/editing.html#dfnReturnLink-0">accesskey</a>
attribute. This is easy enough to manipulate from Javascript, so I
went and wrote up a quick Greasemonkey user script. The bulk of it is
a simple XPath:</p>

<pre><code>    var buttons = document.evaluate('//input[@type="button"][@accesskey]', poststuff);
    var button;
</code></pre>

<p>You can <a href="http://nelhage.com/files/wp-keys.user.js">install the
script</a> off of nelhage.com.</p>

<p>Let me know if you find this useful, or if anyone figures out a
general way to disable (sets of) keyboard shortcuts for websites,
without relying on knowing the specific tricks that a website uses.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2010/06/disable-wordpress-edit-shortcuts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Window Manager I Want</title>
		<link>http://blog.nelhage.com/2010/05/the-window-manager-i-want/</link>
		<comments>http://blog.nelhage.com/2010/05/the-window-manager-i-want/#comments</comments>
		<pubDate>Sun, 09 May 2010 21:08:47 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[ratpoison]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[window manager]]></category>
		<category><![CDATA[xmonad]]></category>

		<guid isPermaLink="false">http://blog.nelhage.com/?p=220</guid>
		<description><![CDATA[Since I first discovered ratpoison in 2005 or so, I&#8217;ve basically exclusively used tiling window managers, going through, over the years, StumpWM, Ion 3, and finally XMonad. They&#8217;ve all had various strengths and weaknesses, but I&#8217;ve never been totally happy with any of them. This blog entry is a writeup of what I want to [...]]]></description>
			<content:encoded><![CDATA[<div id="outline-container-1" class="outline-2">
<div id="text-1">

<p>Since I first discovered <a href="http://www.nongnu.org/ratpoison/">ratpoison</a> in 2005 or so, I&#8217;ve basically
exclusively used tiling window managers, going through, over the
years, <a href="http://www.nongnu.org/stumpwm/">StumpWM</a>, <a href="http://en.wikipedia.org/wiki/Ion_(window_manager)">Ion 3</a>, and finally <a href="http://xmonad.org/">XMonad</a>. They&#8217;ve all had various
strengths and weaknesses, but I&#8217;ve never been totally happy with any
of them. This blog entry is a writeup of what I want to see as a
window manager. It&#8217;s possible that some day I&#8217;ll get annoyed enough to
write it, but maybe this post will inspire someone else to (Not
likely, but I can hope).
</p>

</div>

<div id="outline-container-1.1" class="outline-3">
<h3 id="sec-1.1">Layout </h3>
<div id="text-1.1">


<p>
At any given moment, the screen<sup><a class="footref" name="fnr.1" href="#fn.1">1</a></sup>
is divided into one or more <b>panes</b>. These panes always tile the
screen. Each pane may or may not currently be displaying a window. If
it is not, then the desktop will be displayed in that pane.
</p>
<p>
The primitive operations you can perform on the pane include, but are
not necessarily limited to:
</p>
<dl>
<dt>Split</dt><dd>
Splits the focused pane into two equally-sized panes,
either horizontally or vertically. One of the child panes
will display whichever window the previous pane displayed,
the other is empty.
</dd>
<dt>Resize</dt><dd>
Change the relative size of two child windows that were
split from the same parent.
</dd>
<dt>Kill Pane</dt><dd>
Destroy the current pane. If it is displaying a window,
that window is not sent a close message. The pane&#8217;s
sibling window expands to consume its space.
</dd>
<dt>Next/Previous pane</dt><dd>
Focus the next or previous pane. Panes are
ordered based on position on the screen, regardless of how they
were split to arrive at the current layout.
</dd>
<dt>Goto Pane</dt><dd>
Panes are numbered, based on their location on
screen. <code>Mod-N</code> focuses the Nth pane.

</dd>
</dl>
</div>

</div>

<div id="outline-container-1.2" class="outline-3">
<h3 id="sec-1.2">Selecting windows </h3>
<div id="text-1.2">


<p>
There is a global list of all windows. Windows are ordered arbitrarily
in this list (maybe based on the order they were opened?). Every
window has a name, which is initially set to the <code>WM_NAME</code> property
set by the window&#8217;s client.
</p>
<p>
The following operations are available to manipulate windows:
</p>
<dl>
<dt>Next/Previous Window</dt><dd>
Replace the window in the current panel with
the next or previous window in the list.
</dd>
<dt>Rename</dt><dd>
Prompts for a new name for the current window. If the user
enters an empty string, the window reverts to the default
behavior of using the <code>WM_NAME</code>.
</dd>
<dt>Goto Window</dt><dd>
Prompts for the name of a window to switch to. This
prompt matches on substrings or even sub-sequences of
the window name, displaying the result of the
selection as you type. After typing some characters,
you can scroll through the list to select an entry,
instead of completing typing.
</dd>
<dt>Kill</dt><dd>
Sends a close message to the window in the focused panel.

</dd>
</dl>
</div>

</div>

<div id="outline-container-1.3" class="outline-3">
<h3 id="sec-1.3">Desktops </h3>
<div id="text-1.3">


<p>
It seems likely I will want multiple desktops. Each desktop will have
its own pane layout. However, the window list is still global, not
per-desktop. <code>Goto Window</code> will always operate on the global window
list. Selecting a window that is visible through a pane somewhere else
causes that pane to become empty.
</p>
<p>
Alternately, there is no concept of multiple desktops. However, there
is the ability to save and restore layouts, meaning both the layout of
the panels on the screen, and the list of which window is in each
pane. The primary difference here is that a window can be associated
with multiple panes in different saved layouts, and gets resized/moved
as necessary as you switch panes. I suspect I like this model better.
</p>
</div>

</div>

<div id="outline-container-1.4" class="outline-3">
<h3 id="sec-1.4">Postscript </h3>
<div id="text-1.4">


<p>
If this sounds familiar to you, it probably should. What I&#8217;ve
described is essentially identical to how emacs manages buffers and
windows (analogous to X windows and panes in the above, respectively),
with <a href="http://www.emacswiki.org/emacs/window-number.el">window-number.el</a> and either <a href="http://www.emacswiki.org/emacs/IswitchBuffers">iswitchb</a> or <a href="http://www.emacswiki.org/emacs/InteractivelyDoThings">ido</a>. I manage hundreds
of buffers in emacs this way, and complicated screen layouts, whenever
I&#8217;m doing any hacking, and I love it.
</p>
<p>
I would in fact be tempted to write my window manager into emacs
itself, except for the annoying fact that emacs is very much
single-threaded. It&#8217;s already annoying enough when network drops and a
hung network filesystem takes down my emacs waiting for a timeout; It
would be utterly unacceptable if that took down my entire window
manager, too.
</p>

<p>
I&#8217;d alternately be tempted to try to make this an XMonad plugin, but I
think that it&#8217;s sufficiently different from XMonad&#8217;s data model that
the impedance mismatch would suck.
</p>

</div>
</div>
</div>

<p><div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">
<p class="footnote"><sup><a class="footnum" name="fn.1" href="#fnr.1">1</a></sup> I&#8217;m only going to consider the
single-monitor case for now, but the generalization should be easy.
</p>
</div>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2010/05/the-window-manager-i-want/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Conkeror</title>
		<link>http://blog.nelhage.com/2008/03/conkeror/</link>
		<comments>http://blog.nelhage.com/2008/03/conkeror/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 23:57:00 +0000</pubDate>
		<dc:creator>nelhage</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[conkeror]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://nelhage.scripts.mit.edu/madeofbugs/?p=8</guid>
		<description><![CDATA[I&#8217;ve recently switched to Conkeror as my primary browser. It started life as a Firefox extension, but nowadays it&#8217;s a standalone app built on top of Mozilla&#8217;s xulrunner, so it uses the Gecko rendering engine. What it is, is an emacs implemented in Javascript, for the web. This means on the one hand that it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently switched to <a href="http://conkeror.mozdev.org">Conkeror</a> as my primary
browser. It started life as a Firefox extension, but nowadays it&#8217;s a
standalone app built on top of Mozilla&#8217;s xulrunner, so it uses the
Gecko rendering engine.</p>

<p>What it is, is an emacs implemented in Javascript, for the web. This
means on the one hand that it <em>acts</em> like emacs. Most of the basic
emacs keybindings are supported &#8212; you open URLs with <code>C-x C-f</code>, and
have buffers you can switch between with <code>C-x b</code> and so on.</p>

<p>However, what is also means is that internally, it is fully an emacs,
with all the extensibility and all the other things that applies. The
UI you see is just code written on top of a generic core, that
implements the core emacs primitives, including</p>

<ul>
<li>The basic <code>buffer</code> datatype. But instead of being a plain text
store, it&#8217;s instead a full Gecko XUL/XHTML DOM.</li>
<li>A self-documenting <code>command</code> infrastructure and <code>variable</code>
infrastructure, that lets you look up the documentation and
definition of any command or configuration variable.</li>
<li><code>keymaps</code> accessible from javascript that map keys and
key sequences to commands, letting you rebind any key from your
configuration code, and define new modes with completely new
keybinding sets</li>
</ul>

<p>In other words, it really is not just an emacs-like frontend to
Gecko/Firefox, but is a full platform on top of xulrunner for writing
interactive applications in javascript/html/css like emacs.</p>

<p>I predict it&#8217;s only a matter of time before someone</p>

<ul>
<li>Adds the ability to edit local files and becomes a full text editor
that can actually start to <em>compete</em> with emacs. At that point
people will start to port things like <code>emacs-vc</code> and all the Nice
Things we&#8217;ve come to expect from emacs, and</li>
<li>Writes a mailreader for it ;)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nelhage.com/2008/03/conkeror/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

