Summary: Combined the two comments.
< (if (equal mode-name "Todoo")
< (call-interactively 'todoo-save-and-exit)
< (call-interactively 'todoo)))
< -- JohannesGijsbers
< You shouldn't check mode-name, it's slower and not as reliable as checking major-mode. Try this instead:
< (defun todoo-or-close-todo ()
< -- MJF
> -- JohannesGijsbers
I have the following function bound to f10 so I can press one button, edit my TODO file, press the same button and I’m done. I need my TODO file very close, or I’ll stop using it.
(defun todoo-or-close-todoo() (interactive) (if (eq major-mode 'todoo-mode) (call-interactively 'todoo-save-and-exit) (call-interactively 'todoo)))