emacs-devel
[Top][All Lists]
Advanced

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

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


From: Lars Ingebrigtsen
Subject: Re: Idea: Be able to use text properties as face attributes
Date: Wed, 29 Mar 2017 17:21:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> IOW, I'm still struggling to understand why you attach this feature to
> faces, and to faces only.

I may well be misunderstanding what Drew is asking for, because I didn't
understand it the first four times he explained it, either.  But I think
he's asking for something that works like a face, but includes all text
properties.

That is:  He wants to say

(defprop my-prop '(:read-only t :invisible nil :font "futura"))
(set-text-prop (point-min) (+ (point-min) 4) my-prop)
(set-text-prop (+ (point-min) 10) (+ (point-min) 20) my-prop)

and then

(set-prop my-prop :invisible t)

and then these two ranges would suddenly become invisible.  So it's
like...  a CSS selector...  kinda.

The thing is, I think you can just cheat and this thing is already
available?  That is, just make my-prop a list, apply that list to the
regions you are interested in, and then just mutate that list instead of
using the property functions?  Or does set-text-properties copy
PROPERTIES before putting them on the text?  I have neither tested nor
read the source code.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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