emacs-devel
[Top][All Lists]
Advanced

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

Re: `add-face'


From: Lars Ingebrigtsen
Subject: Re: `add-face'
Date: Fri, 07 Sep 2012 15:46:11 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

Chong Yidong <address@hidden> writes:

> 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.)

My current implementation just alters add_properties from

            /* I's property has a different value -- change it */
            Fsetcar (this_cdr, val1);

to
            
            /* I's property has a different value -- change it */
            if (replace)
              Fsetcar (this_cdr, val1);
            else
              Fsetcar (this_cdr, Fcons (val1, Fcar (this_cdr)));

so it's kinda trivial, and entails no searching for properties.  (Well,
beyond what `add-text-properties' does when looking through the buffer.
But it looks pretty efficient to me.)

I'm not sure I totally follow the logic of `add-text-properties' in
detail, though.

But I'll do some benchmarking with the native and
`next-single-property-change' versions.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



reply via email to

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