<?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>code.h(oe)kje &#187; emacs</title>
	<atom:link href="http://joost.zeekat.nl/category/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://joost.zeekat.nl</link>
	<description>Webdevelopment en ander cools in Lisp Perl JavaScript &#38; Ruby.</description>
	<lastBuildDate>Thu, 09 May 2013 07:58:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>New zeekat website design</title>
		<link>http://joost.zeekat.nl/2013/05/09/new-zeekat-website-design/</link>
		<comments>http://joost.zeekat.nl/2013/05/09/new-zeekat-website-design/#comments</comments>
		<pubDate>Thu, 09 May 2013 07:52:39 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[emacs elisp pod org perl perldoc perlpod publish web]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/?p=90</guid>
		<description><![CDATA[This week, I re-implemented my main website. The text on the old one needed to be revised heavily (in fact I removed almost all of it except a short bio and some longer articles) and I wanted to experiment with a more colorful look. I need to revise the stylesheet a bit more to give [...]]]></description>
			<content:encoded><![CDATA[<p>This week, I re-implemented <a href="http://zeekat.nl/">my main website</a>. The text on the old one needed to be revised heavily (in fact I removed almost all of it except a short bio and some longer articles) and I wanted to experiment with a more colorful look. I need to revise the stylesheet a bit more to give a better experience on small screens (mobile), but so far I&#8217;m pleased with the result.</p>
<p>The new site html is generated completely by emacs&#8217; <a href="http://orgmode.org/">org-mode</a> project publishing functionality (the old one used a custom bunch of perl scripts generating from HTML snippets and perl POD documents). This hopefully means it&#8217;ll be easier to add and revise content, and it also provides nice syntax highlighting for any code snippets I put in my articles.</p>
<p>The whole switchover was pretty smooth, especially once I wrote a bit of elisp to roughly prepare conversion from POD formatting to org:</p>
<p><code><br />
(defun pod2org<br />
  (point mark)<br />
  "Rougly convert region from pod syntax to org-mode"<br />
  (interactive "r")<br />
  (replace-regexp "C<\\([^>]+\\)>" "=\\1=" nil point mark)<br />
  (replace-regexp "I<\\([^>]+\\)>" "/\\1/" nil point mark)<br />
  (replace-regexp "B<\\([^>]+\\)>" "*\\1*" nil point mark)<br />
  (replace-regexp "^=head1 \\(.*\\)" "* \\1" nil point mark)<br />
  (replace-regexp "^=head2 \\(.*\\)" "** \\1" nil point mark)<br />
  (replace-regexp "^=head3 \\(.*\\)" "*** \\1" nil point mark)<br />
  (replace-regexp "^=head4 \\(.*\\)" "**** \\1" nil point mark)<br />
  (replace-regexp "^=head5 \\(.*\\)" "***** \\1" nil point mark))<br />
</code></p>
<p>Very basic, but pretty useful.</p>
<p>Now, I&#8217;m considering replacing WordPress for this blog with org-mode too. That probably requires a bit more investigation. I want to keep at least the tags/categories feature and related rss feeds, and I&#8217;m not sure if that&#8217;s available for org at the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2013/05/09/new-zeekat-website-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See the incredible emacs config.</title>
		<link>http://joost.zeekat.nl/2012/11/03/see-the-incredible-emacs-config/</link>
		<comments>http://joost.zeekat.nl/2012/11/03/see-the-incredible-emacs-config/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 18:53:01 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/?p=81</guid>
		<description><![CDATA[Because people asked: my current emacs configuration is at https://github.com/joodie/emacs-config Note that it will not work as is, as it depends on my local file tree and specific installs from marmalade. So it&#8217;s mostly useful as a raw bucket of references to interesting stuff. Oh, and it includes my personal color theme, which may be [...]]]></description>
			<content:encoded><![CDATA[<p>Because people asked: my current emacs configuration is at <a href="https://github.com/joodie/emacs-config">https://github.com/joodie/emacs-config</a></p>
<p>Note that it will not work as is, as it depends on my local file tree and specific installs from marmalade. So it&#8217;s mostly useful as a raw bucket of references to interesting stuff. Oh, and it includes my personal color theme, which may be an interesting example of emacs 24&#8242;s new color-theme functionalities.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2012/11/03/see-the-incredible-emacs-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure-refactoring gets a little love, a new release and a new maintainer.</title>
		<link>http://joost.zeekat.nl/2011/10/24/clojure-refactoring-gets-a-new-maintainer/</link>
		<comments>http://joost.zeekat.nl/2011/10/24/clojure-refactoring-gets-a-new-maintainer/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 19:39:29 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2011/10/24/clojure-refactoring-gets-a-new-maintainer/</guid>
		<description><![CDATA[clojure-refactoring, the Emacs/SLIME based toolkit for doing refactoring wasn&#8217;t getting enough love and attention, so I fixed a few things. Tom Crayford unfortunately doesn&#8217;t have the time to work on it any further so I&#8217;m taking over as the maintainer. Inspect the code at the new &#8220;official&#8221; repository. For now, I&#8217;m focused on fixing parsing [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/joodie/clojure-refactoring">clojure-refactoring</a>, the Emacs/SLIME based toolkit for doing refactoring wasn&#8217;t getting enough love and attention, <a href="https://github.com/tcrayford/clojure-refactoring/pull/4">so I fixed a few things</a>. <a href="http://www.tcrayford.net/">Tom Crayford</a> unfortunately doesn&#8217;t have the time to work on it any further so I&#8217;m taking over as the maintainer. <a href="https://github.com/joodie/clojure-refactoring">Inspect the code at the new &#8220;official&#8221; repository</a>.</p>
<p>For now, I&#8217;m focused on fixing parsing issues first, then installing ease (I&#8217;m thinking about packaging everything Emacs-related on marmalade but that depends on what&#8217;s the easiest way to get stuff integrated for the user on the Emacs and Clojure sides). I&#8217;ve already removed the dependencies on out-dated libraries. Basically, everything I need to make the current functionality reliable enough for production use. Next up is support for clojure 1.3, probably, if that needs any work (I&#8217;m running 1.2 in production everywhere for now). </p>
<p>For the further future, I&#8217;d like this code to be useful for other editors/APIs/tools, so the SLIME/swank/Emacs specific stuff probably has to be separated out at some point. Some more refactorings will also be useful.</p>
<p>For now, <a href="http://clojars.org/joodie/clojure-refactoring">version 0.6.1 is on clojars.</a> Get it while it&#8217;s hot.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2011/10/24/clojure-refactoring-gets-a-new-maintainer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLIME hints #5 &#8211; slime-apropos</title>
		<link>http://joost.zeekat.nl/2011/02/10/slime-hints-5-slime-apropos/</link>
		<comments>http://joost.zeekat.nl/2011/02/10/slime-hints-5-slime-apropos/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 00:54:25 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2011/02/10/slime-hints-5-slime-apropos/</guid>
		<description><![CDATA[This is part of the series on SLIME functions. See the introduction for information on what SLIME is. Another very short post. Now what is the name of that function again? Which namespace contains that variable? Call slime-apropos; Default key-binding: C-c C-d C-a and type the part of the name you remember and SLIME will [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the series on SLIME functions. <a href="http://joost.zeekat.nl/2010/05/22/slime-hints-0-introduction-emacslisp-hacking-goodness/">See the introduction for information on what SLIME is.</a></p>
<p>Another very short post.</p>
<p>Now what is the name of that function again? Which namespace contains that variable?</p>
<p>Call <code>slime-apropos</code>; Default key-binding: <code>C-c C-d C-a</code> and type the part of the name you remember and SLIME will list all matching globals/symbols in the running program.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2011/02/10/slime-hints-5-slime-apropos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In search of a better keyboard; The IBM Model M</title>
		<link>http://joost.zeekat.nl/2010/09/01/in-search-of-a-better-keyboard-the-ibm-model-m/</link>
		<comments>http://joost.zeekat.nl/2010/09/01/in-search-of-a-better-keyboard-the-ibm-model-m/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 20:55:37 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[better-keyboards]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[ibm model m]]></category>
		<category><![CDATA[keyboards]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/09/01/in-search-of-a-better-keyboard-the-ibm-model-m/</guid>
		<description><![CDATA[By far the oldest board in this series. Production of these things started in 1985 and slightly modified versions are still being build by Unicomp (the Customizers are the closest to the standard IBM Model M, but always make sure you pick the Buckling Spring versions, see below). Build quality I&#8217;ve been using a Model [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://joost.zeekat.nl/wp-content/model-m.jpg' alt='IBM Model M, full size 101-key version' /></p>
<p>By far the oldest board in this series. Production of these things started in 1985 and <a href="http://pckeyboards.stores.yahoo.net/keyboards.html">slightly modified versions are still being build by Unicomp</a> (the Customizers are the closest to the standard IBM Model M, but always make sure you pick the Buckling Spring versions, see below).</p>
<h3>Build quality</h3>
<p>I&#8217;ve been using a Model M keyboard for the last couple of years, and in many respects it&#8217;s the best keyboard I&#8217;ve ever used: it&#8217;s very sturdy, will last for decades (mine is 15 years old and still working fine) and the key switches are phenomenal.</p>
<h3>Layout</h3>
<p>This was one of the first keyboards with what&#8217;s now more or less the standard PC layout and it&#8217;s probably the reason that that layout became so popular. Probably not remarkable &#8211; even boring &#8211; these days, but on the whole it&#8217;s very well thought out and effective. Especially if you map the CAPS Lock key to Control (Unicomp sells models with CAPS and Left-CTRL swapped, but you can swap the keys on any OS and I don&#8217;t really see the point of looking at a keyboard when you&#8217;re typing on it).</p>
<h3>Buckling Spring switch technology</h3>
<p>The switches work via a so called &#8220;buckling spring&#8221; mechanism, which means every key is set on top of a fairly long spring that &#8220;collapses&#8221; sideways when you&#8217;ve pressed the key about half way down and activates the mechanical &#8220;hammer&#8221; attached to the bottom of the spring. You can easily feel when that is about to happen, and once it does you can feel the key &#8220;give&#8221; and it makes a very satisfying CLICK sound.</p>
<p>On this keyboard you simply can&#8217;t get fooled about whether you&#8217;ve pressed a key or not: the auditory and tactile feedback is very immediate.</p>
<h3>Issues</h3>
<p>As you can probably tell, I really like this keyboard, but there a few issues with it that are annoying:</p>
<h3>Size</h3>
<p>This is a large keyboard, even for a full size standard layout: the MS Natural 4000 has a big wrist rest and a &#8220;split&#8221; main cluster and it&#8217;s still only marginally larger than the Model M.</p>
<p>Size is especially important if you&#8217;re a right handed mouse user. With the num-pad to the right, your mouse is quite a long way away from the main alphanumeric cluster where your hands are when you&#8217;re typing, which means that you&#8217;re not always using an optimal position for the mouse, the keyboard or both. You can tell these things were invented before PCs had mice.</p>
<p><a href="http://www.clickykeyboards.com/index.cfm/fa/categories.main/parentcat/9242">There used to be Model M variants that didn&#8217;t have a numeric key pad</a>, but production of those stopped somewhere in the early &#8217;90s. Expect them to be expensive &#8211; if you can find one. Ebay US seems to have a few, but once you include shipping, you might want to consider something else if you live in Europe. Clickykeyboards (where that link is to) sells them for fairly reasonable prices, but they don&#8217;t seem to have them all that often &#8211; and you still have to pay shipping from the US.</p>
<h3>Finger fatigue</h3>
<p>The switches on these keyboards are very good, but also quite heavy: they require noticeably more force than most conventional keyboards. You get used to it, especially since the force is consistent over all keys, but for me, it&#8217;s just barely on the edge of &#8220;too heavy&#8221;.</p>
<h3>Sound</h3>
<p>The click sound, while satisfying, can get on your nerves late at night. Not that much of an issue for me, but sometimes you just wish it made a bit less noise. If you have coworkers or family in the same room, I expect they won&#8217;t like this keyboard much.</p>
<h3>Pro: price</h3>
<p>On the other hand, second hand full-size Model Ms are cheap and not that hard to get. New ones from Unicomp are also very competitively priced compared to other well-built keyboards with mechanical switches (the basic model is $69), even if you have to ship them across the Atlantic.</p>
<p>Previous episode: <b><a href="http://joost.zeekat.nl/2010/08/29/in-search-of-a-better-keyboard-early-history/">In search of a better keyboard &#8211; Early history</a></b>.</p>
<p>Next episode: <b>what now?</b> (not finished, stay tuned).</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/09/01/in-search-of-a-better-keyboard-the-ibm-model-m/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In search of a better keyboard; Early history</title>
		<link>http://joost.zeekat.nl/2010/08/29/in-search-of-a-better-keyboard-early-history/</link>
		<comments>http://joost.zeekat.nl/2010/08/29/in-search-of-a-better-keyboard-early-history/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 20:04:23 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[better-keyboards]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[keyboards]]></category>
		<category><![CDATA[microsoft natural]]></category>
		<category><![CDATA[ms natural]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/08/29/in-search-of-a-better-keyboard-early-history/</guid>
		<description><![CDATA[When you&#8217;re typing as much as I do, sooner or later you realize that having a good keyboard is important. Years ago I was having issues with wrist-pain and switching keyboards was &#8211; for me &#8211; a very effective way of almost eliminating the problem. But this is not about health issues directly. What I [...]]]></description>
			<content:encoded><![CDATA[<p>When you&#8217;re typing as much as I do, sooner or later you realize that having a good keyboard is important. Years ago I was having issues with wrist-pain and switching keyboards was &#8211; for me &#8211; a very effective way of almost eliminating the problem.</p>
<p>But this is not about health issues directly. What I found is that the best way to stay healthy while working is to keep irritation to a minumum, and keyboards can do a lot of things that are just plainly annoying:</p>
<ul>
<li> Keys in wierd and/or hard to reach places
<li> Keys in half-size
<li> Keys that only work most of the time
<li> Keys that are much harder to press than the others
</ul>
<p>Looking at that list, there are two main things that can go wrong: keyboard layout and the key switch technology. I&#8217;m going to address both throughout this short series.</p>
<p>I&#8217;m going to present the main keyboards I&#8217;ve used in chronological order (that is; order that I used them), but I&#8217;m ignoring the very early stuff. Some were not that good (Commodore 64), some were horrible (Atari 400, I&#8217;m not even sure if I&#8217;d call that thing you&#8217;ve got a keyboard) and some were pretty nice (like the Amiga 500). My focus is on keyboards that are still available and useful to today&#8217;s PC or Mac user.</p>
<p>As an example of frustrating design, I present:</p>
<h2>The MS Natural Elite</h2>
<p><img src='http://joost.zeekat.nl/wp-content/ms-natural-elite.jpg' alt='MS Natural Elite keyboard' /></p>
<p>All in all it&#8217;s not a bad board; they&#8217;re cheap and they&#8217;re fairly pleasant to type on with light-weight keys, but all the navigation keys are in half-size AND in non-standard places (and yet close enough to the standard locations to get really confusing). Get used to pressing INSERT instead of END and fumbling for the cursor keys. Bad, ugly and unnessessary. Also, in my experience, they break after 3 years or so.</p>
<h2>The MS Natural 4000</h2>
<p>The successor to the Elite that solved most of the issues with the layout, but the modifier keys and especially the space bar were so heavy I found myself slamming my thumbs on them which can&#8217;t be good.</p>
<p>The extras, like the horrible multimedia &#8220;keys&#8221; and the vertical &#8220;joystick&#8221; or whatever that thing is, I won&#8217;t further address, since I never used them.</p>
<p><img src='http://joost.zeekat.nl/wp-content/ms-natural-4000.jpg' alt='ms-natural-4000.jpg' /></p>
<p>Also, it broke down after only a year. Not good at all for a keyboard that cost about 60 euros at the time.</p>
<p>By now I was getting frustrated by key switches, and I wanted something that would actually let me type in a consistent way and KNOW that I was really pressing a key when I thought I was, without me having to slam every one of them into the ground.</p>
<p>Which brings me to the next post: <b><a href="http://joost.zeekat.nl/2010/09/01/in-search-of-a-better-keyboard-the-ibm-model-m/">In search of a better keyboard; The IBM Model M</a></b>.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/08/29/in-search-of-a-better-keyboard-early-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLIME hints #4 &#8211; slime-who-calls</title>
		<link>http://joost.zeekat.nl/2010/06/09/slime-hints-4-slime-who-calls/</link>
		<comments>http://joost.zeekat.nl/2010/06/09/slime-hints-4-slime-who-calls/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 08:49:41 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/06/09/slime-hints-4-slime-who-calls/</guid>
		<description><![CDATA[This is part of the series on SLIME functions. See the introduction for information on what SLIME is. Just a short post today. The slime-who-calls function (default binding &#8220;C-c C-w c&#8221;) lists every function that calls the given function (default argument is the symbol under the cursor). You can press ENTER on that list to [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the series on SLIME functions. <a href="http://joost.zeekat.nl/2010/05/22/slime-hints-0-introduction-emacslisp-hacking-goodness/">See the introduction for information on what SLIME is.</a></p>
<p>Just a short post today.</p>
<p>The <code>slime-who-calls</code> function (default binding &#8220;C-c C-w c&#8221;) lists every function that calls the given function (default argument is the symbol under the cursor). You can press ENTER on that list to go to the listed definition. Beats using M-x rgrep for convenience, but &#8211; at least with Clojure code &#8211; it doesn&#8217;t catch every call; second-order function calls aren&#8217;t caught.</p>
<p><i>For those readers using Clojure</i>, you need <a href="http://github.com/technomancy/swank-clojure/blob/master/NEWS">a pretty recent version of swank-clojure</a> for this to work &#8211; and it seems to also list function definitions with the same name as the argument, which I think isn&#8217;t correct</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/06/09/slime-hints-4-slime-who-calls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLIME hints #3b &#8211; lexical completions, also: a correction</title>
		<link>http://joost.zeekat.nl/2010/06/04/slime-hints-3b-lexical-completions-also-a-correction/</link>
		<comments>http://joost.zeekat.nl/2010/06/04/slime-hints-3b-lexical-completions-also-a-correction/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 19:30:38 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/06/04/slime-hints-3b-lexical-completions-also-a-correction/</guid>
		<description><![CDATA[New code! As I noted in yesterday&#8217;s post, slime-complete-symbol normally doesn&#8217;t complete locally bound &#8220;variables&#8221; (that is, function arguments and let bindings). I&#8217;ve created a SLIME extension that does a pretty rough scan of the current top-level form and adds all the matching symbols in the form into the list of suggested completions. If you [...]]]></description>
			<content:encoded><![CDATA[<h3>New code!</h3>
<p>As I noted in <a href="http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/">yesterday&#8217;s post</a>, <code>slime-complete-symbol</code> normally doesn&#8217;t complete locally bound &#8220;variables&#8221; (that is, function arguments and let bindings).</p>
<p>I&#8217;ve created a SLIME extension that does a pretty rough scan of the current top-level form and adds all the matching symbols in the form into the list of suggested completions. If you want to check it out, <a href="http://github.com/joodie/slime-complete-locals">slime-complete-locals is available on github</a>.</p>
<h3>A correction</h3>
<p>Also, if you missed the update on yesterday&#8217;s post, make sure you add the right forms to <code>smart-tab-completion-functions-alist</code> &#8211; the key in that alist should be the MAJOR mode. So using slime-mode (like I did yesterday) will not work. It must be clojure-mode or whatever the major mode for your lisp editing is.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/06/04/slime-hints-3b-lexical-completions-also-a-correction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLIME hints #3 &#8211; interactive completions and smart tabs</title>
		<link>http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/</link>
		<comments>http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 19:30:38 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/</guid>
		<description><![CDATA[This is part of the series on SLIME functions. See the introduction for information on what SLIME is. Today I want to address auto-completion. There are many different Emacs extensions for doing completions, but the basic functionality in SLIME is provided by the function slime-complete-symbol, which takes the symbol under the cursor and expands it, [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the series on SLIME functions. <a href="http://joost.zeekat.nl/2010/05/22/slime-hints-0-introduction-emacslisp-hacking-goodness/">See the introduction for information on what SLIME is.</a></p>
<p>Today I want to address auto-completion. There are many different Emacs extensions for doing completions, but the basic functionality in SLIME is provided by the function <code>slime-complete-symbol</code>, which takes the symbol under the cursor and expands it, using whatever symbols are reachable at that point in the code<sup><a href="#note1">1]</a></sup>. The way I have it set up is a bit tricky, though, so here&#8217;s how it works:</p>
<p>I really prefer expansions to be bound to the TAB key. But the TAB key is also used to indent code. It&#8217;s possible to have it &#8220;do what I mean&#8221;, and the easiest method I found for that is to use <a href="http://www.emacswiki.org/emacs/SmartTabs">Smart Tabs</a> (<a href="http://github.com/haxney/smart-tab">see also the github repo</a>). </p>
<p>Smart tab determines the expansion function to use based on the major mode of the current buffer*. So I&#8217;ve got the following in my configuration:</p>
<p><code>
<pre>
(require 'smart-tab) ;; make sure smart-tab.el is reachable in your load-path first
(global-smart-tab-mode 1) ;; switch on smart-tab everywhere

(setq smart-tab-completion-functions-alist 
      '((emacs-lisp-mode . lisp-complete-symbol) 
        (text-mode . dabbrev-completion) ;; this is the "default" emacs expansion function
        (clojure-mode . slime-complete-symbol))) ;; see update below
</pre>
<p></code></p>
<p>Now, whenever I press TAB and the cursor is at the end of a symbol, it gets expanded. If I press TAB on any other place, that indents that line.</p>
<p>There&#8217;s a lot of stuff you can customize with expansions and auto completion, but this will give you the basics quickly and without too much hassle.</p>
<p><a name="note1">1]</a> For Clojure code, at least, this boils down to; every symbol that is defined (or imported etc) in the current name space. This has two consequences: </p>
<ul>
<li>It only applies to code that has already been loaded into the program, so you will want to compile stuff pretty much immediately once you&#8217;ve written or modified it.
<li>It does not expand let bindings or function arguments, since those are lexically scoped and cannot be retrieved from the name space. There is probably a way to fix this, but I haven&#8217;t looked into the problem that far.
</ul>
<p>* <i>Update</i>: the smart tab configuration must be keyed off the MAJOR mode. So slime-mode . slime-complete-symbol will not work, since slime-mode isn&#8217;t a major mode. I replaced it here with clojure-mode.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/06/03/slime-hints-3-interactive-completions-and-smart-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLIME hints #2 &#8211; slime-compile-and-load-file vs other slime-compile functions</title>
		<link>http://joost.zeekat.nl/2010/05/27/slime-hints-2-slime-compile-and-load-file-vs-other-slime-compile-functions/</link>
		<comments>http://joost.zeekat.nl/2010/05/27/slime-hints-2-slime-compile-and-load-file-vs-other-slime-compile-functions/#comments</comments>
		<pubDate>Thu, 27 May 2010 18:44:59 +0000</pubDate>
		<dc:creator>Joost</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[slime-hints]]></category>

		<guid isPermaLink="false">http://joost.zeekat.nl/2010/05/27/slime-hints-2-slime-compile-and-load-file-vs-other-slime-compile-functions/</guid>
		<description><![CDATA[This is part of the series on SLIME functions. See the introduction for information on what SLIME is. SLIME has a bunch of different functions that compile code from a file buffer into the running Lisp process. I&#8217;ll list a few of them here, and end with why you normally want to use slime-compile-and-load-file instead [...]]]></description>
			<content:encoded><![CDATA[<p>This is part of the series on SLIME functions. <a href="http://joost.zeekat.nl/2010/05/22/slime-hints-0-introduction-emacslisp-hacking-goodness/">See the introduction for information on what SLIME is.</a></p>
<p>SLIME has a bunch of different functions that compile code from a file buffer into the running Lisp process.</p>
<p>I&#8217;ll list a few of them here, and end with why you normally want to use <code>slime-compile-and-load-file</code> instead of any of the other ones.</p>
<ol>
<li><code>slime-eval-last-expression</code> (default key-binding &#8220;C-x C-e&#8221;) evaluates the expression right before point (the cursor). This is occasionally useful because it&#8217;s a quick way to evaluate part of a larger expression. For instance, say I&#8217;ve got this code, with <b style="color: red">|</b> indication the cursor position:
<p><code>
<pre>
(defn connection-middleware [handler]
  (fn [request]
    (with-db *db*<b style="color: red">|</b>
      (handler request))))
</pre>
<p></code></p>
<p>When I call <code>slime-eval-last-expression</code>, the message line at the bottom of my Emacs screen shows the value of the var *db*.</p>
<li><code>slime-compile-defun</code> (default key binding: &#8220;C-c C-c&#8221;) evaluates the current definition (from the current cursor position downwards). It doesn&#8217;t have to be a function definition (at least not for clojure code); all of the common (def&#8230;) forms will work. This is useful if you made a quick update to a single definition and want to load it into the current process without loading anything else.
<p>In other words, given the earlier code and cursor position:</p>
<p><code>
<pre>
(defn connection-middleware [handler]
  (fn [request]
    (with-db *db*<b style="color: red">|</b>
      (handler request))))
</pre>
<p></code></p>
<p>Calling slime-compile-defun will evaluate the whole <code>connection-middleware</code> function.</p>
<li><code>slime-compile-region</code> (no default binding) evaluates whatever you&#8217;ve currently selected.
<li><code>slime-compile-and-load-file</code> (default binding: &#8220;C-c C-k&#8221;) compiles and loads the whole file.
<p>It&#8217;s the easiest method to compile stuff since you don&#8217;t need to have your cursor on any particular position, but the main reason to do this instead of, say, <code>slime-compile-defun</code> is that this gives you much more reasonable error messages.</p>
<p>When you call any of the other compile functions, any errors you get back while compiling or later will not refer to a file and line number. This makes it a lot harder to find the error in your source code (even errors in other parts of the same file may now not refer to the right lines either, if you moved or resized your definition). </p>
<p>In addition, compile errors will be noted using the standard M-n and M-p key bindings for compiler errors &#8211; in this case, using the functions (slime-next-note) and (slime-previous-note) respectively. These will navigate to the given error, and display the particular error on that line the echo buffer.
</ol>
<p>To recap, unless you want to evaluate a particular value in a source file or you&#8217;re working in a &#8220;scratch&#8221; buffer with all kinds of stuff in it, you generally want to compile the whole file as a unit, since it makes the most sense if anything goes wrong.</p>
<p><i>updates:</i> Corrected the default binding of slime-compile-and-load-file. Thanks to Don Jackson for reporting the mistake.</p>
]]></content:encoded>
			<wfw:commentRss>http://joost.zeekat.nl/2010/05/27/slime-hints-2-slime-compile-and-load-file-vs-other-slime-compile-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
