运行 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 混淆了语法高亮:(