到目前为止我所拥有的是
alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'"
但我很难过。
使用该代码, em file.txt 将激活,但不会打开文件。我得到 '22:23: syntax error: Expected end of line but found unknown token. (-2741)'
正在做
alias em=open -a /Applications/Emacs.app "$@"
工作正常,然后它会打开文件,但显然不会把 emacs 带到前面。
出于某种奇怪的原因
osascript -e 'tell application "Emacs.app" to activate'
不激活emacs....我不知道发生了什么。
我很高兴使用别名代码或 .emacs 代码解决此问题
编辑:查看评论以尝试另一件事。