How to update Emacs on OSX to GNU Emacs 23.3.1 with almost zero pain

1) Go to http://emacsformacosx.com/ and download Emacs 23.3; install it.

2) For commandline use in Terminal, create the following script in your ~/bin or somewhere at the top of your $PATH:


$ more bin/emacs
#!/bin/sh
EMACS_APP=/Applications/Emacs.app # <- UPDATE THIS IF NEEDED
EMACS=$EMACS_APP/Contents/MacOS/Emacs
export EMACS
exec $EMACS "$@"
exit 1

3) Run it as normal.

Better highlighting, better javascript mode…

9 thoughts on “How to update Emacs on OSX to GNU Emacs 23.3.1 with almost zero pain

  1. Stephen Usher

    Hmm.. My pain-free version is:

    $ sudo port install emacs

    Or, if you want the Aqua version:

    $ sudo port install emacs-app

    To keep it up to date:

    $ sudo port -u upgrade emacs

    Job done. :-)

    Reply
  2. J Irving

    Why on earth would anyone care enough to count how many packages are installed? If you’re that kind of pedant surely you should be using slackware or gentoo or something. Then you can compile the most minimal possible versions of all your dependencies. That’s so last millennium.

    Actually, if you care about that, how did Emacs get past your aversion to bloat?

    Reply
  3. Perry

    I just do:

    #!/bin/sh
    /Applications/Emacs.app/Contents/MacOS/Emacs “$@”

    What’s the advantage of all the environment variable jazz? (I’ll admit I should probably do exec.)

    Reply
    1. alecm Post author

      @perry – the environment variable setting magically enables the Emacs.app/foo/bar/Emacs binary to work out that it shouldn’t bother looking in the usual places (/usr/lib/emacs*/site/yadda) for lisp code, and instead suggests it looks elsewhere for the site-lisp directory and other magic.

      otherwise it vomits and dies on startup

      Reply
  4. Perry

    Oh, and by the way, I’m still torn on command versus option as my meta key. (Easy to switch back and forth in elisp of course.)

    Reply
  5. Perry

    It doesn’t die on startup for me even without the environment variable stuff — I presume because the binary has the location burned in. I’ve been using it exactly that way for two years now without trouble. Are these variables documented somewhere?

    Reply
    1. alecm Post author

      i was using it via a symlink, which is probably why it needed the disambiguation; alas the env var required me to go googling, and i found it mentioned in passing on a blog

      Reply

Leave a Reply