别名使emacs的一个新的缓冲(不是帧),并启动/走到前面打开一个文件? [英] Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front?
问题描述
我至今是
alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'"
但我难住了。
替换为code,EM file.txt的激活,但不会打开文件。而我得到的'22:23:语法错误:行预计年底却发现未知的令牌。 (-2741)
With that code, em file.txt will activate, but won't open the file. And I get '22:23: syntax error: Expected end of line but found unknown token. (-2741)'
做
alias em=open -a /Applications/Emacs.app "$@"
做工精细,然后它会打开文件,但显然没有带来emacs的前面。
Works fine and then it will open the file, but obviously not bring emacs to the front.
和一些奇怪的原因
osascript -e 'tell application "Emacs.app" to activate'
不激活emacs的....我不知道是怎么回事。
doesn't activate emacs.... I have no idea what is going on.
我很高兴来解决这个问题要么别名code,或者用的.emacs code
I am happy to fix this either with alias code, or with .emacs code
编辑:看评论的尝试另一件事
edit: see comments for another thing tried.
推荐答案
难道问题是你需要逃避你的报价,这样的吗?
Could the problem be that you need to escape you quotes, like this?
alias em="open -a /Applications/Emacs.app \"$@\" && osascript -e 'tell application \"Emacs.app\" to activate'"
这篇关于别名使emacs的一个新的缓冲(不是帧),并启动/走到前面打开一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!