I'm using emacs on OSX Terminal, just installed newer version 23.2, its located on /Applications/Emacs/Content/Emacs, it's an executable, so i linked it to /usr/bin/emacs, and moved the older one to /usr/bin/emacs.old as it was a bin file.

Now when i use "emacs -nw "" (with no .emacs and empty ".emacs.d") it opens the file, with no syntax highlight (php in my case, but it's understandable), and when i close it, there are the following errors:

Warning: arch-dependent data dir (/Users/david/src/emacs-dev/ftp-versions/emacs-23.2/nextstep/Emacs.app/Contents/MacOS/libexec/emacs/23.2/x86_64-apple-darwin/) does not exist. Warning: arch-independent data dir (/Users/david/src/emacs-dev/ftp-versions/emacs-23.2/nextstep/Emacs.app/Contents/Resources/share/emacs/23.2/etc/) does not exist. Error: charsets directory (/Users/david/src/emacs-dev/ftp-versions/emacs-23.2/nextstep/Emacs.app/Contents/Resources/share/emacs/23.2/etc/charsets) does not exist. Emacs will not function correctly without the character map files. Please check your installation!

If i move my .emacs.old to .emacs and put the contents of my .emacs.d.old to .emacs.d, when open some file, emacs shows an error, saying it couldn'y open the file due to warnings, and when i close it, the same warnings appear.

The strange thing is my username isn't david, as it looks on the warning "/Users/david/...", so where did it come from? Can i fix it?


edit: here's the error i get when i try to open a .module file:

Cannot open load file: warnings


All i wanted is shift-selection on the 'emacs -nw', if anyone got a better sugestion, i'd love it. I'm using the older emacs now, new one is too buggy on the -nw.

1 Answer 1


This got rid of the error for me:

$ sudo mv /usr/bin/emacs /usr/bin/emacs.old

Now edit /usr/bin/emacs in a text editor and paste this in:



if [ $(id -u) = "0" ]; then
    sudo $EMACS_PATH "$@"
    $EMACS_PATH "$@"

(Replace $EMACS_PATH with the actual path to your Emacs binary.) Finally, make your shell script executable:

$ sudo chmod +x /usr/bin/emacs

For whatever reason, Cocoa Emacs doesn't like to be linked to /usr/bin/emacs, but it runs without complaints if you invoke it from its actual path. Probably a working directory issue.

If someone knows a better way to do this, I'm all ears.

edit: updated script to handle quotes in arguments properly

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .