5

emacsclient を実行すると、マウスのクリックに応答しません。Emacs 構成ファイルに次のコードがあるため、メインの Emacs プロセスはターミナルで実行され、マウス クリックに正しく応答します。

(xterm-mouse-mode 1)

emacsclient がマウスのクリックに応答しないのはなぜですか? そうする方法はありますか?

4

1 に答える 1

10

これはおそらく、Emacs の特定の設定が端末に固有であり、init ファイルでそのような設定を操作すると、init ファイルが評価された時点でアクティブな端末にのみ影響するためです。

次の Q+A は、ほとんど同じ問題を扱っており、詳細を説明しています。

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)
于 2011-07-23T04:45:55.477 に答える