开发者

Emacsclient does not respond to mouse clicks

When I run emacsclient it does not res开发者_StackOverflow中文版pond to mouse clicks. My main Emacs process runs in a terminal and responds to mouse clicks correctly because I have the following code in my Emacs config file:

(xterm-mouse-mode 1)

Why does emacsclient not respond to mouse clicks? Is there a way to make it do so?


This is probably because certain settings in Emacs are specific to the terminal, and manipulating such settings in your init file will only affect the terminal which is active at the time the init file was evaluated.

The following Q+A deals with much the same issue, and goes into the details:

Run command on new frame with daemon/client in Emacs

For your issue, I think this should do the trick:

(defun my-terminal-config (&optional frame)
  "Establish settings for the current terminal."
  (if (not frame) ;; The initial call.
      (xterm-mouse-mode 1)
    ;; Otherwise called via after-make-frame-functions.
    (if xterm-mouse-mode
        ;; Re-initialise the mode in case of a new terminal.
        (xterm-mouse-mode 1))))
;; Evaluate both now (for non-daemon emacs) and upon frame creation
;; (for new terminals via emacsclient).
(my-terminal-config)
(add-hook 'after-make-frame-functions 'my-terminal-config)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜