Subject: Re: bug#8376: 23.3; font-lock-face doesn't get yanked

From: Chong Yidong <[email-masked]>
Date: Sat, 18 Aug 2012 13:36:08 +0800

Uday S Reddy <[email-masked]> writes:

> My context was in writing email messages in mail-mode/message-mode,
> both of which use font-lock to fontify the headers and the cited text.
>
> VM has functions that put "attachment buttons" into the mail-mode
> buffers, which are have data stored in text properties.  I wanted to
> put a face on them to make them look like "buttons".  It works fine
> normally but it is not preserved under killing and yanking.

The reason font-lock-face is removed in buffers in which font-lock is
active is that font-lock-face is typically applied by programs, so it
would be wrong for a user-level operation like yanking to apply it.

This is a rule of thumb; there is no right or wrong answer.  If you
prefer to preserve font-lock-face, I've added to trunk a new option
`yank-handled-properties' which can be customized to get the behavior
you want.