Run command on new frame with daemon/client in Emacs

前端 未结 3 2146
我寻月下人不归
我寻月下人不归 2020-12-19 15:58

This is perhaps quite simple, but I haven\'t found anything useful when googling. So here it goes :)

I use Emacs in daemon mode (emacs --daemon) and it\

3条回答
  •  萌比男神i
    2020-12-19 16:27

    To expand on phils' answer:

    On Emacs 26.1 I had to run the keyboard translations in the context of the new frame, like so:

    (defun make-keyboard-translations ()
      (keyboard-translate ?\C-j ?\C-c))
    
    (defun setup-frame-keyboard (frame)
      (with-selected-frame frame
        (make-keyboard-translations)))
    
    (make-keyboard-translations)
    (add-hook 'after-make-frame-functions #'setup-frame-keyboard)
    

提交回复
热议问题