3

我有(require 'org-protocol).emacs。现在在 bash 中:

emacsclient org-protocol://capture://something

我得到了我想要的,除了 emacs 窗口没有聚焦。为了使其集中,我可以例如-cemacsclient. 有没有办法(也许是-e开关)可以做到这一点-c

4

1 回答 1

2

找到此代码来修复它:

(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被使用。

于 2013-02-04T15:26:42.683 回答