问题:
如何为次要模式创建自定义键绑定?像这样的东西。
这是我到目前为止所拥有的。我试图让一个自定义键绑定工作:
(define-minor-mode num-mode
"Toggle the Num pad keys.
With no argument, this command toggles the mode.
Non-null prefix argument turns on the mode.
Null prefix argument turns off the mode.
When Num mode is enabled, the num pad inserts the
keys you see on the pad. This may over ried existing
definitions, and is probably only usefule if you aref
running Emacs through a terminal."
;; The initial value.
nil
;; The indicator for the mode line.
" NumPad"
;; The minor mode bindings.
;; This doesn't work right now!!!!
'(((kbd "<kp-1>") . "a"))
:global 1
)
当我在调用我的自定义次要模式“num-mode”并验证它在迷你缓冲区中打开后在数字键盘上点击“1”时,我收到错误消息<kp-1> is undefined
。我想要发生a
的是在我点击时打印出指针所在的位置<kp-1>
。(只是一个测试)
语境:
所以,我通常使用我的数字键盘在缓冲区之间移动(箭头键将我移动到适当的方向)。这是全局设置的。我想创建一个次要模式,当我想使用我的数字键盘简单地输入数字时我可以调用它。
默认情况下,我的数字键盘上的键是未定义的。我<kp-0>
用来<kp-9>
定义数字键盘键的键绑定。
我可以创建一个可以调用的次要模式,但我不能附加任何键绑定。这适用于所有键绑定,包括未在其他任何地方定义的键绑定。
谢谢你的帮助!