unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6154: error from: describe-face font-lock-*
       [not found] <h2m20ecf6c71005092257vefcec2ffv4a4b79c39e9294e@mail.gmail.com>
@ 2010-05-10 13:58 ` David Reitter
  2010-05-10 15:37   ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: David Reitter @ 2010-05-10 13:58 UTC (permalink / raw)
  To: 6154; +Cc: nathaniel.cunningham

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

X-Debbugs-CC: nathaniel.cunningham@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@gmail.com>
> Date: May 10, 2010 1:57:32 AM EDT
> To: Development of Aquamacs Emacs <aquamacs-devel@aquamacs.org>
> Subject: [Aquamacs-devel] error from: describe-face font-lock-*
> Reply-To: Aquamacs Developers <aquamacs-devel@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.


[-- Attachment #2: Type: text/html, Size: 5951 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#6154: error from: describe-face font-lock-*
  2010-05-10 13:58 ` bug#6154: error from: describe-face font-lock-* David Reitter
@ 2010-05-10 15:37   ` Stefan Monnier
  2010-05-10 23:04     ` David Reitter
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2010-05-10 15:37 UTC (permalink / raw)
  To: David Reitter; +Cc: nathaniel.cunningham, 6154

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6154: error from: describe-face font-lock-*
  2010-05-10 15:37   ` Stefan Monnier
@ 2010-05-10 23:04     ` David Reitter
  2010-05-11  3:21       ` Dan Nicolaescu
  0 siblings, 1 reply; 6+ messages in thread
From: David Reitter @ 2010-05-10 23:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: nathaniel.cunningham, 6154

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)






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6154: error from: describe-face font-lock-*
  2010-05-10 23:04     ` David Reitter
@ 2010-05-11  3:21       ` Dan Nicolaescu
  2010-05-11  3:43         ` David Reitter
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Nicolaescu @ 2010-05-11  3:21 UTC (permalink / raw)
  To: David Reitter; +Cc: Stefan Monnier, 6154, nathaniel.cunningham

David Reitter <david.reitter@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)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6154: error from: describe-face font-lock-*
  2010-05-11  3:21       ` Dan Nicolaescu
@ 2010-05-11  3:43         ` David Reitter
  2011-07-09 18:23           ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: David Reitter @ 2010-05-11  3:43 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: Stefan Monnier, 6154, nathaniel.cunningham

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







^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6154: error from: describe-face font-lock-*
  2010-05-11  3:43         ` David Reitter
@ 2011-07-09 18:23           ` Glenn Morris
  0 siblings, 0 replies; 6+ messages in thread
From: Glenn Morris @ 2011-07-09 18:23 UTC (permalink / raw)
  To: 6154-done


I don't see a need to keep open this particular report.
Faces aren't defined in C, they are defined in Lisp.







^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-09 18:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <h2m20ecf6c71005092257vefcec2ffv4a4b79c39e9294e@mail.gmail.com>
2010-05-10 13:58 ` bug#6154: error from: describe-face font-lock-* David Reitter
2010-05-10 15:37   ` Stefan Monnier
2010-05-10 23:04     ` David Reitter
2010-05-11  3:21       ` Dan Nicolaescu
2010-05-11  3:43         ` David Reitter
2011-07-09 18:23           ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).