我尝试设置rst模式特定的键绑定,例如:
(eval-after-load "rst-mode"
(define-key rst-mode-map (kbd "<f5>")
(lambda ()
(interactive)
(shell-command "make html"))))
但我明白了:
Symbol's value as variable is void: rst-mode-map
编辑:感谢您的帮助,我有以下工作版本:
(eval-after-load "rst"
'(progn
(define-key rst-mode-map (kbd "<f5>")
(lambda ()
(interactive)
(shell-command (concat "make " "html"))))))
答案 0 :(得分:1)
eval-after-load
要求引用表单:
(eval-after-load "rst-mode"
'(define-key ...))
(否则你正在评估表单立即,而不是在加载rst-mode之后。)