問題
magit バージョン 2 に移行してから、起動する度に下のメッセージが出るようになってしまった。環境は MacOS X Yosemite で emacs は homebrew からインストールしている。
Warning (with-editor): Cannot determine a suitable Emacsclient
Determining an Emacsclient executable suitable for the
current Emacs instance failed. For more information
please see https://github.com/magit/magit/wiki/Emacsclient.
原因
homebrew でビルドした emacs を /Applications/Emacs.app
にコピーしているのが良くなかった。なぜそんなことをしていたのかというと spotlight に emacs を見つけさせるため。
対処
下記のコマンドによって、コピーしていたファイルを削除し、シンボリックリンクと置き換える。今回の対処後も spotlight は変わらず動いていた。一度インデックスができると消えないのか、あるいは spotlight の仕様が変わったのかもしれない。
rm -r /Applications/Emacs.app/
brew linkapps emacs
参考
github の issue https://github.com/magit/magit/issues/2318