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 12:17:46 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

> So here's my suggestion for exposing this rather nice functionality in
> a more convenient form.
>
> Add a function `add-face', that will do what you think it does.  Or
> perhaps `add-face-region'?  Or `add-text-property-face'?
>
> Anyway, this will call `add-text-properties' with a new optional
> parameter NOREPLACE, that will tell `add-text-properties' to add to the
> list of properties instead of replacing.  This, in turn, will then call
> add_properties with a new parameter, and it will do the trivial list
> manipulation stuff instead of just
>
>           Fsetcar (this_cdr, val1);
>
> If this sounds like a good idea, I can implement this right away.  And
> then change shr.el to use the new function, which should speed table
> rendering up a bit, as well as getting rid of some uglee code.

I guess you already added this to upstream Gnus, with an add-face
function defined in gnus-compat.el.  This broke Gnus in trunk when it
got merged into trunk, so I reverted it.

As for the idea, it sounds good in principle.  I think either
`add-face-text-property' or `face-add-text-property' would be a better
name.

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.

Someone should also check if this mechanism plays well with M-x
highlight-regexp.



reply via email to

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