Fix add-yas-minor-mode!
This commit is contained in:
parent
ac838e2a74
commit
6e4cadd261
1 changed files with 6 additions and 7 deletions
|
@ -2,16 +2,15 @@
|
||||||
;; for ../core-yasnippet.el
|
;; for ../core-yasnippet.el
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defmacro add-yas-minor-mode! (&rest modes)
|
(defmacro add-yas-minor-mode! (mode)
|
||||||
"Register minor MODES in yasnippet."
|
"Register minor MODES in yasnippet."
|
||||||
`(after! yasnippet
|
`(after! yasnippet
|
||||||
(when (boundp 'yas-extra-modes)
|
(when (boundp 'yas-extra-modes)
|
||||||
,@(mapcar (lambda (mode)
|
(add-hook ',(intern (concat (symbol-name (cadr mode)) "-hook"))
|
||||||
`(after! ,(cadr mode)
|
(lambda ()
|
||||||
(if (symbol-value ,mode)
|
(if (symbol-value ,mode)
|
||||||
(yas-activate-extra-mode ,mode)
|
(yas-activate-extra-mode ,mode)
|
||||||
(setq yas-extra-modes (delq ,mode yas-extra-modes)))))
|
(yas-deactivate-extra-mode ,mode)))))))
|
||||||
modes))))
|
|
||||||
|
|
||||||
(provide 'macros-yasnippet)
|
(provide 'macros-yasnippet)
|
||||||
;;; macros-yasnippet.el ends here
|
;;; macros-yasnippet.el ends here
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue