Emacsclient 不响应鼠标点击

发布于 2024-11-17 07:43:00 字数 176 浏览 2 评论 0原文

当我运行 emacsclient 时,它不响应鼠标单击。我的主 Emacs 进程在终端中运行并正确响应鼠标单击,因为我的 Emacs 配置文件中有以下代码:

(xterm-mouse-mode 1)

为什么 emacsclient 不响应鼠标单击?有没有办法让它这样做?

When I run emacsclient it does not respond 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

趁年轻赶紧闹 2024-11-24 07:43:01

这可能是因为 Emacs 中的某些设置特定于终端,并且在 init 文件中操作此类设置只会影响在评估 init 文件时处于活动状态的终端。

以下问答处理了几乎相同的问题,并详细介绍了:

在 Emacs 中使用守护进程/客户端在新框架上运行命令

对于您的问题,我认为这应该可以解决问题:

(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)

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文