[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Text-Properties and read-only
From: |
Stefan Monnier |
Subject: |
Re: Text-Properties and read-only |
Date: |
01 Apr 2003 16:46:58 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
>>>>> "Mario" == Mario Domgörgen <kanaldrache@gmx.de> writes:
> My point is between a read-only character and the end of the buffer and
> "(get-text-property (point) 'read-only)" resulted in nil, but if i try
> to overwrite that character i get "Text is read-only"?! Very strange...
That's because of the subtleties of boundary conditions.
Text-properties apply to characters, so (get-text-property (point)
'read-only) gives you the text-property of the char after position (point)
(which in your case doesn't exist and is by convention defined to not have
any property. It could/should signal an error instead).
So what is the value of the read-only property "at point" (i.e. between
the char before point and the char after point) ? Well it depends on the
property before point and the property after point and the stickiness of
that property: a property can be front-sticky and/or rear-sticky.
By default properties are rear-sticky which means that a char inserted
after such a property will inherit it. `read-only' is like that.
So in your case, the read-only property between the char before point
and the (non-existent) char after point is non-nil because it's inherited
from the char before point.
Stefan