From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stephen J. Turnbull" 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 21:06:56 +0900 Organization: The XEmacs Project Message-ID: <87d5ywpi8v.fsf@tleepslib.sk.tsukuba.ac.jp> 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> <847aaaf20411020048201a2419@mail.gmail.com> <847aaaf20411020121678a0b5c@mail.gmail.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1099397271 2994 80.91.229.6 (2 Nov 2004 12:07:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Nov 2004 12:07:51 +0000 (UTC) Cc: xemacs-beta@xemacs.org, Brian Palmer , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 02 13:07:38 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 1COxRq-0005Zk-00 for ; Tue, 02 Nov 2004 13:07:38 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1COxZs-0005ap-1D for ged-emacs-devel@m.gmane.org; Tue, 02 Nov 2004 07:15:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1COxZQ-0005ZF-GJ for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:15:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1COxZM-0005Yf-8o for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:15:26 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1COxZJ-0005Yb-Kb for emacs-devel@gnu.org; Tue, 02 Nov 2004 07:15:23 -0500 Original-Received: from [130.158.98.109] (helo=tleepslib.sk.tsukuba.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1COxRC-0005hN-Aw; Tue, 02 Nov 2004 07:06:58 -0500 Original-Received: from steve by tleepslib.sk.tsukuba.ac.jp with local (Exim 3.36 #1 (Debian)) id 1COxRA-0000tr-00; Tue, 02 Nov 2004 21:06:56 +0900 Original-To: Miles Bader In-Reply-To: (Miles Bader's message of "Tue, 02 Nov 2004 18:50:53 +0900") User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.5 (chayote, linux) 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:29316 gmane.emacs.xemacs.beta:16662 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29316 >>>>> "Miles" == Miles Bader writes: Miles> To be reasonably compatible with Xemacs, it would be Miles> necessary to know what exactly a face-object (such as Miles> returned by `find-face') is useful for, and I don't. As an optimization. You can avoid a table lookup if you have the object. We also have truly anonymous temporary faces, which get garbage collected simply by dropping them on the floor, as they never get entered into any tables. Another optimization; I guess you could use gensyms and key-weak hash tables to get the same effect nowadays. Offhand I'd guess the other APIs (ie, except for `facep) all accept either a face name or a face object. The only tricky thing about find-face is that it needs to be idempotent: (Assert (null (find-face (find-face [nope])))) ; not a symbol (Assert (null (find-face (find-face nil)))) ; a special non-face symbol (Assert (null (find-face (find-face (gensym))))) ; a non-face symbol (Assert (eq (find-face 'default) (find-face (find-face 'default)))) I think that gives full coverage. Your definition of find-face should be fine, except possibly for XEmacs APIs Emacs doesn't have. -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.