emacs-devel
[Top][All Lists]
Advanced

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

Re: `add-face'


From: Chong Yidong
Subject: Re: `add-face'
Date: Fri, 07 Sep 2012 21:31:00 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

>> Is it really necessary to modify `add-text-properties' to get this work,
>> though?  It seems to me that next-single-property-change gives you
>> enough information to do the job without changing the internals.
>
> I was mainly thinking about speed.  shr.el, for instance, adds a lot of
> faces, and it needs all the help it can get to speed stuff up.  For
> larger HTML documents it's too slow now, and this more complex way of
> adding faces won't help.
>
> And the changes are pretty minimal, and may be generally useful.

My main concern is that modifying list values of text properties in this
way seems a bit too high-level for add-text-properties.  It's mostly the
`face' property that needs this kind of list management, and the details
of the needed list management work (e.g. you'll probably want to use
`add-to-list' to avoid adding duplicate faces) are pretty specific to
the `face' property.  So bolting this onto add-text-properties seems
wrong.

If speed is really an issue, we could make add-face-text-property a
primitive instead of modifying add-text-properties.

First, though, I'd suggest trying to use next-single-property-change
with a Lisp implementation, and checking if it really isn't fast enough.
You might be surprised.  (After all, even if you are doing it in C, you
will probably still be using Fnext_single_property_change.)



reply via email to

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