Adjusted for Emacs 24.3 and Mac OS X