From mboxrd@z Thu Jan  1 00:00:00 1970
Path: main.gmane.org!not-for-mail
From: Zajcev Evgeny <zevlg@yandex.ru>
Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta
Subject: Re: intern-soft, find-face/get-face, and facep for determining
 faces' definedness
Date: Wed, 03 Nov 2004 18:01:19 +0300
Message-ID: <82ekjbrn7k.fsf@us.dmz.local>
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>
	<m1is8oh3qq.fsf-monnier+emacs@gnu.org>
	<E1CPKVZ-0000vI-4N@fencepost.gnu.org>
	<jwv7jp3t3wv.fsf-monnier+emacs@gnu.org>
NNTP-Posting-Host: deer.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: sea.gmane.org 1099493733 17415 80.91.229.6 (3 Nov 2004 14:55:33 GMT)
X-Complaints-To: usenet@sea.gmane.org
NNTP-Posting-Date: Wed, 3 Nov 2004 14:55:33 +0000 (UTC)
Keywords: face,get-face,facep,object,set-face-foreground
Cc: rms@gnu.org, xemacs-beta@xemacs.org, emacs-devel@gnu.org,
	stephen@xemacs.org, bpalmer@rescomp.stanford.edu, miles@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 03 15:55:24 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 1CPMXj-0001rX-00
	for <ged-emacs-devel@m.gmane.org>; Wed, 03 Nov 2004 15:55:24 +0100
Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33)
	id 1CPMfq-0000XX-9g
	for ged-emacs-devel@m.gmane.org; Wed, 03 Nov 2004 10:03:46 -0500
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1CPMff-0000XO-NB
	for emacs-devel@gnu.org; Wed, 03 Nov 2004 10:03:35 -0500
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1CPMff-0000X4-1f
	for emacs-devel@gnu.org; Wed, 03 Nov 2004 10:03:35 -0500
Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1CPMfe-0000Wu-SO
	for emacs-devel@gnu.org; Wed, 03 Nov 2004 10:03:34 -0500
Original-Received: from [82.179.205.12] (helo=relay.mortal.ru)
	by monty-python.gnu.org with esmtp (Exim 4.34)
	id 1CPMX5-0006Ks-37; Wed, 03 Nov 2004 09:54:43 -0500
Original-Received: from us.dmz.local (wus000.dmz.local [10.32.1.6])
	by relay.mortal.ru (8.11.6/8.11.6) with ESMTP id iA3Eqhd30821;
	Wed, 3 Nov 2004 17:52:43 +0300
Original-Received: from us.dmz.local (localhost.dmz.local [127.0.0.1])
	by us.dmz.local (8.12.3/8.12.3) with ESMTP id iA3F1KTs001835;
	Wed, 3 Nov 2004 18:01:20 +0300 (MSK) (envelope-from zevlg@yandex.ru)
Original-Received: (from wtc05@localhost)
	by us.dmz.local (8.12.3/8.12.3/Submit) id iA3F1J66001834;
	Wed, 3 Nov 2004 18:01:19 +0300 (MSK)
X-Authentication-Warning: us.dmz.local: wtc05 set sender to zevlg@yandex.ru
	using -f
Original-To: Stefan Monnier <monnier@iro.umontreal.ca>
X-Face: "5}C(Ve&0,cfnPM*.j!SMQTCsm^+Wk+i~W\_k9qVJdd*uc#}o)(YzI"M*@M9{xWh4WV-o7hq0CBmtE%<KPB;
	f; w,@)@}v>(4J(Qw1y@JpI,Eb3".Y/qD|O/]'nD
In-Reply-To: <jwv7jp3t3wv.fsf-monnier+emacs@gnu.org> (Stefan Monnier's
	message of "Wed, 03 Nov 2004 09:15:36 -0500")
User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Reasonable Discussion,
	berkeley-unix)
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:29391 gmane.emacs.xemacs.beta:16678
X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29391

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>     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 don't understand what you mean here.  As far as I know, if (facep
>> 'foo) returns nil, then (set-face-foreground 'foo "red") will signal
>> an error, "Invalid face".  Conversely, if you define foo as face, then
>> (facep 'foo) will return t.
>
> Yes, that's what happens under Emacs.  I was talking about XEmacs,
> tho.

The thing is that XEmacsen `facep' returns non-nil only on face
objects, not on their names or anything else, however `get-face' does
all tricks - it returns face object getting face object or face name
or anything else as input.  Here is:

   (eq (get-face (get-face 'blue)) (get-face 'blue))
   => t

i.e. `get-face' behavious as 'identity if input is face object and
does some job in finding face object by its name if input is symbol
that denotes face (face's name).

Most of functions that deal with faces should use `(facep (get-face
<face>))' sexp to check face validity.

As described above I believe that `set-face-foreground' just does
`get-face' before operating on face.

-- 
lg