GNU bug report logs - #6154
error from: describe-face font-lock-*

Previous Next

Package: emacs;

Reported by: David Reitter <david.reitter <at> gmail.com>

Date: Mon, 10 May 2010 14:15:03 UTC

Severity: minor

Tags: wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6154 in the body.
You can then email your comments to 6154 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, nathaniel.cunningham <at> gmail.com, bug-gnu-emacs <at> gnu.org:
bug#6154; Package emacs. (Mon, 10 May 2010 14:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to David Reitter <david.reitter <at> gmail.com>:
New bug report received and forwarded. Copy sent to nathaniel.cunningham <at> gmail.com, bug-gnu-emacs <at> gnu.org. (Mon, 10 May 2010 14:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Bug-Gnu-Emacs <bug-gnu-emacs <at> gnu.org>
Subject: error from: describe-face font-lock-*
Date: Mon, 10 May 2010 09:58:10 -0400
[Message part 1 (text/plain, inline)]
X-Debbugs-CC: nathaniel.cunningham <at> gmail.com

`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'.

I suggest the patch below. 



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




diff --git a/lisp/faces.el b/lisp/faces.el
index 740c7f7..5994f3e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1406,12 +1406,14 @@ If FRAME is omitted or nil, use the selected frame."
 		(setq file-name (find-lisp-object-file-name f 'defface))
 		(when file-name
 		  (princ "Defined in `")
-		  (princ (file-name-nondirectory file-name))
+		  (princ (if (symbolp file-name) file-name
+			   (file-name-nondirectory file-name)))
 		  (princ "'")
 		  ;; Make a hyperlink to the library.
-		  (save-excursion
-		    (re-search-backward "`\\([^`']+\\)'" nil t)
-		    (help-xref-button 1 'help-face-def f file-name))
+		  (unless (symbolp file-name)
+		    (save-excursion
+		      (re-search-backward "`\\([^`']+\\)'" nil t)
+		      (help-xref-button 1 'help-face-def f file-name)))
 		  (princ ".")
 		  (terpri)
 		  (terpri))



Begin forwarded message:

> From: Nathaniel Cunningham <nathaniel.cunningham <at> gmail.com>
> Date: May 10, 2010 1:57:32 AM EDT
> To: Development of Aquamacs Emacs <aquamacs-devel <at> aquamacs.org>
> Subject: [Aquamacs-devel] error from: describe-face font-lock-*
> Reply-To: Aquamacs Developers <aquamacs-devel <at> aquamacs.org>
> 
> Just came across this error:
> M-x describe-face [RET] font-lock-constant-face [RET]
> 
> Wrong type argument: stringp, C-source
> 
> No *Help* frame appears.  If I then describe a different face sucessfully, e.g. tabbar-default, then repeat the sequence above, the *Help* frame get reused, and says:
> 
> Face: font-lock-constant-face (sample) (customize this face)
> 
> Documentation:
> Font Lock mode face used to highlight constants and labels.
> 
> Defined in `
> 
> I get the same error for all the font-lock faces tested so far, but no others.

[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6154; Package emacs. (Mon, 10 May 2010 15:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 6154 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: David Reitter <david.reitter <at> gmail.com>
Cc: nathaniel.cunningham <at> gmail.com, 6154 <at> debbugs.gnu.org
Subject: Re: bug#6154: error from: describe-face font-lock-*
Date: Mon, 10 May 2010 11:37:14 -0400
> `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.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6154; Package emacs. (Mon, 10 May 2010 23:06:02 GMT) Full text and rfc822 format available.

Message #11 received at 6154 <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: nathaniel.cunningham <at> gmail.com, 6154 <at> debbugs.gnu.org
Subject: Re: bug#6154: error from: describe-face font-lock-*
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)





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6154; Package emacs. (Tue, 11 May 2010 03:22:02 GMT) Full text and rfc822 format available.

Message #14 received at 6154 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: David Reitter <david.reitter <at> gmail.com>
Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 6154 <at> debbugs.gnu.org,
	nathaniel.cunningham <at> gmail.com
Subject: Re: bug#6154: error from: describe-face font-lock-*
Date: Mon, 10 May 2010 23:21:07 -0400
David Reitter <david.reitter <at> gmail.com> writes:

> 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")

Why would you do that?  font-lock is loadup.el.

> 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)




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6154; Package emacs. (Tue, 11 May 2010 03:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 6154 <at> debbugs.gnu.org (full text, mbox):

From: David Reitter <david.reitter <at> gmail.com>
To: Dan Nicolaescu <dann <at> gnu.org>
Cc: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, 6154 <at> debbugs.gnu.org,
	nathaniel.cunningham <at> gmail.com
Subject: Re: bug#6154: error from: describe-face font-lock-*
Date: Mon, 10 May 2010 23:43:00 -0400
On May 10, 2010, at 11:21 PM, Dan Nicolaescu wrote:
>> 
>> add a lisp/site-load.el file with the contents
>> 
>> (load "font-lock")
> 
> Why would you do that?  font-lock is loadup.el.

Thank you, I'll remove that.

Still not sure why it would make a difference, or why the symptoms are what they are...






Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 09 Jul 2011 18:24:01 GMT) Full text and rfc822 format available.

Notification sent to David Reitter <david.reitter <at> gmail.com>:
bug acknowledged by developer. (Sat, 09 Jul 2011 18:24:02 GMT) Full text and rfc822 format available.

Message #22 received at 6154-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 6154-done <at> debbugs.gnu.org
Subject: Re: bug#6154: error from: describe-face font-lock-*
Date: Sat, 09 Jul 2011 14:23:34 -0400
I don't see a need to keep open this particular report.
Faces aren't defined in C, they are defined in Lisp.






bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.