[Top][All Lists]

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

Re: Trying to define face dynamically

From: Óscar Fuentes
Subject: Re: Trying to define face dynamically
Date: Thu, 17 Oct 2019 21:54:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> (mapcar (lambda (face)
>>            (face-remap-add-relative
>>               face `(:filtered (:window has-keyboard-focus nil)
>>                      :background ,(color-darken-name
>>                                    (face-attribute face :background)
>>                                 10.0))))
>>     '(default fringe))
>> But this has not the desired effect: faces remain the same and every now
>> and then Emacs throws an error "wrong-type-argument stringp nil" from
>> functions such as font-info.
>> What I'm doing wrong?
> You didn't say what color-darken-name does, but I think the problem is
> that ':background "foo"' is not a face spec.  Did you try something
> like '(background-color . ,(color-darken-name ...))' or maybe
> '(:background ,(color-darken-name ...))' instead?

Thanks. Changing to either of your suggestions eliminates the error, but
the face is not altered.

My try was based on the example on the Info node of Face Remapping, that
shows this example:

          (face-remap-add-relative 'default :height 1.5)

which is itself confusing as the docstring says

"... SPECS, should form either a list of face names, or a property list
     of attribute/value pairs."

color-darken-name is a function defined in lisp/color.el.

reply via email to

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