Currently in Vim I have the following setup:
au Bufenter *.clj map <F5> :!clojure1.2 %<CR>
au Bufenter *.py map <F5> :!python %<CR>
Which, in essence, means when I open a new buffer with a .clj
extension it binds f5 to eval the current buffer using the command
line command “clojure1.2 filename”.The following line is a binding for python files.
My question is – how can I achieve this same sort of thing in Emacs?
I’ve been looking for a few weeks but can’t find anything simple. I
appreciate there are clojure and python modes for me to try. But i’d
be interested to see if I can achieve the above in a few lines of
elisp.
Something like this should do the trick: