From 7af16c644717ec1ec7340be35976de08deca0dba Mon Sep 17 00:00:00 2001 From: cwur <43693497+cwur@users.noreply.github.com> Date: Mon, 31 Dec 2018 06:41:55 +0000 Subject: [PATCH] Fixed function call of anki-editor-cloze from anki-editor-cloze-region/dwim (#33) Fix 'Wrong number of arguments' error calling `anki-editor-cloze` --- anki-editor.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anki-editor.el b/anki-editor.el index f6218db..a173f1b 100644 --- a/anki-editor.el +++ b/anki-editor.el @@ -690,13 +690,13 @@ same as how it is used by `M-RET'(org-insert-heading)." "Cloze region with number ARG." (interactive "p\nsHint (optional): ") (unless (region-active-p) (error "No active region")) - (anki-editor-cloze (region-beginning) (region-end))) + (anki-editor-cloze (region-beginning) (region-end) arg hint)) (defun anki-editor-cloze-dwim (&optional arg hint) "Cloze current active region or a word the under the cursor" (interactive "p\nsHint (optional): ") (cond - ((region-active-p) (anki-editor-cloze (region-beginning) (region-end))) + ((region-active-p) (anki-editor-cloze (region-beginning) (region-end) arg hint)) ((thing-at-point 'word) (let ((bounds (bounds-of-thing-at-point 'word))) (anki-editor-cloze (car bounds) (cdr bounds) arg hint))) (t (error "Nothing to create cloze from"))))