title: In C/C++ mode in Emacs, change face of code in #if 0...#endif block to comment face
body: <p>I'm trying to add functionality found in some other code editors to my Emacs configuration, whereby C/C++ code within #if 0...#endif blocks is automatically set to the comment face/font.  Based on my testing, <em>cpp-highlight-mode</em> does something like what I want, but requires user action.   It seems like tying into the font-lock functionality is the correct option to make the behavior automatic.</p>
  
  <p>I have successfully followed examples in the GNU documentation to change the face of single-line regular expressions.  For example:</p>
  
  <pre><code>(add-hook 'c-mode-common-hook
    (lambda ()
      (font-lock-add-keywords nil
        '(("\\&lt;\\(FIXME\\|TODO\\|HACK\\|fixme\\|todo\\|hack\\)" 1 
          font-lock-warning-face t)))))
  </code></pre>
  
  <p>works fine to highlight debug related keywords anywhere in a file.  However, I am having problems matching #if 0...#endif as a multiline regular expression.  I found some useful information in this post (<a href="https://stackoverflow.com/questions/4507743/how-to-compose-region-like-php-foo-bar">How to compose region like &quot;&lt;?php foo; bar; ?&gt;&quot;</a>), that suggested that Emacs must be told specifically to allow for multiline matches.  But this code:</p>
  
  <pre><code>(add-hook 'c-mode-common-hook
    (lambda ()
      '(progn
        (setq font-lock-multiline t)
        (font-lock-add-keywords nil
          '(("#if 0\\(.\\|\n\\)*?#endif" 1
            font-lock-comment-face t))))))
  </code></pre>
  
  <p>still does not work for me.  Perhaps my regular expression is wrong (though it appears to work using <em>M-x re-builder</em>), I've messed up my syntax, or I'm following the wrong approach entirely.  I'm using Aquamacs 2.1 (which is based on GNU Emacs 23.2.50.1) on OS X 10.6.5, if that makes a difference.</p>
  
  <p>Any assistance would be appreciated!</p>