From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Ben Wing" Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta Subject: Re: intern-soft, find-face/get-face, and facep for determiningfaces' definedness Date: Fri, 5 Nov 2004 21:36:48 -0600 Message-ID: <043e01c4c3b1$d9414e60$210110ac@NEEEEEEE> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1099712131 2026 80.91.229.6 (6 Nov 2004 03:35:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Nov 2004 03:35:31 +0000 (UTC) Cc: 'Jamie Zawinski' , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 06 04:35:22 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CQHMI-0003s9-00 for ; Sat, 06 Nov 2004 04:35:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CQHUW-00085K-Ek for ged-emacs-devel@m.gmane.org; Fri, 05 Nov 2004 22:43:52 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CQHUO-000851-MA for emacs-devel@gnu.org; Fri, 05 Nov 2004 22:43:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CQHUO-00084p-8Q for emacs-devel@gnu.org; Fri, 05 Nov 2004 22:43:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CQHUO-00084m-5S for emacs-devel@gnu.org; Fri, 05 Nov 2004 22:43:44 -0500 Original-Received: from [66.163.168.179] (helo=smtp800.mail.sc5.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1CQHLp-00073X-73 for emacs-devel@gnu.org; Fri, 05 Nov 2004 22:34:53 -0500 Original-Received: from unknown (HELO NEEEEEEE) (benwing@sbcglobal.net@67.67.219.85 with login) by smtp800.mail.sc5.yahoo.com with SMTP; 6 Nov 2004 03:34:51 -0000 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29466 gmane.emacs.xemacs.beta:16732 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29466 You are right about the philosophical convictions. At least that's why facep only works on face objects, because that's how common lisp works. The exposure of face objects goes back to lemacs, probably with = temporary (anonymous) faces in mind. Same for font/color objects. This was clearly a philosophical choice on jwz's part. Many other objects were since exposed by me by analogy, although it may = be questionable. Certainly exposing consoles was questionable [even their existence is questionable -- when I first wrote things, they didn't = exist, but then I got berated from mly, and was not smart enough to ignore = him]. ----------------------------- Miles> What's a "face object" in Emacs? > A symbol, I should think. I was confused by the fact that `facep' > returns a vector of length 17 whose first element is the symbol 'face. > However, I would guess that that's a useless artifact of the > implementation, since (facep (facep 'bold)) is nil. I've never seen the vector used in Elisp for anything, so yes: it's just a useless (and arguably ugly) artifact of the implementation. Miles> [Indeed, what's a "face object" in Xemacs?] > A C structure wrapped in Lisp housekeeping information that implements > a face. I'm not sure why they were exposed to Lisp in the first > place; I suspect to avoid repeated lookups in code that compares faces > to determine if they contrast and the like. Probably a premature > optimization. I doubt the motivation was optimization. I think it had more to do with philosophical convictions. > A face name is a symbol. A face object is a data structure. I still don't understand why (facep 'foo) returns nil, even though (put-text-property (point) (+ 10 (point)) 'face 'foo) and (set-face-foreground 'foo "red") work just fine. I think `facep' should return non-nil iff the parameter = can be used at those places where faces are expected, so it should return non-nil for symbols (assuming the symbol is indeed the name of an = existing face, of course). Just like (progn (fset 'foobar (make-keymap)) (keymapp 'foobar)) return t rather than nil. Stefan