emacs-devel
[Top][All Lists]
Advanced

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

Re: Yanking text properties


From: Stefan Monnier
Subject: Re: Yanking text properties
Date: Thu, 01 Nov 2001 18:44:11 -0500

> A common problem in message mode (the Gnus mail and news composition
> mode) is special text properties accidentally yanked into the buffer,
> typically from the Gnus summary buffer which contain lots of such
> properties.  
> 
> - For the field and intangible properties, this mean that the code to
>   manipulate the headers may get improper results.
> - For the invisible property, it means users may send text they did
>   not intent to send.
> - For the read-only property, it means the user get strange and
>   unexpected errors.
> - For the mouse-face property, it means the buffer will look strange
>   and confusing to the user.

I agree that there's a problem with all those properties: some of them
relate to the actual chars (i.e. real text properties) while others
only make sense in their original context (i.e. should be stripped
when copying the text, `field' being a particularly striking example).

I'm not sure what's the best solution, but a (buffer-local)
variable holding a list of text-properties that should be stripped
by `yank' shounds like a good starting point.

Of course, maybe another solution is to make sure that those
things that should be stripped never get there in the first place:
make them overlays rather than text-properties.  Is a `field'
text-property ever meaningful ?  Shouldn't it always be used in an
overlay instead ?


        Stefan

PS: What about character compositions, by the way.  Should those
composition text-properties by preserved even when we do
`buffer-substring-no-properties' ?
Or is it assumed that they will get re-created as necessary when the text
is inserted into the buffer ?




reply via email to

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