<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Michael V. O'Brien</title>
 <link type="application/atom+xml" href="http://www.michaelvobrien.com/blog/feed/atom.xml" rel="self" />
 <link href="http://www.michaelvobrien.com/blog" rel="alternate"/>
 <updated>2012-12-11T18:54:08+09:00</updated>
 <id>http://www.michaelvobrien.com/blog/</id>
 <author>
   <name>Michael V. O'Brien</name>
 </author>

 
 <entry>
   <title>Emacs.app on Mac OS X Snow Leopard 10.6</title>
   <link href="http://www.michaelvobrien.com/blog/2009/10/emacsapp-on-mac-os-x-snow-leopard-106"/>
   <id>http://www.michaelvobrien.com/blog/2009/10/emacsapp-on-mac-os-x-snow-leopard-106</id>
   <updated>2009-10-07T00:00:00+09:00</updated>
   <content type="html">&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; A 64-bit version of Emacs can now be compiled from source.&lt;/p&gt;

&lt;p&gt;With the release of Snow Leopard, the included Emacs binary was not compiled with Carbon or Cocoa support. So, if a native OS X GUI is desired, compiling your own Emacs.app may be worthwhile. That&amp;#8217;s the route I&amp;#8217;ve taken. The Emacs developers are making improvements to the Cocoa version while dropping support for Carbon, and a 64-bit version should be able to compile from source. I&amp;#8217;ll update this post as I tweak my Emacs.app on Snow Leopard.&lt;/p&gt;

&lt;h3 id='64bit_version'&gt;64-bit Version&lt;/h3&gt;

&lt;p&gt;Download the the &amp;#8220;latest&amp;#8221; source from &lt;a href='http://savannah.gnu.org/projects/emacs'&gt;http://savannah.gnu.org/projects/emacs&lt;/a&gt; (I personally used git. Known checkouts to work: &lt;a href='http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=115da71cd94d24194e72cf23f00810de6bfcbd84'&gt;Oct
12, 2009&lt;/a&gt;, &lt;a href='http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=41c156e6d0cb4c36259ab2d53611df4288ee534d'&gt;Oct
24, 2009&lt;/a&gt;):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ git clone git://git.savannah.gnu.org/emacs.git&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Run &amp;#8216;./configure&amp;#8217;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ cd emacs
$ ./configure --with-ns&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Compile and create Emacs.app:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ make install&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Move &amp;#8216;./emacs/nextstep/Emacs.app&amp;#8217; to &amp;#8216;/Applications/&amp;#8217;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ mv ./nextstep/Emacs.app /Applications/&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id='32bit_version'&gt;32-bit Version&lt;/h3&gt;

&lt;p&gt;If the 64-bit version doesn&amp;#8217;t compile, you can compile a 32-bit version by doing:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ CC=&amp;quot;gcc -arch i386&amp;quot; ./configure --with-ns&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There is more information about compiling a 64-bit version of Emacs.app at this &lt;a href='http://blog.fac9.com/index.php/2009/08/30/building-a-64-bit-emacs-on-snow-leopard/'&gt;blog
post&lt;/a&gt;, this &lt;a href='http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00162.html'&gt;mailing
list thread&lt;/a&gt;, and this &lt;a href='http://atomized.org/2009/08/cocoa-emacs-231-cvs-builds-and-the-nextstep-port/'&gt;blog
post&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>AuthorizationExecuteWithPrivileges: A Simple Example</title>
   <link href="http://www.michaelvobrien.com/blog/2009/07/authorizationexecutewithprivileges-a-simple-example"/>
   <id>http://www.michaelvobrien.com/blog/2009/07/authorizationexecutewithprivileges-a-simple-example</id>
   <updated>2009-07-19T00:00:00+09:00</updated>
   <content type="html">&lt;h3 id='introduction'&gt;Introduction&lt;/h3&gt;

&lt;p&gt;I didn&amp;#8217;t find Apple&amp;#8217;s documentation to be completely clear on how to grant an Mac OS X application authorization to run system-level commands. The best solution and only solution I could find was to use the function &lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt;. I wrote two simple Xcode projects, &lt;a href='http://github.com/michaelvobrien/OSXSimpleAuth'&gt;OSXSimpleAuth&lt;/a&gt; and &lt;a href='http://github.com/michaelvobrien/OSXSlightlyBetterAuth'&gt;OSXSlightlyBetterAuth&lt;/a&gt;, for OS X Leopard (10.5) to demonstrate its use, and I hope it will help others get something working quickly and gain a basic understanding, so they can concentrate on adding more robust functionality.&lt;/p&gt;

&lt;h3 id='simple_example'&gt;Simple Example&lt;/h3&gt;

&lt;p&gt;A simple example of how to use &lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt; is as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Authorization Reference (&lt;code&gt;AuthorizationCreate&lt;/code&gt;)&lt;/li&gt;

&lt;li&gt;Run your tool with the authorization reference (&lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For this example, &lt;a href='http://github.com/michaelvobrien/OSXSimpleAuth'&gt;OSXSimpleAuth&lt;/a&gt;, I created a Foundation Tool and added the Security framework to it.&lt;/p&gt;
&lt;pre class='code'&gt;
&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;Create authorization reference&lt;/span&gt;
&lt;span class='type'&gt;AuthorizationRef&lt;/span&gt; &lt;span class='variable-name'&gt;authorizationRef&lt;/span&gt;;
&lt;span class='type'&gt;OSStatus&lt;/span&gt; &lt;span class='variable-name'&gt;status&lt;/span&gt;;
status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
                             kAuthorizationFlagDefaults, &amp;amp;authorizationRef);

&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;Run the tool using the authorization reference&lt;/span&gt;
&lt;span class='type'&gt;char&lt;/span&gt; *&lt;span class='variable-name'&gt;tool&lt;/span&gt; = &lt;span class='string'&gt;&quot;/sbin/dmesg&quot;&lt;/span&gt;;
&lt;span class='type'&gt;char&lt;/span&gt; *&lt;span class='variable-name'&gt;args&lt;/span&gt;[] = {NULL};
&lt;span class='type'&gt;FILE&lt;/span&gt; *&lt;span class='variable-name'&gt;pipe&lt;/span&gt; = NULL;
status = AuthorizationExecuteWithPrivileges(authorizationRef, tool,
                                            kAuthorizationFlagDefaults, args, &amp;amp;pipe);
&lt;/pre&gt;
&lt;h3 id='slightly_better_example'&gt;Slightly Better Example&lt;/h3&gt;

&lt;p&gt;A slightly better example that uses more options to run &lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt; and has links to some explanations from Apple&amp;#8217;s documentation can be found in &lt;a href='http://github.com/michaelvobrien/OSXSlightlyBetterAuth'&gt;OSXSlightlyBetterAuth&lt;/a&gt;.&lt;/p&gt;
&lt;pre class='code'&gt;
&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;Create authorization reference
&lt;/span&gt;&lt;span class='type'&gt;OSStatus&lt;/span&gt; &lt;span class='variable-name'&gt;status&lt;/span&gt;;
&lt;span class='type'&gt;AuthorizationRef&lt;/span&gt; &lt;span class='variable-name'&gt;authorizationRef&lt;/span&gt;;

&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;AuthorizationCreate and pass NULL as the initial
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;AuthorizationRights set so that the AuthorizationRef gets created
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;successfully, and then later call AuthorizationCopyRights to
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;determine or extend the allowable rights.
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;http://developer.apple.com/qa/qa2001/qa1172.html
&lt;/span&gt;status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
                             kAuthorizationFlagDefaults, &amp;amp;authorizationRef);
&lt;span class='keyword'&gt;if&lt;/span&gt; (status != errAuthorizationSuccess)
    NSLog(@&lt;span class='string'&gt;&quot;Error Creating Initial Authorization: %d&quot;&lt;/span&gt;, status);

&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;kAuthorizationRightExecute == &quot;system.privilege.admin&quot;
&lt;/span&gt;&lt;span class='type'&gt;AuthorizationItem&lt;/span&gt; &lt;span class='variable-name'&gt;right&lt;/span&gt; = {kAuthorizationRightExecute, 0, NULL, 0};
&lt;span class='type'&gt;AuthorizationRights&lt;/span&gt; &lt;span class='variable-name'&gt;rights&lt;/span&gt; = {1, &amp;amp;right};
&lt;span class='type'&gt;AuthorizationFlags&lt;/span&gt; &lt;span class='variable-name'&gt;flags&lt;/span&gt; = kAuthorizationFlagDefaults |
                           kAuthorizationFlagInteractionAllowed |
                           kAuthorizationFlagPreAuthorize |
                           kAuthorizationFlagExtendRights;

&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;Call AuthorizationCopyRights to determine or extend the allowable rights.
&lt;/span&gt;status = AuthorizationCopyRights(authorizationRef, &amp;amp;rights, NULL, flags, NULL);
&lt;span class='keyword'&gt;if&lt;/span&gt; (status != errAuthorizationSuccess)
    NSLog(@&lt;span class='string'&gt;&quot;Copy Rights Unsuccessful: %d&quot;&lt;/span&gt;, status);

NSLog(@&lt;span class='string'&gt;&quot;\n\n** %@ **\n\n&quot;&lt;/span&gt;, @&lt;span class='string'&gt;&quot;This command should work.&quot;&lt;/span&gt;);
&lt;span class='type'&gt;char&lt;/span&gt; *&lt;span class='variable-name'&gt;tool&lt;/span&gt; = &lt;span class='string'&gt;&quot;/sbin/dmesg&quot;&lt;/span&gt;;
&lt;span class='type'&gt;char&lt;/span&gt; *&lt;span class='variable-name'&gt;args&lt;/span&gt;[] = {NULL};
&lt;span class='type'&gt;FILE&lt;/span&gt; *&lt;span class='variable-name'&gt;pipe&lt;/span&gt; = NULL;

status = AuthorizationExecuteWithPrivileges(authorizationRef, tool,
                                            kAuthorizationFlagDefaults, args, &amp;amp;pipe);
&lt;span class='keyword'&gt;if&lt;/span&gt; (status != errAuthorizationSuccess)
    NSLog(@&lt;span class='string'&gt;&quot;Error: %d&quot;&lt;/span&gt;, status);

&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;The only way to guarantee that a credential acquired when you
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;request a right is not shared with other authorization instances is
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;to destroy the credential.  To do so, call the AuthorizationFree
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;function with the flag kAuthorizationFlagDestroyRights.
&lt;/span&gt;&lt;span class='comment-delimiter'&gt;// &lt;/span&gt;&lt;span class='comment'&gt;http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/02authconcepts/chapter_2_section_7.html
&lt;/span&gt;status = AuthorizationFree(authorizationRef, kAuthorizationFlagDestroyRights);
&lt;/pre&gt;
&lt;p&gt;Notice the &amp;#8220;Right&amp;#8221; label in the authorization dialog box screenshot. The &lt;code&gt;AuthorizationItem&lt;/code&gt; was set with &amp;#8220;system.privilege.admin&amp;#8221; via the &lt;code&gt;kAuthorizationRightExecute&lt;/code&gt; constant.&lt;/p&gt;

&lt;p&gt;&lt;img alt='OSX Authorization Dialog' src='/static/images/blog/osx_auth_dialog.png' /&gt;&lt;/p&gt;

&lt;h3 id='conclusion'&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Apple recommends only using &lt;code&gt;AuthorizationExecuteWithPrivileges&lt;/code&gt; in two cases. One is to create an installer. The other is to repair your helper tool by setting the setuid bit. The helper tool is supposed to encapsulate the root privileged portion of the code. Be aware that I didn&amp;#8217;t do this in the examples. Go to the &lt;a href='http://github.com/michaelvobrien/OSXSimpleAuth'&gt;OSXSimpleAuth project page&lt;/a&gt; and the &lt;a href='http://github.com/michaelvobrien/OSXSlightlyBetterAuth'&gt;OSXSlightlyBetterAuth project page&lt;/a&gt; to download the example Xcode projects.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Repta Project Released</title>
   <link href="http://www.michaelvobrien.com/blog/2009/07/repta-project-released"/>
   <id>http://www.michaelvobrien.com/blog/2009/07/repta-project-released</id>
   <updated>2009-07-12T00:00:00+09:00</updated>
   <content type="html">&lt;p&gt;I have a website that has certain JavaScript code snippets, such as Google Analytics, that need to be present only in the production environment and not the development environment. I needed an easy way to keep this separation, regardless of framework or lack of one. I wrote the &lt;a href='/projects/repta'&gt;repta&lt;/a&gt; tool to perform a global search and replace of a &amp;#8220;tag&amp;#8221; across all the project files as one of the steps during the deployment of the website. &lt;a href='/projects/repta'&gt;Check out the project page&lt;/a&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>A 'cd' Command for Git Projects</title>
   <link href="http://www.michaelvobrien.com/blog/2009/01/a-cd-command-for-git-projects"/>
   <id>http://www.michaelvobrien.com/blog/2009/01/a-cd-command-for-git-projects</id>
   <updated>2009-01-20T00:00:00+09:00</updated>
   <content type="html">&lt;p&gt;I often find myself in a project directory and one of two things usually happens. The first is that I would like to go directly to the top level directory of the project. The second is that I would like to go outside of the project directory and get back very quickly. Though not sophisticated, I came up with this simple shell script called &lt;strong&gt;cd-to-project-root&lt;/strong&gt;.&lt;/p&gt;
&lt;pre class='code'&gt;
&lt;span class='comment-delimiter'&gt;#&lt;/span&gt;&lt;span class='comment'&gt;!/bin/&lt;/span&gt;&lt;span class='keyword'&gt;sh&lt;/span&gt;&lt;span class='comment'&gt;
&lt;/span&gt;
pushd . &amp;gt; /dev/null

&lt;span class='keyword'&gt;until&lt;/span&gt; [ -d .git ] || [ &lt;span class='sh-quoted-exec'&gt;`pwd`&lt;/span&gt; = &lt;span class='string'&gt;'/'&lt;/span&gt; ]; &lt;span class='keyword'&gt;do&lt;/span&gt;
    &lt;span class='builtin'&gt;cd&lt;/span&gt; ..;
&lt;span class='keyword'&gt;done&lt;/span&gt;

&lt;span class='keyword'&gt;if&lt;/span&gt; [ &lt;span class='sh-quoted-exec'&gt;`pwd`&lt;/span&gt; = &lt;span class='string'&gt;'/'&lt;/span&gt; ]; &lt;span class='keyword'&gt;then&lt;/span&gt;  &lt;span class='comment-delimiter'&gt;# &lt;/span&gt;&lt;span class='comment'&gt;try to go to a project directory
&lt;/span&gt;    &lt;span class='keyword'&gt;if&lt;/span&gt; [ -z $&lt;span class='variable-name'&gt;PREV_PROJECT_ROOT&lt;/span&gt; ]; &lt;span class='keyword'&gt;then&lt;/span&gt;
        popd &amp;gt; /dev/null
        &lt;span class='builtin'&gt;echo&lt;/span&gt; &lt;span class='string'&gt;&quot;Project directory not found.&quot;&lt;/span&gt;;
    &lt;span class='keyword'&gt;else&lt;/span&gt;
        &lt;span class='builtin'&gt;cd&lt;/span&gt; $&lt;span class='variable-name'&gt;PREV_PROJECT_ROOT&lt;/span&gt;
    &lt;span class='keyword'&gt;fi&lt;/span&gt;
&lt;span class='keyword'&gt;else&lt;/span&gt;  &lt;span class='comment-delimiter'&gt;# &lt;/span&gt;&lt;span class='comment'&gt;at a project directory
&lt;/span&gt;    &lt;span class='builtin'&gt;export&lt;/span&gt; &lt;span class='variable-name'&gt;PREV_PROJECT_ROOT&lt;/span&gt;=&lt;span class='sh-quoted-exec'&gt;`pwd`&lt;/span&gt;
&lt;span class='keyword'&gt;fi&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;I saved this in my &amp;#8220;~/bin&amp;#8221; directory and made an alias to it called &lt;strong&gt;cdp&lt;/strong&gt;. It&amp;#8217;s important to source the script, otherwise the shell variables will not retain their values when the script terminates.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;alias cdp=&amp;quot;. cd-to-project-root&amp;quot;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This allows me to type &lt;strong&gt;cdp&lt;/strong&gt; to set the project directory, which is under git version control. Anytime I want to get back to the project directory, I type &lt;strong&gt;cdp&lt;/strong&gt;.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>RubyConf 2007</title>
   <link href="http://www.michaelvobrien.com/blog/2007/11/rubyconf-2007"/>
   <id>http://www.michaelvobrien.com/blog/2007/11/rubyconf-2007</id>
   <updated>2007-11-10T00:00:00+09:00</updated>
   <content type="html">&lt;p&gt;I had a really good time at RubyConf 2007, and I&amp;#8217;d have to say that it was the most enjoyable conference that I&amp;#8217;ve been to. The highlights of the conference for me were seeing other Ruby implementations, seeing the new Ruby features in Mac OS X Leopard, and meeting up with an Emacs group.&lt;/p&gt;

&lt;p&gt;&lt;a href='http://technomancy.us'&gt;Phil Hagelberg&lt;/a&gt; gave an interesting talk about getting more feedback from the tools you use while you&amp;#8217;re writing code, especially from your editor. After his talk, I chatted with him about Emacs, and we setup a time for an Emacs group meetup. I told Matz about the meetup, and he was kind enough to stop by for a few minutes after his keynote. He told us an interesting anecdote about how he added the keyword &amp;#8216;end&amp;#8217; to Ruby so that Emacs could properly auto indent the code. This goes for any editor/tool. Also, he said that he uses elisp to help him develop Ruby.&lt;/p&gt;

&lt;p&gt;Ryan Davis&amp;#8217; talk &amp;#8220;Hurting Code for Fun and Profit&amp;#8221; was entertaining. It&amp;#8217;s an interesting concept. Basically, if you love the code, nurture it and enjoy it. Otherwise, hate the code and hurt it, rip it out and rewrite it or fix it, be ruthless and mean, laugh at it, bend it to your will. So, I guess if loving the code doesn&amp;#8217;t work, become a code sadist. Actually, in this case, a &lt;a href='http://ruby.sadi.st&amp;quot;'&gt;Ruby Sadist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Laurent Sansonetti&amp;#8217;s talk &amp;#8220;Mac OS X Loves Ruby&amp;#8221; was awesome. I liked the RubyCocoa demo. He showed how to use Xcode to bind Ruby code to a form textbox and a form button by just dragging the file to each one and selecting the appropriate inputs and outputs. He, also, showed a demo of using Ruby to manipulate an already running application, such as TextEdit. His other demos were good, too. The audience couldn&amp;#8217;t help but break out into applause as they watched him manipulate Leopard by using Ruby, and he did this mostly at the command line.&lt;/p&gt;</content>
 </entry>
 
 <entry>
   <title>Emacs.app on Mac OS X Leopard</title>
   <link href="http://www.michaelvobrien.com/blog/2007/10/emacsapp-on-mac-os-x-leopard"/>
   <id>http://www.michaelvobrien.com/blog/2007/10/emacsapp-on-mac-os-x-leopard</id>
   <updated>2007-10-27T00:00:00+09:00</updated>
   <content type="html">&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I have another &lt;a href='/blog/2009/10/emacsapp-on-mac-os-x-snow-leopard-106/&amp;quot;'&gt;blog post for Mac OS X Snow Leopard&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ve been using Mac OS X Leopard for about a day now. The unfortunate thing that I discovered was that Leopard&amp;#8217;s X11 support is not quite working yet. There are issues with Inkscape and Gimp, and I couldn&amp;#8217;t get Emacs to work in X11. This encouraged me to find a better way to get Emacs into a windowed environment, and I ended up being able to create (uh, copy) an Emacs.app.&lt;/p&gt;

&lt;p&gt;To create an Emacs.app, do the following:&lt;/p&gt;

&lt;p&gt;&lt;a href='http://ftp.gnu.org/pub/gnu/emacs/&amp;quot;'&gt;Download the Emacs source code&lt;/a&gt;. Note: Leopard comes with emacs 22.1.1 (uses Carbon), so you want to download &lt;strong&gt;emacs-22.1.tar.gz&lt;/strong&gt;. However, instead of downloading the entire source code, you can download just the Emacs.app from me &lt;a href='/files/emacs-22.1-mac-app.tar.gz'&gt;here&lt;/a&gt; to save GNU 36MB of bandwidth.&lt;/p&gt;

&lt;p&gt;Extract the files.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ tar zxvf emacs-22.1.tar.gz&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Go to the &amp;#8216;emacs-22.1/mac&amp;#8217; directory&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ cd emacs-22.1/mac&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Copy &amp;#8216;Emacs.app&amp;#8217;; to &amp;#8216;/Applications/&amp;#8217;;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo cp -r Emacs.app /Applications/&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Symlink /usr/bin/emacs to /Applications/Emacs.app/Contents/MacOS/emacs&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ ln -s /usr/bin/emacs /Applications/Emacs.app/Contents/MacOS/emacs&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And, you may want to change the ownership on the Emacs.app&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo chown -R root:admin /Applications/Emacs.app&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That&amp;#8217;s it. You should now be able to launch Emacs.app as a regular Mac application.&lt;/p&gt;</content>
 </entry>
 

</feed>
