From mboxrd@z Thu Jan  1 00:00:00 1970
Path: main.gmane.org!not-for-mail
From: Brian Palmer <bpalmer@gmail.com>
Newsgroups: gmane.emacs.devel,gmane.emacs.xemacs.beta
Subject: Re: intern-soft, find-face/get-face,
	and facep for determining faces' definedness
Date: Tue, 2 Nov 2004 00:28:41 -0700
Message-ID: <847aaaf204110123282bb4ddd8@mail.gmail.com>
References: <0whwtx5meng.fsf@rescomp.Stanford.EDU.i-did-not-set--mail-host-address--so-tickle-me>
	<87k6t4rd5b.fsf@tleepslib.sk.tsukuba.ac.jp>
Reply-To: Brian Palmer <bpalmer@gmail.com>
NNTP-Posting-Host: deer.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: sea.gmane.org 1099380582 26463 80.91.229.6 (2 Nov 2004 07:29:42 GMT)
X-Complaints-To: usenet@sea.gmane.org
NNTP-Posting-Date: Tue, 2 Nov 2004 07:29:42 +0000 (UTC)
Cc: xemacs-beta@xemacs.org, emacs-devel@gnu.org,
	Brian Palmer <bpalmer@rescomp.stanford.edu>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 02 08:29:36 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 1COt6m-00062N-00
	for <ged-emacs-devel@m.gmane.org>; Tue, 02 Nov 2004 08:29:36 +0100
Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33)
	id 1COtEo-0007og-IV
	for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2004 02:37:54 -0500
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33)
	id 1COtEe-0007nv-1K
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 02:37:44 -0500
Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33)
	id 1COtEd-0007nc-JS
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 02:37:43 -0500
Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.33) id 1COtEd-0007nX-HJ
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 02:37:43 -0500
Original-Received: from [216.239.56.250] (helo=mproxy.gmail.com)
	by monty-python.gnu.org with esmtp (Exim 4.34) id 1COt65-0001DC-3m
	for emacs-devel@gnu.org; Tue, 02 Nov 2004 02:28:53 -0500
Original-Received: by mproxy.gmail.com with SMTP id u52so81716cwc
	for <emacs-devel@gnu.org>; Mon, 01 Nov 2004 23:28:42 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references;
	b=oSD3op22pwQc2rqMALVVkREkOt86NGP9SsXC+c6r7k4tSW32rU1aLk/sN014HG3gbBpTSTzgRUS/aQp/o3pQ+QAi3ucvCrYrhi+xl8BYnkE8fbOxK68+Z/jLileXa83qshQEsHdDQ2DSE1rpyCqdch4XnDE1sTJxfKtPhpW+eHU=
Original-Received: by 10.11.119.70 with SMTP id r70mr576998cwc;
	Mon, 01 Nov 2004 23:28:41 -0800 (PST)
Original-Received: by 10.11.117.68 with HTTP; Mon, 1 Nov 2004 23:28:41 -0800 (PST)
Original-To: "Stephen J. Turnbull" <stephen@xemacs.org>
In-Reply-To: <87k6t4rd5b.fsf@tleepslib.sk.tsukuba.ac.jp>
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:29290 gmane.emacs.xemacs.beta:16644
X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29290

On Tue, 02 Nov 2004 15:14:08 +0900, Stephen J. Turnbull
<stephen@xemacs.org> wrote:
> >>>>> "Brian" == Brian Palmer <bpalmer@rescomp.stanford.edu> writes:
>     Brian> Xemacs developers, is there any reason that xemacs's facep
>     Brian> should not be extended to take either face objects or names
>     Brian> (so, for example, (facep 'bold) => t )?
> 
> Yes, there is.  That's what `find-face' is for.  We'd still probably
> want a way to distinguish between face names and face objects, and
> proving that (a) we don't currently have any code that depends on
> `facep''s behavior, and (b) that we'd never want it, is more work than
> this is worth.

Hmm. While that's fair enough, I think (facep 'bold) is a fairly 
intuitive thing to do, and returning nil is a surprise. So the name 
seems off to me.  I suppose for historical reasons...
 
>     Brian> Or could find-face/get-face be implemented for emacs? (They
>     Brian> seem like probably useful functions to me).
> 
> Your version wasn't quite right; it's
> 
> (defalias 'find-face 'facep)

find-face should not return a boolean, if it's going to be used portably
across the emacs branches. So maybe
(defun find-face (face) (if (facep face) (make-face face) nil))

> (defun get-face (face-or-name)
>   (or (find-face face-or-name)
>       (error "Face %s doesn't exist" face-or-name)))

True enough, that, for current compatibility. Ideally there'd be a 
structured error condition, though (as error's docstring says, 
"Although this usage  of `error' is very common, it is deprecated because it
totally defeats the purpose of having structured errors." )