How can I configure Emacs to recognise certain she-bang lines?

it recognises the shebang line:

#!/usr/bin/env ruby

but not the shebang line of

#!/usr/bin/env ruby1.9

I figure there must be an alist somewhere with the list of scripting languages called by /usr/bin/env and the mode, but I can't find it.


This is controlled by interpreter-mode-alist. In my Emacs (23.2.1 on Debian), there's an entry for ruby1.9 out of the box. I guess you have an older version; you can add this to your .emacs:

(add-to-list 'interpreter-mode-alist
             '("ruby1.9" . ruby-mode))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.