From 4cb8f0b6bde891bfaddabdf445c5c9412ac90b03 Mon Sep 17 00:00:00 2001 From: orgtre Date: Sat, 19 Nov 2022 11:10:53 +0100 Subject: [PATCH] Only allow enabling anki-editor-mode in org-mode buffers --- anki-editor.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/anki-editor.el b/anki-editor.el index 9a3cfca..87de52a 100644 --- a/anki-editor.el +++ b/anki-editor.el @@ -982,7 +982,10 @@ Return a list of cons of (FIELD-NAME . FIELD-CONTENT)." "A minor mode for making Anki cards with Org." :lighter " anki-editor" :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))) (defun anki-editor-setup-minor-mode ()