繁体   English   中英

Emacs 23,emacsclient参数?

[英]Emacs 23, emacsclient arguments?

我最近安装了Emacs 23(在OS X Leopard上)并试用了emacs服务器。 我尝试了两种方法:(1)将(server-start)放入我的.emacs文件中,以及(2)在终端上运行emacs --daemon(在单独的试验中;不在同一时间)。 在任何一种情况下,当我已经打开emacs框架并尝试使用emacsclient -t,-tty或-nw在OS X终端中打开单独的文件时,该文件始终在现有框架中打开而不是在终端中打开描述:

http://www.gnu.org/software/emacs/manual/html_node/emacs/emacsclient-Options.html

http://emacs-fu.blogspot.com/2009/02/emacs-daemon.html

但是,emacsclient -c按预期工作。 你对可能发生的事情有什么想法吗?

非常感谢! -Stephen

你确定你使用的是正确的'emacsclient'二进制文件吗? 你需要/Applications/Emacs.app/Contents/MacOS/bin/emacsclient ,默认情况下它不会在你的路径中。 如果你只是从命令行调用一个简单的emacsclient ,你将从Apple发布的Emacs 22.1获得emacsclient

如果你运行emacsclient --version并得到这个:

$ emacsclient --version
emacsclient 22.1

你找不到合适的人。

感谢大家的建议和回复 - 我认为我的解决方案是将以下内容添加到我的.bash_profile中:

## --- emacs ---
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs'

## --- emacs client ---
## adapted from http://philipweaver.blogspot.com/2009/08/emacs-23.html

# start a windowed frame
alias ec="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -c -a /Applications/Emacs.app/Contents/MacOS/Emacs"

# start a terminal frame
alias em="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -t -a /Applications/Emacs.app/Contents/MacOS/Emacs -nw"

# do not start a new frame
alias ea="/Applications/Emacs.app/Contents/MacOS/bin/emacsclient -n -a /Applications/Emacs.app/Contents/MacOS/Emacs"

我尝试使用emacs --daemon并用Emacs Client.app图标替换Emacs.app

http://www.cubiclemuses.com/cm/articles/2009/07/30/emacs-23-for-os-x/

但是(1)守护进程似乎没有加载我的许多.emacs自定义项;(2)当我退出Emacs客户端时,它会完全退出Emacs并产生错误......

所以我的解决方案是使用上面定义的bash别名; 将行(server-start)添加到我的.emacs文件中,并将Emacs.app图标添加到我的OS X dock中,以便我可以使用图标或其中一个别名来启动emacs,以及打开新文件在运行的实例中,我也可以在Emacs中使用上面的别名或Cx Cf(或Cx b)。

如果您安装了二进制文件Emacs.app ,则应使用包中的可执行文件。 例如:

$ /Applications/Emacs.app/Contents/MacOS/Emacs -nw

包内还有一个bin目录:

$ cd /Applications/Emacs.app/Contents/MacOS/bin
$ ls -la
total 1488
drwxr-xr-x@ 19 ayman   admin     646 Aug 16 02:33 .
drwxr-xr-x@  5 ayman   admin     170 Aug 16 02:33 ..
-rwxr-xr-x@  1 ayman   admin   39704 Aug 16 02:33 b2m
-rwxr-xr-x@  1 ayman   admin  236412 Aug 16 02:33 ctags
lrwxr-xr-x   1 ayman   admin      18 Aug 24 12:54 cvtmail -> ../libexec/cvtmail
lrwxr-xr-x   1 ayman   admin      21 Aug 24 12:54 digest-doc -> ../libexec/digest-doc
-rwxr-xr-x@  1 ayman   admin  122124 Aug 16 02:33 ebrowse
-rwxr-xr-x@  1 ayman   admin   72188 Aug 16 02:33 emacsclient
-rwxr-xr-x@  1 ayman   admin  232344 Aug 16 02:33 etags
lrwxr-xr-x   1 ayman   admin      19 Aug 24 12:54 fakemail -> ../libexec/fakemail
-rwxr-xr-x@  1 ayman   admin    7288 Aug 16 02:26 grep-changelog
lrwxr-xr-x   1 ayman   admin      15 Aug 24 12:54 hexl -> ../libexec/hexl
lrwxr-xr-x   1 ayman   admin      19 Aug 24 12:54 movemail -> ../libexec/movemail
lrwxr-xr-x   1 ayman   admin      18 Aug 24 12:54 profile -> ../libexec/profile
-rwxr-xr-x@  1 ayman   admin    3977 Aug 16 02:26 rcs-checkin
lrwxr-xr-x   1 ayman   admin      18 Aug 24 12:54 rcs2log -> ../libexec/rcs2log
lrwxr-xr-x   1 ayman   admin      21 Aug 24 12:54 sorted-doc -> ../libexec/sorted-doc
lrwxr-xr-x   1 ayman   admin      28 Aug 24 12:54 update-game-score -> ../libexec/update-game-score
lrwxr-xr-x   1 ayman   admin      17 Aug 24 12:54 vcdiff -> ../libexec/vcdiff
$ 

如果您正在执行所有命令行,则可以使用MacPort更新终端版本:

$ sudo port install emacs-app

截至发布时推送emacs-app @23.0.0_NS-9.0rc3_1

我不经常在OS X上使用emacs,但我已经开始在启动/窗口管理器启动时启动emacs --daemon ,保持进程在后台运行。 这不是一个选择吗?

我在my * shrc文件中使用以下别名:

EDITOR='emacsclient -t'
alias e='emacsclient -n'
alias ew='emacsclient -c -n'
alias et='emacsclient -t'

虽然我必须承认我主要在我的窗口管理器中生成emacs框架(你可能会考虑像QuickKeys或Quicksliver这样的东西)触发: emacsclient -c -nemacs -n -e '(make-remember-frame)'哪个触发一个新的组织记忆框架......

希望这可以帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM