defunkt/coffee-mode — pull request #125 by sandinmyjoints (2013-04-14 18:20:39+00:00)
Title: Regexp as paired delimiters

Here's an idea for highlighting regexps: classify them as paired delimiters, which the Emacs Lisp manual describes as:

> Similar to string quote characters, except that the syntactic properties of the characters between the delimiters are not suppressed. Only TeX mode uses a paired delimiter presently—the ‘$’ that both enters and leaves math mode.

Maybe this is nutty, I don't know. It seems to work fine with the following example:

```
re = /thing to be found/
brokenRe = /thing#/
string = "string"
division = 1 / 0
# Comment /regex/
```

And doesn't regress #110.

My Emacs Lisp fell short of getting this highlighting to work by adding a var to `coffee-font-lock-keywords` like all the other regexps, so I kind of brute-forced it with `font-lock-add-keywords` but maybe someone with more skill can use this as inspiration to do it correctly!