我定义了一个major mode,想在major mode里把C-c绑定到一个命令上,但是不成功,有可能是哪里的问题?
Major mode:
(define-derived-mode yterm-command-mode
shell-script-mode "yTerm"
"Major mode for entering commands in yterm command buffer."
:group 'yterm
(yterm--format-command-buffer)
(yterm--setup-command-mode-key))
绑定 C-c:
(defun yterm--setup-command-mode-key ()
"Setup keybindings for yterm-command-mode."
(add-to-list 'emulation-mode-map-alists `((yterm-command-mode . ,yterm-command-mode-map)))
(define-key yterm-command-mode-map (kbd "C-c") #'yterm-command-send-eof))
Major mode里按C-c的效果:
我又试着绑定了其他的按键,依然不成功,是不是什么其他的minor mode覆盖了我的绑定?怎么才能让我的绑定覆盖其他所有的mode?