2016-03-15 38 views
0

我爲配置文件寫了一個簡單的主要模式。 我想檢查保存時的語法。 如何確保my-check-syntax被添加到after-save-hook,如果它在my-config-mode下。如何添加和刪除功能,以保存特定的主要模式後鉤?

(defun my-check-syntax() 
    ;; code: print a message to show whether syntax is correct 
) 

(define-derived-mode my-config-mode nil "my-config" 
    (setq-local font-lock-defaults '(my-config-font-lock-keywords)) 
    ;; (add-hook 'after-save-hook #'my-check-syntax) 
) 

(add-to-list 'auto-mode-alist '("\\.myconfigure\\'" . my-config-mode)) 

回答

0

使用LOCAL參數add-hookremove-hook

相關問題