multi-term: Understanding keyboard bindings

与世无争的帅哥 提交于 2019-12-02 09:49:27

问题


I am a bit confused by the difference between these two lists in multi-term (by the way where is the official repository hosted?)

  • term-bind-key-alist
  • term-unbind-key-list

In my head, there should be two things:

  • The keystrokes that we want Emacs to capture itself and to interpret in a specific way (by binding them to commands)
  • The strokes that Emacs sends directly to the shell ("as is").

How exactly do term-unbind-key-list and term-bind-key-alist define these lists and bindings?

Also, does multi-term support line mode and character mode? If so, how does the mode in which we are alter the way keystrokes and these lists are interpreted?


回答1:


I saw recipe multi-term.rcp for el-get, it is downloaded from emacswiki.

term-bind-key-alist is for functions like term-send-up or term-previous-input, whose keybinds are set in "emacs style" instead of "term style".

term-unbind-key-list is an analog for setup 'nil (see ansi-term in character mode). By default almost all keys in term-raw-map are binded to function term-send-raw and 'nil just unbinds them.

term-bind-key-alist and term-unbind-key-list are used over of term-raw-map (character mode) and term-mode-map(line mode) in multi-term.el isn't used at all.

I don't use multi-term, I setup term-mode-map and term-raw-map directly. For example for switching between modes:

(define-key term-mode-map (kbd "C-j") 'term-char-mode)
(define-key term-raw-map (kbd "C-j") 'term-line-mode)


来源:https://stackoverflow.com/questions/14485858/multi-term-understanding-keyboard-bindings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!