Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 7 down vote accepted

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))
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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