<?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>kidder&#039;s blog &#187; lisp</title>
	<atom:link href="http://www.thekidder.com/tag/lisp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thekidder.com</link>
	<description></description>
	<lastBuildDate>Sat, 22 May 2010 07:07:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>emacs &#8211; Reload File</title>
		<link>http://www.thekidder.com/2008/10/21/emacs-reload-file/</link>
		<comments>http://www.thekidder.com/2008/10/21/emacs-reload-file/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 23:21:29 +0000</pubDate>
		<dc:creator>thekidder</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[lisp]]></category>

		<guid isPermaLink="false">http://www.thekidder.net/blargh/?p=11</guid>
		<description><![CDATA[I wrote my first emacs lisp function today. Emacs is a little annoying when the files get changed outside of the editor &#8211; such as when you are working with svn. I found several methods to tell emacs to reload the file (C-x C-v) but they all have one caveat: they forget where you are [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote my first emacs lisp function today. Emacs is a little annoying when the files get changed outside of the editor &#8211; such as when you are working with svn. I found several methods to tell emacs to reload the file (C-x C-v) but they all have one caveat: they forget where you are in the buffer. I fixed this situation with a short function:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> reload-file <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>curr-scroll <span style="color: #66cc66;">&#40;</span>window-vscroll<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>find-file <span style="color: #66cc66;">&#40;</span>buffer-<span style="color: #b1b100;">name</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>set-window-vscroll <span style="color: #b1b100;">nil</span> curr-scroll<span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#40;</span>message <span style="color: #ff0000;">&quot;Reloaded file&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\C</span>-c<span style="color: #000099; font-weight: bold;">\C</span>-r&quot;</span> 'reload-file<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Put that in .emacs, and you simply have to type C-c C-r to reload the current file (while saving your scroll position!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thekidder.com/2008/10/21/emacs-reload-file/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
