I'm trying to write a small lisp function to run flyspell in a single org-mode branch. I have added this to my .emacs file:
(defun flyspell-current-tree()
(interactive)
(org-mark-subtree)
(flyspell-region))
(global-set-key (kbd "S-<f8>") 'flyspell-current-tree)
But when running it I get the following error:
flyspell-current-tree: Wrong number of arguments
Any ideas?
You need to provide beg
and end
to flyspell-region
for it to work properly. The error is coming from that and not actually from your function.
If you include (point)
and (mark)
as arguments to flyspell-region
it will work properly.
(defun flyspell-current-tree()
(interactive)
(org-mark-subtree)
(flyspell-region (point) (mark)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With