<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Zing-Ming &#187; emacs</title>
	<atom:link href="http://zingming.wordpress.com/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://zingming.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 28 Aug 2012 04:04:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='zingming.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/7b318f583a7e42ca5ebe3ad324b6dcfd?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Zing-Ming &#187; emacs</title>
		<link>http://zingming.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zingming.wordpress.com/osd.xml" title="Zing-Ming" />
	<atom:link rel='hub' href='http://zingming.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Emacs Extension: Binary-search-inspired movement</title>
		<link>http://zingming.wordpress.com/2010/12/21/emacs-extension-binary-search-inspired-movement/</link>
		<comments>http://zingming.wordpress.com/2010/12/21/emacs-extension-binary-search-inspired-movement/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 03:46:57 +0000</pubDate>
		<dc:creator>Zing-Ming</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[binary search]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://zingming.wordpress.com/?p=252</guid>
		<description><![CDATA[Moving forward and backward word-by-word is inefficient, so I thought it would be useful to reduce the distance between your cursor and your desired position on the line using something like binary search. If you load this emacs extension (in &#8230; <a href="http://zingming.wordpress.com/2010/12/21/emacs-extension-binary-search-inspired-movement/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zingming.wordpress.com&#038;blog=10536121&#038;post=252&#038;subd=zingming&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Moving forward and backward word-by-word is inefficient, so I thought it would be useful to reduce the distance between your cursor and your desired position on the line using something like binary search. </p>
<p>If you load this emacs extension (in your <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html">init file</a>, etc.), then C M-f will move your cursor forward to the midpoint between the current position and the end of the line. C M-b will move your cursor backward to the midpoint between the current position and the beginning of the line.</p>
<pre class="brush: plain; light: true; title: ; notranslate">(global-set-key &quot;\C-\M-b&quot; 'backward-midpoint)
(global-set-key &quot;\C-\M-f&quot; 'forward-midpoint)

(defun backward-midpoint ( )
&quot;Move backward to midpoint between current position and beginning of line.&quot;
(interactive)
(backward-char (/ (- (point) (line-beginning-position)) 2)))

(defun forward-midpoint ( )
&quot;Move forward to midpoint between current position and end of line.&quot;
(interactive)
(forward-char (/ (- (line-end-position) (point)) 2)))
</pre>
<p>This is not the same as binary search, because C M-f, C M-f, C M-b will move the cursor to a position that is before the midpoint of the line. However, it has some properties of binary search and it is practically more useful than word-by-word linear search.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zingming.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zingming.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zingming.wordpress.com&#038;blog=10536121&#038;post=252&#038;subd=zingming&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://zingming.wordpress.com/2010/12/21/emacs-extension-binary-search-inspired-movement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/42ef035b80ffbcd6b4c9237c3f1469ec?s=96&#38;d=wavatar&#38;r=G" medium="image">
			<media:title type="html">Zing-Ming</media:title>
		</media:content>
	</item>
	</channel>
</rss>
