<?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>Duplo &#187; emacs</title>
	<atom:link href="http://kill-0.com/duplo/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://kill-0.com/duplo</link>
	<description>Building Blocks &#38; Learning Experiences</description>
	<lastBuildDate>Fri, 18 May 2012 21:26:15 +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>Setting Your $PATH For Emacs On Mac OS X</title>
		<link>http://kill-0.com/duplo/2011/08/05/setting-your-path-for-emacs-on-mac-os-x/</link>
		<comments>http://kill-0.com/duplo/2011/08/05/setting-your-path-for-emacs-on-mac-os-x/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 15:30:11 +0000</pubDate>
		<dc:creator>ericw</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[rvm]]></category>

		<guid isPermaLink="false">http://kill-0.com/duplo/?p=178</guid>
		<description><![CDATA[I was having some trouble running rspec within Emacs. One of the gems in my Gemfile was pointing to a git repo, and as a result, bundle was shelling out through Emacs to check my revision using this method: def revision_from_git if File.exists?(scope('.git/HEAD')) Dir.chdir scope(".") do `git rev-parse HEAD` end end end Since my git [...]]]></description>
			<content:encoded><![CDATA[<p>I was having some trouble running <a href="https://github.com/pezra/rspec-mode"><tt>rspec</tt> within Emacs</a>.  One of the gems in my Gemfile was pointing to a git repo, and as a result, bundle was shelling out through Emacs to check my revision using this method:
<pre><code>def revision_from_git
  if File.exists?(scope('.git/HEAD'))
   Dir.chdir scope(".") do
     `git rev-parse HEAD`
    end
  end
end</code></pre>
<p>Since my <tt>git</tt> lives in a non-standard location, it was failing:<br />
<blockquote><code>/Users/xxxxxxxx/.rvm/gems/ruby-1.9.2-p290@global/bundler/gems/compass-91a748a91636/lib/compass/version.rb:48:in ``': No such file or directory - git rev-parse HEAD (Errno::ENOENT)</code></p></blockquote>
<p>Searching for a solution, I found a <a href="http://www.emacswiki.org/emacs/EmacsApp#toc2">page in the EmacsWiki</a> that dealt with this issue, but I didn&#8217;t care for any of the solutions there.  What I went with was to open <tt>~/.MacOSX/environment.plist</tt> with the Property List Editor, and add the path to my <tt>git</tt> executable to the <tt>PATH</tt> variable therein.  I then had to reboot.  The reboot seems to be the only way to get launchd to re-read this file.  I launch Emacs via Spotlight, and so it is started by launchd behind the scenes.  I tried using <tt>launchctl setenv</tt> first, as mentioned in the EmacsWiki, but that didn&#8217;t seem to work, I&#8217;m not sure why.</p>
<p>With the <tt>PATH</tt> variable set, rspec-mode, and rvm.el loaded, I was able to successfully run my specs from within Emacs.</p>
]]></content:encoded>
			<wfw:commentRss>http://kill-0.com/duplo/2011/08/05/setting-your-path-for-emacs-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs ruby-mode comment keybinding</title>
		<link>http://kill-0.com/duplo/2010/03/04/emacs-ruby-mode-comment-keybinding/</link>
		<comments>http://kill-0.com/duplo/2010/03/04/emacs-ruby-mode-comment-keybinding/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:52:57 +0000</pubDate>
		<dc:creator>ericw</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[ruby-mode]]></category>

		<guid isPermaLink="false">http://kill-0.com/duplo/?p=117</guid>
		<description><![CDATA[I&#8217;ve often been sad that there is no default keybinding for comment-region in Emacs&#8217;s ruby-mode. Eventually it annoyed me enough that I added one: (add-hook 'ruby-mode-hook (lambda () (define-key ruby-mode-map "\C-c#" 'comment-or-uncomment-region) ) ) This assigns C-c # to comment the current region, or if the current region is already commented, it will uncomment the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often been sad that there is no default keybinding for <tt>comment-region</tt> in Emacs&#8217;s <a href=" http://www.emacswiki.org/emacs/RubyMode">ruby-mode</a>.  Eventually it annoyed me enough that I added one:<code>
<pre>(add-hook 'ruby-mode-hook
	  (lambda ()
	    (define-key ruby-mode-map "\C-c#" 'comment-or-uncomment-region)
	    )
	  )</pre>
<p></code>This assigns <tt>C-c #</tt> to comment the current region, or if the current region is already commented, it will uncomment the region.</p>
<p>But what about when there&#8217;s no region currently marked?  It would be nice if emacs would (un)comment the current line.  To do this, I took a page from <a href="http://emacs-fu.blogspot.com/2009/11/copying-lines-without-selecting-them.html">DJCB at Emacs-fu</a>.<code>
<pre>(defadvice comment-or-uncomment-region (before slick-comment activate compile)
  "When called interactively with no active region, comment a single line instead."
  (interactive
   (if mark-active (list (region-beginning) (region-end))
     (list (line-beginning-position)
	   (line-beginning-position 2)))))
</pre>
<p></code>Now with nothing marked, pressing <tt>C-c #</tt> will cause emacs to toggle commenting on the current line.</p>
<p>In case it isn&#8217;t obvious, one should add the abbove snippets to their <tt>.emacs</tt> file to gain their benefits.</p>
]]></content:encoded>
			<wfw:commentRss>http://kill-0.com/duplo/2010/03/04/emacs-ruby-mode-comment-keybinding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

