Fixed function call of anki-editor-cloze from anki-editor-cloze-region/dwim (#33)
Fix 'Wrong number of arguments' error calling `anki-editor-cloze`
This commit is contained in:
parent
0bee0064bc
commit
7af16c6447
1 changed files with 2 additions and 2 deletions
|
@ -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"))))
|
||||
|
|
Loading…
Reference in a new issue