Only allow enabling anki-editor-mode in org-mode buffers
This commit is contained in:
parent
6404abb473
commit
4cb8f0b6bd
1 changed files with 4 additions and 1 deletions
|
@ -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 ()
|
||||||
|
|
Loading…
Reference in a new issue