From mboxrd@z Thu Jan  1 00:00:00 1970
Path: main.gmane.org!not-for-mail
From: Stefan <monnier@iro.umontreal.ca>
Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta
Subject: Re: intern-soft, find-face/get-face, and facep for determining
 faces' definedness
Date: Tue, 02 Nov 2004 07:01:49 -0500
Message-ID: <m1is8oh3qq.fsf-monnier+emacs@gnu.org>
References: <0whwtx5meng.fsf@rescomp.Stanford.EDU.i-did-not-set--mail-host-address--so-tickle-me>
	<87k6t4rd5b.fsf@tleepslib.sk.tsukuba.ac.jp>
	<847aaaf204110123282bb4ddd8@mail.gmail.com>
	<buofz3szobh.fsf@mctpc71.ucom.lsi.nec.co.jp>
	<847aaaf20411020048201a2419@mail.gmail.com>
	<buo654ozkhq.fsf@mctpc71.ucom.lsi.nec.co.jp>
	<87mzy0pl0o.fsf@tleepslib.sk.tsukuba.ac.jp>
NNTP-Posting-Host: deer.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: sea.gmane.org 1099396973 2206 80.91.229.6 (2 Nov 2004 12:02:53 GMT)
X-Complaints-To: usenet@sea.gmane.org
NNTP-Posting-Date: Tue, 2 Nov 2004 12:02:53 +0000 (UTC)
Cc: xemacs-beta@xemacs.org, emacs-devel@gnu.org,
	Brian Palmer <bpalmer@gmail.com>,
	Brian Palmer <bpalmer@rescomp.stanford.edu>, Miles Bader <miles@gnu.org>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 02 13:02:40 2004
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Original-Received: from lists.gnu.org ([199.232.76.165])
	by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian))
	id 1COxN2-0005FW-00
	for <ged-emacs-devel@m.gmane.org>; Tue, 02 Nov 2004 13:02:40 +0100
Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33)
	id 1COxV5-0003Zm-1j
	for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2004 07:10:59 -0500
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1COxUT-0003Zh-RP
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:10:21 -0500
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1COxUS-0003ZV-Vp
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:10:21 -0500
Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1COxUS-0003ZS-JK
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:10:20 -0500
Original-Received: from [206.47.199.163] (helo=simmts5-srv.bellnexxia.net)
	by monty-python.gnu.org with esmtp (Exim 4.34)
	id 1COxMF-0004vY-Ht; Tue, 02 Nov 2004 07:01:51 -0500
Original-Received: from empanada.home ([67.71.24.49]) by simmts5-srv.bellnexxia.net
	(InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP
	id <20041102120150.MJVE1635.simmts5-srv.bellnexxia.net@empanada.home>; 
	Tue, 2 Nov 2004 07:01:50 -0500
Original-Received: by empanada.home (Postfix, from userid 502)
	id 476D2350403; Tue,  2 Nov 2004 07:01:49 -0500 (EST)
Original-To: "Stephen J. Turnbull" <stephen@xemacs.org>
In-Reply-To: <87mzy0pl0o.fsf@tleepslib.sk.tsukuba.ac.jp> (Stephen J.
	Turnbull's message of "Tue, 02 Nov 2004 20:07:03 +0900")
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=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:29315 gmane.emacs.xemacs.beta:16661
X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29315

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