【发布时间】:2010-09-03 14:25:06
【问题描述】:
如何在运行 emacsclient 后持续控制窗口焦点?
目前,重点取决于我是否已经运行了 emacs 服务器。当 emacsclient 调用替代编辑器时,焦点转移到新的 emacs 窗口。当 emacsclient 连接到现有的 emacs 服务器时,焦点不会转移(即它停留在我的 putty 客户端上)。
我希望始终专注于 emacs 窗口,因为我通常会在打开文件后转到 emacs。
任何帮助将不胜感激!
备注
版本信息
emacs: 21.4.1
emacsclient: 21.4
client os: Windows XP Service Pack 3
x server: Exceed 11.0.0.0
我的 .bash_profile 的相关部分
# a wrapper is needed to sandwich multiple command line arguments in bash
# 2>/dev/null hides
# "emacsclient: can't find socket; have you started the server?"
emacs_wrapper () {
if [ 0 -eq $# ]
then
emacsclient -n -a emacs ~/notes.txt 2>/dev/null &
else
emacsclient -n -a emacs $* &
fi
}
alias x="emacs_wrapper"
另外,在我的 .emacs 结尾处,我有
(server-start)
我目前的解决方法是一个简单的自动热键脚本,它专注于我的第一个 Exceed 窗口
^+x::
If WinExist("ahk_class EXCEEDW:MWCLIENT0")
WinActivate
return
作为旁注,似乎我重定向到 /dev/null 混淆了语法高亮 :(
【问题讨论】:
-
这可能对您没有帮助,但在使用 23.2.2 和 Ubuntu 时,焦点似乎转移到了现有的 emacs 窗口。
-
我怀疑在 Windows 上使用 X-server 会使情况变得复杂。您是否考虑过在 Windows 上使用 emacs? 23.2 可预编译:ftp.gnu.org/gnu/emacs/windows
-
我实际上已经安装了 emacsw32。然而,通过 CIFS 共享工作的速度非常缓慢:(
标签: emacs emacsclient