[Top][All Lists]

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

Re: Idea: Be able to use text properties as face attributes

From: Yuri Khan
Subject: Re: Idea: Be able to use text properties as face attributes
Date: Mon, 27 Mar 2017 14:56:17 +0700

On Mon, Mar 27, 2017 at 2:14 AM, Drew Adams <address@hidden> wrote:

> The idea is to allow the use of text properties as
> attributes for the text (and overlay) properties `face',
> `font-lock-face', and `mouse-face'.  This would apply to
> faces used in strings (e.g., `propertize') as well as in
> buffers.
> It would let you, for example, use a property such as
> `invisible', `keymap', or `read-only' (even `display'?) as
> part of a face definition.

I can see a direct parallel between this proposal and the spirit of CSS.

Basically, an Emacs face is analogous to a CSS class, in that it is a
collection of properties affecting display, which can be added to and
removed from a run of text atomically as a whole.

Text properties, on the other hand, are analogous to applying styling
properties directly to text. Which makes them difficult to control.

> One open question would be whether to allow the text
> properties `face', `font-lock-face', and `mouse-face' as
> properties for themselves and each other.  E.g., be able
> to do this:
>   (set-face-attribute 'face-1 nil 'face 'face-2)

:inherit already does something similar.

reply via email to

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