Only check rails-mode in prog-mode-hook