[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Yanking text properties
From: |
Per Abrahamsen |
Subject: |
Yanking text properties |
Date: |
Thu, 01 Nov 2001 11:19:59 +0100 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.106 (i686-pc-linux-gnu) |
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.
It is the field property which has made this question actual.
We can solve this problem partly in Gnus, which is what we have done
until now. Here are two strategies:
1. Use a lot of "(let ((inhibit-read-only t))" and the like in the
code that manipulates the buffer.
2. Set `inhibit-read-only' and the like as a buffer local variable.
However, it might be worth solving it at the Emacs level. If nothing
else, we need "and the like" for all the special text properties.
Aren't there some properties we never want to yank? In that case we
could change Emacs to
3. Never copy these special text properties with kill/yank.
Or we could do it with a buffer local variable:
4. (setq yank-ignore-properties '(field read-only intangible)
Or we could disable the special properties on a buffer per buffer
basis, so they are still copied, just ignored:
5. (setq inhibit-text-properties '(field read-only intangible))
(this one is close to #2).
Which one do you think we (either the Emacs or Gnus developers) should
implement. I'm most fond of #3, assumed noone can think of an
application where we _want_ to yank the special text properties? If
so, maybe these buffers should set a special option to do so?
- Yanking text properties,
Per Abrahamsen <=