0

我试图设置 rst-mode 特定的键绑定,例如:

(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"))))))
4

1 回答 1

1

eval-after-load需要引用的表格:

(eval-after-load "rst-mode"
  '(define-key ...))

(否则您将立即评估表单,而不是在加载 rst-mode 之后。)

于 2013-02-18T22:57:53.520 回答