Subject: bug#4835: 23.1; Improper `Invalid face reference' messages. Performance degraded.

From: Chong Yidong <[email-masked]>
Date: Sat, 31 Oct 2009 14:59:38 -0400

> 2. The code I had seems nevertheless to "work", in the sense that it
> does what I expect (highlights the column). Except that it logs those
> messages and the performance is terrible.

I suspect this is because parts of font-lock do this:

  (if (stringp matcher)
      (re-search-forward matcher end t)
   (funcall matcher end)))

while other parts do this:

  (font-lock-eval-keywords (if (fboundp keywords)
                               (funcall keywords)
                             (eval keywords)))))

If `matcher' is a lambda expression, the first will work as expected,
because you can pass a lambda to funcall.  But the second will do the
wrong thing.

We should probably fix the code to check for and disallow lambda
expressions (and the docs), assuming not too much external code is
relying on the unintended behavior.