unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: xemacs-beta@xemacs.org,
	Brian Palmer <bpalmer@rescomp.stanford.edu>,
	emacs-devel@gnu.org
Subject: Re: intern-soft, find-face/get-face, and facep for determining faces' definedness
Date: Tue, 02 Nov 2004 21:06:56 +0900	[thread overview]
Message-ID: <87d5ywpi8v.fsf@tleepslib.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <buozn20y3ya.fsf@mctpc71.ucom.lsi.nec.co.jp> (Miles Bader's message of "Tue, 02 Nov 2004 18:50:53 +0900")

>>>>> "Miles" == Miles Bader <miles@lsi.nec.co.jp> 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.

  reply	other threads:[~2004-11-02 12:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-01 21:40 intern-soft, find-face/get-face, and facep for determining faces' definedness Brian Palmer
2004-11-02  6:14 ` Stephen J. Turnbull
2004-11-02  7:28   ` Brian Palmer
2004-11-02  7:45     ` Miles Bader
2004-11-02  8:48       ` Brian Palmer
2004-11-02  9:08         ` Miles Bader
2004-11-02  9:21           ` Brian Palmer
2004-11-02  9:50             ` Miles Bader
2004-11-02 12:06               ` Stephen J. Turnbull [this message]
2004-11-02 22:20                 ` Miles Bader
2004-11-06  9:31                   ` Oliver Scholz
2004-11-02 11:07           ` Stephen J. Turnbull
2004-11-02 12:01             ` Stefan
2004-11-02 22:23               ` Miles Bader
2004-11-03 12:45               ` Richard Stallman
2004-11-03 14:15                 ` Stefan Monnier
2004-11-03 15:01                   ` Zajcev Evgeny
2004-11-03 15:20                     ` Andreas Schwab
2004-11-03 15:54                       ` Zajcev Evgeny
2004-11-04  9:28                         ` Stephen J. Turnbull
2004-11-03 15:48                     ` Stefan Monnier
2004-11-04  3:41               ` Stephen J. Turnbull
2004-11-05  7:55                 ` Stefan
2004-11-09 14:41                   ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d5ywpi8v.fsf@tleepslib.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=bpalmer@rescomp.stanford.edu \
    --cc=emacs-devel@gnu.org \
    --cc=xemacs-beta@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).