Subject: bug#6154: error from: describe-face font-lock-*

From: David Reitter <[email-masked]>
Date: Mon, 10 May 2010 19:04:56 -0400

On May 10, 2010, at 11:37 AM, Stefan Monnier wrote:

>> `describe-face' assumes that `find-lisp-object-file-name' always
>> returns a file name.  I'm seeing the bug described below because we're
>> pre-loading font-lock and this function returns `C-source'.
> 
> All faces are defined in Lisp code, AFAIK, so the value `C-source' is
> not a correct one.  Without knowing how it happened, it's hard to tell
> where the problem should be fixed.

Perhaps "pre-loading font-lock" was not enough of a hint in my report.

With a recent Emacs 23 branch checkout:

add a lisp/site-load.el file with the contents

(load "font-lock")

then re-build.

Then, Emacs -Q, and

M-x describe-face RET font-lock-comment-face RET

will produce the error.  Trace, again, below.

So:

The `find-lisp-object-file-name' should probably return "font-lock.el" instead of `C-source'.

`describe-face' will break as it is should a face ever be defined in C.  See patch.

Debugger entered--Lisp error: (wrong-type-argument stringp C-source)
  file-name-nondirectory(C-source)
  describe-face((font-lock-comment-face))
  call-interactively(describe-face t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)