运行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
Run Code Online (Sandbox Code Playgroud)
我的.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"
Run Code Online (Sandbox Code Playgroud)
另外,在我的.emacs结束时,我有
(server-start)
Run Code Online (Sandbox Code Playgroud)
我目前的解决方法是一个简单的autohotkey脚本,它专注于我的第一个Exceed窗口
^+x:: …Run Code Online (Sandbox Code Playgroud)