emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

overriding a face [was: 23.0.50; face-problems with multy-tty]


From: Drew Adams
Subject: overriding a face [was: 23.0.50; face-problems with multy-tty]
Date: Sun, 30 Sep 2007 16:53:43 -0700

> From: Richard Stallman Sent: Friday, September 14, 2007 12:05 AM
> Subject: Re: 23.0.50; face-problems with multy-tty
>
>     > "something analogous to what `setq' does for `defvar' and
>     > `defcustom'. Something, for instance, that a user can put in
>     > .emacs to override a predefined `defface'.
>
> I am in favor of it.

Maybe something like this would be a start?

(defmacro set-face (face spec &optional doc &rest args)
  "Set the spec for face symbol FACE to SPEC.
If FACE is a face, then FACE and SPEC are passed
 to `face-spec-set'.
Otherwise, all arguments are passed to `defface'."
  `(if (facep ',face)
       (face-spec-set ',face ,spec)
     (defface ,face ,spec ,(or doc "REPLACE ME") ,@args)))

Perhaps that's not entirely correct, but maybe it will stimulate someone who
knows about this sort of thing to correct it.

That seems to do what I was asking, in any case.  The idea is that a user or
Lisp code could use (set-face face spec) to define a new face or to override
the definition of an existing face.

But maybe this would be taken care of by Richard's proposed change to
`face-spec-set'? (I don't fully understand that.)








reply via email to

[Prev in Thread] Current Thread [Next in Thread]