Only allow enabling anki-editor-mode in org-mode buffers

This commit is contained in:
orgtre 2022-11-19 11:10:53 +01:00
parent 6404abb473
commit 4cb8f0b6bd

View file

@ -982,7 +982,10 @@ Return a list of cons of (FIELD-NAME . FIELD-CONTENT)."
"A minor mode for making Anki cards with Org." "A minor mode for making Anki cards with Org."
:lighter " anki-editor" :lighter " anki-editor"
:keymap (make-sparse-keymap) :keymap (make-sparse-keymap)
(if anki-editor-mode (anki-editor-setup-minor-mode) (unless (equal major-mode 'org-mode)
(user-error "anki-editor only works in org-mode buffers"))
(if anki-editor-mode
(anki-editor-setup-minor-mode)
(anki-editor-teardown-minor-mode))) (anki-editor-teardown-minor-mode)))
(defun anki-editor-setup-minor-mode () (defun anki-editor-setup-minor-mode ()