<?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>emacs &#8211; CS@Worcester</title>
	<atom:link href="https://cs.worcester.edu/category/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>https://cs.worcester.edu</link>
	<description>Worcester State University Computer Science Department</description>
	<lastBuildDate>Mon, 30 Dec 2013 16:30:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
<site xmlns="com-wordpress:feed-additions:1">236835116</site>	<item>
		<title>Syncing Required Packages in Emacs</title>
		<link>http://dthompson.us/syncing-required-packages-in-emacs.html</link>
		
		<dc:creator><![CDATA[David Thompson]]></dc:creator>
		<pubDate>Mon, 30 Dec 2013 16:30:00 +0000</pubDate>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[WSU]]></category>
		<guid isPermaLink="false">http://cs.worcester.edu/blog/?guid=b8080008e1a1d9e22f3b24d521756a59</guid>

					<description><![CDATA[<p>I use Emacs on several different computers.  To keep my configuration
consistent across all of them, I do what many people do and made the
<tt><span>~/.emacs.d</span></tt> directory a <a href="https://github.com/davexunit/.emacs.d">git repository</a>.  I don't like to keep
copies of all of the Elisp extensions that I use, such as paredit and
geiser, in this repository.  Instead, I prefer to use package.el
(introduced in Emacs 24) with the <a href="http://melpa.milkbox.net/">MELPA</a> repository.  This saves me
from having to manually keep all of the extensions I use up-to-date,
but requires another method to keep useful packages in sync between
computers.</p>
<p>There's a project called <a href="https://github.com/rdallasgray/pallet">Pallet</a> that solves this problem, but it was
too heavy for my liking.  Instead, I wrote a short function that
simply iterates over a list of required packages and installs those
that are not currently installed.</p>
<div><pre><span>;; Additional packages that I use.</span>
 <span>(</span><span>setq</span> <span>required-packages</span>
       <span>'</span><span>(</span><span>better-defaults</span>
         <span>elfeed</span>
         <span>geiser</span>
         <span>ido-ubiquitous</span>
         <span>js2-mode</span>
         <span>magit</span>
         <span>paredit</span>
         <span>rainbow-delimiters</span>
         <span>smex</span><span>))</span>

 <span>(</span><span>defun</span> <span>install-missing-packages</span> <span>()</span>
   <span>"Install all required packages that haven't been installed."</span>
   <span>(</span><span>interactive</span><span>)</span>
   <span>(</span><span>mapc</span> <span>(</span><span>lambda</span> <span>(</span><span>package</span><span>)</span>
           <span>(</span><span>unless</span> <span>(</span><span>package-installed-p</span> <span>package</span><span>)</span>
             <span>(</span><span>package-install</span> <span>package</span><span>)))</span>
         <span>required-packages</span><span>)</span>
   <span>(</span><span>message</span> <span>"Installed all missing packages!"</span><span>))</span>
</pre></div>
<p>Now, it's as easy as typing <tt><span>M-x</span> <span>install-missing-packages</span> RET</tt> when
starting Emacs for the first time on a new computer to download all of
the extensions that I need.  Note that before calling
<tt><span>install-missing-packages</span></tt> you must have already initialized the
package manager via the <tt><span>package-initialize</span></tt> function.  This
approach does require some manual bookkeeping in order to keep the
<tt><span>required-packages</span></tt> list up-to-date with your workflow, but I
haven't found it to be problematic.</p>
<p>Update: If this solution is too simplistic for you, you should check
out <a href="https://github.com/jwiegley/use-package">use-package</a>, which reddit user <a href="http://www.reddit.com/user/lunaryorn">lunayorn</a> pointed out to
me.  Thanks!</p>
<p>Check out the comments on <a href="http://www.reddit.com/r/emacs/comments/1u0xr4/quick_hack_syncing_required_packages_in_emacs/">reddit</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>I use Emacs on several different computers.  To keep my configuration<br />
consistent across all of them, I do what many people do and made the<br />
<tt class="docutils literal"><span class="pre">~/.emacs.d</span></tt> directory a <a class="reference external" href="https://github.com/davexunit/.emacs.d">git repository</a>.  I don&#8217;t like to keep<br />
copies of all of the Elisp extensions that I use, such as paredit and<br />
geiser, in this repository.  Instead, I prefer to use package.el<br />
(introduced in Emacs 24) with the <a class="reference external" href="http://melpa.milkbox.net/">MELPA</a> repository.  This saves me<br />
from having to manually keep all of the extensions I use up-to-date,<br />
but requires another method to keep useful packages in sync between<br />
computers.</p>
<p>There&#8217;s a project called <a class="reference external" href="https://github.com/rdallasgray/pallet">Pallet</a> that solves this problem, but it was<br />
too heavy for my liking.  Instead, I wrote a short function that<br />
simply iterates over a list of required packages and installs those<br />
that are not currently installed.</p>
<div class="highlight">
<pre><span class="c1">;; Additional packages that I use.</span>
 <span class="p">(</span><span class="k">setq</span> <span class="nv">required-packages</span>
       <span class="o">&#39;</span><span class="p">(</span><span class="nv">better-defaults</span>
         <span class="nv">elfeed</span>
         <span class="nv">geiser</span>
         <span class="nv">ido-ubiquitous</span>
         <span class="nv">js2-mode</span>
         <span class="nv">magit</span>
         <span class="nv">paredit</span>
         <span class="nv">rainbow-delimiters</span>
         <span class="nv">smex</span><span class="p">))</span>

 <span class="p">(</span><span class="nb">defun</span> <span class="nv">install-missing-packages</span> <span class="p">()</span>
   <span class="s">&quot;Install all required packages that haven&#39;t been installed.&quot;</span>
   <span class="p">(</span><span class="nv">interactive</span><span class="p">)</span>
   <span class="p">(</span><span class="nb">mapc</span> <span class="p">(</span><span class="k">lambda</span> <span class="p">(</span><span class="nc">package</span><span class="p">)</span>
           <span class="p">(</span><span class="nb">unless</span> <span class="p">(</span><span class="nv">package-installed-p</span> <span class="nc">package</span><span class="p">)</span>
             <span class="p">(</span><span class="nv">package-install</span> <span class="nc">package</span><span class="p">)))</span>
         <span class="nv">required-packages</span><span class="p">)</span>
   <span class="p">(</span><span class="nv">message</span> <span class="s">&quot;Installed all missing packages!&quot;</span><span class="p">))</span>
</pre>
</div>
<p>Now, it&#8217;s as easy as typing <tt class="docutils literal"><span class="pre">M-x</span> <span class="pre">install-missing-packages</span> RET</tt> when<br />
starting Emacs for the first time on a new computer to download all of<br />
the extensions that I need.  Note that before calling<br />
<tt class="docutils literal"><span class="pre">install-missing-packages</span></tt> you must have already initialized the<br />
package manager via the <tt class="docutils literal"><span class="pre">package-initialize</span></tt> function.  This<br />
approach does require some manual bookkeeping in order to keep the<br />
<tt class="docutils literal"><span class="pre">required-packages</span></tt> list up-to-date with your workflow, but I<br />
haven&#8217;t found it to be problematic.</p>
<p>Update: If this solution is too simplistic for you, you should check<br />
out <a class="reference external" href="https://github.com/jwiegley/use-package">use-package</a>, which reddit user <a class="reference external" href="http://www.reddit.com/user/lunaryorn">lunayorn</a> pointed out to<br />
me.  Thanks!</p>
<p>Check out the comments on <a class="reference external" href="http://www.reddit.com/r/emacs/comments/1u0xr4/quick_hack_syncing_required_packages_in_emacs/">reddit</a>.</p>

<p class="syndicated-attribution"><em>From the blog <a href="http://dthompson.us/">dthompson</a> by <a href="https://cs.worcester.edu/author/0/" title="Read other posts by David Thompson">David Thompson</a></em> and used with permission of the author. All other rights reserved by the author.</p>]]></content:encoded>
					
		
		<enclosure url="" length="0" type="" />

		<post-id xmlns="com-wordpress:feed-additions:1">2779</post-id>	</item>
		<item>
		<title>Jump to Jasmine Specs with Rinari</title>
		<link>http://dthompson.us/jump-to-jasmine-specs-with-rinari.html</link>
		
		<dc:creator><![CDATA[David Thompson]]></dc:creator>
		<pubDate>Tue, 17 Dec 2013 18:00:00 +0000</pubDate>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[WSU]]></category>
		<guid isPermaLink="false">http://cs.worcester.edu/blog/?guid=35fa769e43255a0476a49e1438a19b58</guid>

					<description><![CDATA[<p>I use the <a href="https://github.com/eschulte/rinari">rinari</a> Emacs mode to assist me when working on rails
projects.  One of rinari's most useful features is the ability to
quickly jump from one file to another related file.  I use this
feature almost exclusively for jumping between a ruby class file and
its associated rspec file, but lately I've been spending most of my
time writing javascript.  At VHL, we use <a href="http://pivotal.github.io/jasmine/">jasmine</a> for our unit testing
framework and the <a href="https://github.com/pivotal/jasmine-gem">jasmine ruby gem</a> to integrate it with our rails
projects.  Rinari doesn't have any built-in jump settings for jasmine
test files, so I wrote this quick hack to make it work:</p>
<div><pre><span>;; Make rinari jump to/from javascript source files and specs.</span>
<span>(</span><span>setcdr</span> <span>(</span><span>assoc</span> <span>'javascript</span> <span>rinari-jump-schema</span><span>)</span>
        <span>'</span><span>(</span><span>"j"</span>
          <span>((</span><span>"app/assets/javascripts/\\1.js"</span> <span>.</span> <span>"spec/javascripts/\\1_spec.js"</span><span>)</span>
           <span>(</span><span>"spec/javascripts/\\1_spec.js"</span>  <span>.</span> <span>"app/assets/javascripts/\\1.js"</span><span>)</span>
           <span>(</span><span>t</span> <span>.</span> <span>"spec/javascripts/.*"</span><span>)</span>
           <span>(</span><span>t</span> <span>.</span> <span>"app/javascripts/.*"</span><span>))</span>
          <span>t</span><span>))</span>
<span>(</span><span>rinari-apply-jump-schema</span> <span>rinari-jump-schema</span><span>)</span>
</pre></div>
<p>Now I can press <tt><span>C-c</span> ; f j</tt> to jump between a javascript file in
<tt>app/assets/javascripts/</tt> and its jasmine test file in
<tt>spec/javascripts/</tt>.  Perhaps I shouldn't be overwriting the
predefined (but not very useful) javascript jump settings, but I
really wanted to use the <tt>j</tt> key.</p>]]></description>
										<content:encoded><![CDATA[<p>I use the <a class="reference external" href="https://github.com/eschulte/rinari">rinari</a> Emacs mode to assist me when working on rails<br />
projects.  One of rinari&#8217;s most useful features is the ability to<br />
quickly jump from one file to another related file.  I use this<br />
feature almost exclusively for jumping between a ruby class file and<br />
its associated rspec file, but lately I&#8217;ve been spending most of my<br />
time writing javascript.  At VHL, we use <a class="reference external" href="http://pivotal.github.io/jasmine/">jasmine</a> for our unit testing<br />
framework and the <a class="reference external" href="https://github.com/pivotal/jasmine-gem">jasmine ruby gem</a> to integrate it with our rails<br />
projects.  Rinari doesn&#8217;t have any built-in jump settings for jasmine<br />
test files, so I wrote this quick hack to make it work:</p>
<div class="highlight">
<pre><span class="c1">;; Make rinari jump to/from javascript source files and specs.</span>
<span class="p">(</span><span class="nv">setcdr</span> <span class="p">(</span><span class="nb">assoc</span> <span class="ss">&#39;javascript</span> <span class="nv">rinari-jump-schema</span><span class="p">)</span>
        <span class="o">&#39;</span><span class="p">(</span><span class="s">&quot;j&quot;</span>
          <span class="p">((</span><span class="s">&quot;app/assets/javascripts/\\1.js&quot;</span> <span class="o">.</span> <span class="s">&quot;spec/javascripts/\\1_spec.js&quot;</span><span class="p">)</span>
           <span class="p">(</span><span class="s">&quot;spec/javascripts/\\1_spec.js&quot;</span>  <span class="o">.</span> <span class="s">&quot;app/assets/javascripts/\\1.js&quot;</span><span class="p">)</span>
           <span class="p">(</span><span class="no">t</span> <span class="o">.</span> <span class="s">&quot;spec/javascripts/.*&quot;</span><span class="p">)</span>
           <span class="p">(</span><span class="no">t</span> <span class="o">.</span> <span class="s">&quot;app/javascripts/.*&quot;</span><span class="p">))</span>
          <span class="no">t</span><span class="p">))</span>
<span class="p">(</span><span class="nv">rinari-apply-jump-schema</span> <span class="nv">rinari-jump-schema</span><span class="p">)</span>
</pre>
</div>
<p>Now I can press <tt class="docutils literal"><span class="pre">C-c</span> ; f j</tt> to jump between a javascript file in<br />
<tt class="docutils literal">app/assets/javascripts/</tt> and its jasmine test file in<br />
<tt class="docutils literal">spec/javascripts/</tt>.  Perhaps I shouldn&#8217;t be overwriting the<br />
predefined (but not very useful) javascript jump settings, but I<br />
really wanted to use the <tt class="docutils literal">j</tt> key.</p>

<p class="syndicated-attribution"><em>From the blog <a href="http://dthompson.us/">dthompson</a> by <a href="https://cs.worcester.edu/author/0/" title="Read other posts by David Thompson">David Thompson</a></em> and used with permission of the author. All other rights reserved by the author.</p>]]></content:encoded>
					
		
		<enclosure url="" length="0" type="" />

		<post-id xmlns="com-wordpress:feed-additions:1">2770</post-id>	</item>
	</channel>
</rss>
