Make emacsclient the default editor of MacOS.
The ideas are got from here: https://east.fm/posts/open-with-emacsclient/index.html, just to make it more convenient.
This may take several seconds:
. ./setup.sh
- Make a file /usr/local/bin/emacsclient and save the following code in it (May need “chmod +x”).
#!/bin/zsh # Start emacsclient and return immediately. /Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -c "$@"
- Make a desktop app with Platypus , use the following settings (according to your own need):
- Make it can open the files same with Emacs self, use this script; Then copy it to /Applications.
python copyDocTypes.py
- Use the following command to apply the system config:
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister" -lint -kill -r -domain local -domain system -domain user