Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

Add an entry to interpreter-mode-alist #28

Closed waisbrot closed 7 years ago

waisbrot commented 8 years ago

Allow #!groovy and the like to set the mode for a file

I'm not familiar with the magic of the ###autoload comment, so I might not have it right.

Wilfred commented 8 years ago

Ha, I was just about to create a PR that did the same thing.

Your syntax looks good to me. I tend to write autoloads like this:

;;;###autoload
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))

as that way you get proper syntax highlighting. Your usage is also correct though.

Wilfred commented 7 years ago

@russel are you happy merging this?

This PR is really useful: it ensures that any file that starts with shebangs like #!/usr/bin/env groovy automatically use groovy-mode.

russel commented 7 years ago

@Wilfred @waisbrot Apologies for the delay in getting to this. Long and boring story.