It's probably a very basic question, but I am having a hard time finding an answer to it:
I am trying to make emacs look for a makefile somewhere in the parent directories and use it for compilation.
I found this function:
(defun desperately-compile () "Traveling up the path, find a Makefile and `compile'." (interactive) (when (locate-dominating-file default-directory "Makefile") (with-temp-buffer (cd (locate-dominating-file default-directory "Makefile")) (compile "make -k"))))
and put it in my .emacs file, but I can't figure out how to call it. replacing the compile command doesn't seem to work and I'm not sure how to bind a key to it.
It would be best to call that function using "M-x compile" or "M-x desperate-compile", but I am open for suggestions.