doomemacs/core/lib/macros-yasnippet.el

17 lines
524 B
EmacsLisp
Raw Normal View History

2015-06-15 15:05:52 +08:00
;;; macros-yasnippet.el
;; for ../core-yasnippet.el
;;;###autoload
2015-07-27 21:10:59 +08:00
(defmacro add-yas-minor-mode! (mode)
2015-06-15 15:05:52 +08:00
"Register minor MODES in yasnippet."
`(after! yasnippet
(when (boundp 'yas-extra-modes)
2015-07-27 21:10:59 +08:00
(add-hook ',(intern (concat (symbol-name (cadr mode)) "-hook"))
(lambda ()
(if (symbol-value ,mode)
(yas-activate-extra-mode ,mode)
(yas-deactivate-extra-mode ,mode)))))))
2015-06-15 15:05:52 +08:00
(provide 'macros-yasnippet)
;;; macros-yasnippet.el ends here