<p>When I type the following code in Emacs ruby-mode, the "#{foo}" is fontified in a different color than the enclosing string.  How do I do this in my own Emacs mode?  I tried to decipher the ruby-mode source code but couldn't understand it in a reasonable amount of time.</p>

<pre><code>"a #{foo} a"
</code></pre>

Search for where ruby-mode.el sets
```
font-lock-syntactic-keywords
```
:
```
```
(setq ruby-font-lock-syntactic-keywords
  '(
    ;; #{ }, #$hoge, #@foo are not comments
    ("\\(#\\)[{$@]" 1 (1 . nil))
```
```
Here's some documentation on the similar
```
font-lock-keywords
```
variable, which is what you should use to accomplish the same type of fontification.