all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Text-Properties and read-only
@ 2003-04-01 20:09 Mario Domgörgen
  2003-04-01 21:46 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Mario Domgörgen @ 2003-04-01 20:09 UTC (permalink / raw)


Hey group!

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...

Any idea?

Mario

-- 
A file that big?
It might be very useful.
But now it is gone.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Text-Properties and read-only
  2003-04-01 20:09 Text-Properties and read-only Mario Domgörgen
@ 2003-04-01 21:46 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2003-04-01 21:46 UTC (permalink / raw)


>>>>> "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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-01 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-01 20:09 Text-Properties and read-only Mario Domgörgen
2003-04-01 21:46 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.