我有(require 'org-protocol)
.emacs。现在在 bash 中:
emacsclient org-protocol://capture://something
我得到了我想要的,除了 emacs 窗口没有聚焦。为了使其集中,我可以例如-c
给emacsclient
. 有没有办法(也许是-e
开关)可以做到这一点-c
?
找到此代码来修复它:
(defadvice raise-frame (after make-it-work (&optional frame) activate)
"Work around some bug? in raise-frame/Emacs/GTK/Metacity/something.
Katsumi Yamaoka posted this in
http://article.gmane.org/gmane.emacs.devel:39702"
(call-process
"wmctrl" nil nil nil "-s" "1")
(call-process
"wmctrl" nil nil nil "-i" "-R"
(frame-parameter (or frame (selected-frame)) 'outer-window-id)))
(add-hook 'server-switch-hook 'raise-frame)
Apparentyraise-frame
仍然存在错误,因此wmctrl
被使用。