all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ben Wing" <ben@666.com>
Cc: 'Jamie Zawinski' <jwz@jwz.org>, emacs-devel@gnu.org
Subject: Re: intern-soft, find-face/get-face, and facep for determiningfaces' definedness
Date: Fri, 5 Nov 2004 21:36:48 -0600	[thread overview]
Message-ID: <043e01c4c3b1$d9414e60$210110ac@NEEEEEEE> (raw)

You are right about the philosophical convictions.

At least that's why facep only works on face objects, because that's how
common lisp works.

The exposure of face objects goes back to lemacs, probably with temporary
(anonymous) faces in mind.

Same for font/color objects.  This was clearly a philosophical choice on
jwz's part.

Many other objects were since exposed by me by analogy, although it may be
questionable.  Certainly exposing consoles was questionable [even their
existence is questionable -- when I first wrote things, they didn't exist,
but then I got berated from mly, and was not smart enough to ignore him].

-----------------------------

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

                 reply	other threads:[~2004-11-06  3:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to='043e01c4c3b1$d9414e60$210110ac@NEEEEEEE' \
    --to=ben@666.com \
    --cc=emacs-devel@gnu.org \
    --cc=jwz@jwz.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.