I'm sorry if this is a stupid question but I've been searching on how to do this for hours. I want certain elisp functions to bind to specific key-bindings and for those key-bindings to call a function depending on the mode that the current buffer is in. I'll give an example.
(defun sml-create-comment ()
"Documentation.."
(interactive)
(code-to-insert-comment))
I want this function to be binded to a key, for example 'C-c c'. If I was in sml-mode and typed 'C-c c' it would make an sml comment; and likewise if I was in c-mode it would make a c comment. I'm sorry if I've phrased this weird or if it is supposed to be obvious.