Get Kill/Yank and ispell Working in Emacs.app 23.1 on Leopard
I recently upgraded from Emacs 23 alpha (the version MacPorts installed by default for a long time) to 23.1 and it broke a few things. I’m going to document how to fix them in a few posts here.
I’m entirely indebted to the friendly folks at the Emacs Users Mailing List for every solution that I present here. One of these days I’ll know Emacs well enough to troubleshoot my own problems.
The first issue I noticed was that Kill/Yank (Copy/Paste for all you Emacs laymen at there) no longer worked. The problem lay in the save-interprogram-paste-before-kill function, apparently, but the solution presented to me on the mailing list didn’t make me happy either as I don’t like inside Emacs like many people do. I need to be able to enter text into an Emacs buffer and then get it into other programs. I stopped using Emacs for awhile at this point.
One day, I decided to try to open Emacs.app via Finder.app and suddenly everything worked! Unfortunately, this also broke any dependencies Emacs had on any software I had installed via the command line. This was because Finder.app doesn’t inherit the bin PATH that you set via .bashrc because, well, it’s not bash.
The solution here is to continue to open Emacs.app via the command line, but instead of using /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs as I’d been doing prior to upgrading to 23.1, use open /Applications/MacPorts/Emacs.app instead. I don’t know why I never thought of this before. It makes a lot more sense than what I was doing before even if before 23.1 it was working!
As a corollary to this, another issue that I discovered when I upgraded was that ispell no longer worked correctly. This was a big deal because I don’t like to spell check my own stuff. M-x ispell has to work. The problem was that it could no longer find my installation of aspell because it didn’t evaluate .bashrc to find my PATH settings. Using the open command from Terminal.app solved this as well.
To review:
Instead of starting Emacs.app via
/Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs
use
open /Applications/MacPorts/Emacs.app
from the command line so that interprogram-paste and ispell work.

Leave a Spark