“错误的类型参数:commandp"将 lambda 绑定到键时出错 [英] "Wrong type argument: commandp" error when binding a lambda to a key
本文介绍了“错误的类型参数:commandp"将 lambda 绑定到键时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在这里收到错误的类型参数:commandp,(lambda nil (forward-line 5))".
I am getting a "Wrong type argument: commandp, (lambda nil (forward-line 5))" here.
(global-set-key [?M-n] (lambda () (forward-line 5)))
错误是什么?我很确定它很简单&我遗漏了一些明显的东西.
What is the error? I'm fairly sure it's simple & I'm missing something obvious.
推荐答案
global-set-key
需要交互式命令.(lambda () (interactive) (forward-line 5))
应该可以工作.
global-set-key
expects an interactive command. (lambda () (interactive) (forward-line 5))
ought to work.
顺便说一句,C-h f commandp
是此类错误的一个很好的起点.
By the way, C-h f commandp
is a pretty good starting point for errors like that.
这篇关于“错误的类型参数:commandp"将 lambda 绑定到键时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文