Installing latest command-line emacs on Mac OS X or any Unix based system
Posted on April 19th, 2011 in emacs | 11 Comments »
Update: If you’re compiling the latest 23.3 version of Emacs with the GCC from XCode 4, you’re probably getting errors. Follow these steps. Better yet, if you already had a newer version of command line Emacs and Lion gave you a 2007 version, edit your /etc/path so your /usr/local/bin in on top and all should be good again.
Update 02/20/12: The curl URL was invalid on this now, so I went and updated it.
curl -O http://ftp.gnu.org/gnu/emacs/emacs-24.3.tar.gz // 45.5MB tar -xvzf emacs-24.3.tar.gz cd emacs* ./configure -without-x make // see if it works with src/emacs -Q sudo make install // replace cur vers of emacs sudo mv /usr/bin/emacs /usr/bin/emacs.bk sudo cp /usr/local/bin/emacs /usr/bin/emacs
If you want the X version of emacs – the one with the ugly square UI, don’t use the -without-x
flag. I’d recommend just using Carbon Emacs in that case, though. If you do compile with X you may run into some errors. You either need to install those missing packages are disable inline-image support with -with-jpeg=no --with-png=no --with-gif=no --with-tiff=no
. For those writing Obj-c I heard --with-ns
flag is cool.
11 Responses
has this had any impact on using XCode for iOS/Mac development?
wups – sorry – commented on teh wrong link. My apologies…
Can’t get this to work because apparently Xcode4 and emacs 23.3 don’t get along, while emacs 24 requires some more advanced libraries than those that come with Xcode.
Darius, I’m running Emacs 23.3.1 on my Mac with Xcode 4 just fine, though I only installed Xcode 4 recently.
Darius: Correction, I was running Xcode 3 at the time. I encountered the same issues you did for Xcode4, see my update on getting it working.
I am trying to build emacs-23.3a with these instructions with lion and xcode 4, but run into the follow error on make step
— Load Commands written to Output File —
Writing segment __PAGEZERO @ 0 ( 0/0×100000000 @ 0)
Writing segment __TEXT @ 0 (0x1d3000/0x1d3000 @ 0×100000000)
Writing segment __DATA @ 0x1d3000 (0×367000/0×367000 @ 0x1001d3000)
section __program_vars at 0x1d3000 – 0x1d3028 (sz: 0×28)
section __nl_symbol_ptr at 0x1d3028 – 0x1d3038 (sz: 0×10)
unexec: unrecognized section name in __DATA segment
make[1]: *** [bootstrap-emacs] Error 1
make: *** [src] Error 2
Any ideas?
gkc: In short, it’s still a big hassle to try to compile the latest Emacs 23.3 with Lion. Google even shows tons of people complaining when trying to use Brew or Macports, too.
There is apparently a fix coming in the next version of Emacs. 23.3a might have been it…
Anyways, see my update at the top of this post. In my case I think Lion overwrote my symlink to my regular emacs but I still had it in /usr/local/bin/emacs which I now reference. See if you have an older copy of emacs. If you like I can post mine up. (13MB)
I have precisely the problem described by gkc above (same error on building emacs 23.3 on Mac OS X 10.7.2 [lion]). I tried to follow the link “Follow these steps” Mauvis suggested in the “Update”. However, the link is dead. How can I get the instructions? Cheers.
Just to say -
On 10.7.3, using the current emacs (23.4), this works without any issue, with one exception:
For some reason,
$ make clean
removes the emacs binary in src.
So, make sure to do the moving first.
Beginner terminal user and first-time emacs user tonight.
Downloaded the emacs 23.4 package and used your guide to upgrade for the first time. And it seems to work!
I did what the last commenter Isaac said, to do the moving before make clean. Not sure if I did it right, but I’m really excited.
Thanks so much for posting this up. I tried really hard to find a guide about this but couldn’t find it anywhere.
By the way, I can’t use my mouse on the menu bar. Any idea why?
Tri, this installs emacs ” -without-x” meaning you don’t have a GUI outside of terminal. You shouldn’t be using your mouse anyways. :)