使emacs在新缓冲区(NOT帧)中打开文件并激活/来到前面的别名?

tob*_*ced 4 macos emacs applescript dot-emacs emacsclient

到目前为止我所拥有的是什么

alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'"
Run Code Online (Sandbox Code Playgroud)

但我很难过.

使用该代码,em file.txt将激活,但不会打开该文件.我得到'22:23:语法错误:预期行结束但发现未知令牌.(-2741)"


alias em=open -a /Applications/Emacs.app "$@"
Run Code Online (Sandbox Code Playgroud)

工作正常,然后它将打开文件,但显然不会将emacs带到前面.


而且出于一些奇怪的原因

osascript -e 'tell application "Emacs.app" to activate'
Run Code Online (Sandbox Code Playgroud)

不会激活emacs ....我不知道发生了什么.


我很高兴用别名代码或.emacs代码修复此问题


编辑:看到另一件尝试的评论.

小智 11

试试这个:

(setq ns-pop-up-frames nil)
Run Code Online (Sandbox Code Playgroud)

对我来说很好.

在这里找到它