emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: read-face-name bugs


From: Drew Adams
Subject: RE: read-face-name bugs
Date: Fri, 30 Jun 2006 21:11:21 -0700

        2. I think the code is wrong for the case where there is a face
           property like this on the character: ((foreground-color
           "Firebrick")).

    It seems to give the right results: it finds no face names
    and `faces' is empty.

    In what way do you think this is incorrect?

           To test this, do M-x debug-on-entry read-face-name, and then M-x
           customize-face font-lock-comment-face. Then, put point on the
           second "sample" text (next to the foreground field), and do M-:
           (read-face-name "foo"). Step through the debugger, and you'll see
           that the ((foreground-color . "Firebrick")) case falls
           through the crack.

I believe that it is seeming to do the right thing, for the wrong reason.

The test that this is designed to detect fails to do what it is supposed to,
because, unlike, say, (:foreground "Firebrick"), there is a second level of
consing in this: ((foreground-color . "Firebrick")). The correct test in
this case is caar, not car.

So, the code does not correctly treat this as a (sort of) face attribute
list; instead, it treats it as a list of faces. It is then in the iteration
over this "list of faces" that no face is recognized (since it is not
actually a list of faces), and it "gives the right results".






reply via email to

[Prev in Thread] Current Thread [Next in Thread]